@deck.gl/mesh-layers
Advanced tools
Comparing version 7.3.0-alpha.7 to 7.3.0-beta.1
@@ -1,1 +0,1 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("luma"),require("deck"));else if("function"==typeof define&&define.amd)define(["luma","deck"],t);else{var n="object"==typeof exports?t(require("luma"),require("deck")):t(e.luma,e.deck);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(t,n){t.exports=e},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var o=n(14);function r(t,n,i){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=r=Reflect.get:e.exports=r=function(e,t,n){var r=o(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}},r(t,n,i||t)}e.exports=r},function(e,n){e.exports=t},function(e,t,n){e.exports=n(16)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e}},function(e,t,n){var o=n(9),r=n(13);e.exports=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?r(e):t}},function(e,t,n){var o=n(15);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=o=function(e){return n(e)}:e.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},o(t)}e.exports=o},function(e,t){function n(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(o,r)}e.exports=function(e){return function(){var t=this,o=arguments;return new Promise((function(r,i){var a=e.apply(t,o);function s(e){n(a,r,i,s,c,"next",e)}function c(e){n(a,r,i,s,c,"throw",e)}s(void 0)}))}}},function(e,t,n){(function(t){const o=n(17),r=("undefined"==typeof window?t:window).deck||{};if(!r.Layer)throw new Error("@deck.gl/core is not found");e.exports=Object.assign(r,o)}).call(this,n(12))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var o=n(1);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}},function(e,t){function n(t,o){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,o)}e.exports=n},function(e,t,n){var o=function(e){"use strict";var t,n=Object.prototype,o=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function c(e,t,n,o){var r=t&&t.prototype instanceof d?t:d,i=Object.create(r.prototype),a=new P(o||[]);return i._invoke=function(e,t,n){var o=u;return function(r,i){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===r)throw i;return M()}for(n.method=r,n.arg=i;;){var a=n.delegate;if(a){var s=L(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===u)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=l(e,t,n);if("normal"===c.type){if(o=n.done?m:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u="suspendedStart",f="suspendedYield",p="executing",m="completed",h={};function d(){}function v(){}function y(){}var g={};g[i]=function(){return this};var _=Object.getPrototypeOf,x=_&&_(_(E([])));x&&x!==n&&o.call(x,i)&&(g=x);var b=y.prototype=d.prototype=Object.create(g);function O(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function S(e){var t;this._invoke=function(n,r){function i(){return new Promise((function(t,i){!function t(n,r,i,a){var s=l(e[n],e,r);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):Promise.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return t("throw",e,i,a)}))}a(s.arg)}(n,r,t,i)}))}return t=t?t.then(i,i):i()}}function L(e,n){var o=e.iterator[n.method];if(o===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=l(o,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;var i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function E(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:M}}function M(){return{value:t,done:!0}}return v.prototype=b.constructor=y,y.constructor=v,y[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},O(S.prototype),S.prototype[a]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,o,r){var i=new S(c(t,n,o,r));return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(b),b[s]="Generator",b[i]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var o=t.pop();if(o in e)return n.value=o,n.done=!1,n}return n.done=!0,n}},e.values=E,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(w),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(o,r){return s.type="throw",s.arg=e,n.next=o,r&&(n.method="next",n.arg=t),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;w(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,o){return this.delegate={iterator:E(e),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=o}catch(e){Function("r","regeneratorRuntime = r")(o)}},function(e,t,n){"use strict";n.r(t);var o=n(5),r=n.n(o),i=n(6),a=n.n(i),s=n(7),c=n.n(s),l=n(1),u=n.n(l),f=n(2),p=n.n(f),m=n(8),h=n.n(m),d=n(3),v=n(0),y=Math.PI/180,g=new Float32Array(16),_=new Float32Array(12);function x(e,t,n){var o=t[0]*y,r=t[1]*y,i=t[2]*y,a=Math.sin(i),s=Math.sin(o),c=Math.sin(r),l=Math.cos(i),u=Math.cos(o),f=Math.cos(r),p=n[0],m=n[1],h=n[2];e[0]=p*f*u,e[1]=p*c*u,e[2]=p*-s,e[3]=m*(-c*l+f*s*a),e[4]=m*(f*l+c*s*a),e[5]=m*u*a,e[6]=h*(c*a+f*s*l),e[7]=h*(-f*a+c*s*l),e[8]=h*u*l}function b(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var O={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,o=t.endRow,r=this.props,i=r.data,a=r.getOrientation,s=r.getScale,c=r.getTranslation,l=r.getTransformMatrix,u=Array.isArray(l),f=u&&16===l.length,p=Array.isArray(s),m=Array.isArray(a),h=Array.isArray(c),v=f||!u&&Boolean(l(i[0]));e.constant=v?f:m&&p&&h;var y=e.value;if(e.constant){var O;if(v)g.set(l),O=b(g);else x(O=_,a,s),O.set(c,9);e.value=new Float32Array(O)}else{var S=n*e.size,L=Object(d.createIterable)(i,n,o),C=L.iterable,w=L.objectInfo,P=!0,E=!1,M=void 0;try{for(var T,A=C[Symbol.iterator]();!(P=(T=A.next()).done);P=!0){var j=T.value;w.index++;var R=void 0;if(v)g.set(f?l:l(j,w)),R=b(g);else x(R=_,m?a:a(j,w),p?s:s(j,w)),R.set(h?c:c(j,w),9);y[S++]=R[0],y[S++]=R[1],y[S++]=R[2],y[S++]=R[3],y[S++]=R[4],y[S++]=R[5],y[S++]=R[6],y[S++]=R[7],y[S++]=R[8],y[S++]=R[9],y[S++]=R[10],y[S++]=R[11]}}catch(e){E=!0,M=e}finally{try{P||null==A.return||A.return()}finally{if(E)throw M}}}}};function S(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function L(e){if(e.attributes)return S(e.attributes),e instanceof v.Geometry?e:new v.Geometry(e);if(e.positions||e.POSITION)return S(e),new v.Geometry({attributes:e});throw Error("Invalid mesh")}var C={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},opacity:1,wireframe:!1,material:new v.PhongMaterial,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},w=function(e){function t(){return r()(this,t),c()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"getShaders",value:function(){var e=Object(v.isWebGL2)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xyLow;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",o=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return p()(u()(t.prototype),"getShaders",this).call(this,{vs:n,fs:o,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:this.use64bitPositions()?5130:5126,size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:O}),this.setState({emptyTexture:new v.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,o=e.oldProps,r=e.changeFlags;if(p()(u()(t.prototype),"updateState",this).call(this,{props:n,oldProps:o,changeFlags:r}),n.mesh!==o.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var i=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(i.NORMAL||i.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==o.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){p()(u()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new v.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:L(e),isInstanced:!0})),n=this.state,o=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:o||r,hasTexture:Boolean(o)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,o=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var i=e?function(e,t,n){return t instanceof v.Texture2D?t:new v.Texture2D(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:i}),r&&r.setUniforms({sampler:i||o,hasTexture:Boolean(i)})}}]),t}(d.Layer);w.layerName="SimpleMeshLayer",w.defaultProps=C;var P=n(9),E=n.n(P),M=n(4),T=n.n(M),A=n(10),j=n.n(A);function R(){return(R=j()(T.a.mark((function e(t){var n;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach((function(e){e.traverse((function(e){Object.values(e.model.program.uniforms).forEach((function(e){!1===e.loaded&&n.push(e)}))}))})),e.next=4,k((function(){return n.some((function(e){return!e.loaded}))}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return I.apply(this,arguments)}function I(){return(I=j()(T.a.mark((function e(t){return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise((function(e){return requestAnimationFrame(e)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var D=[255,255,255,255],N={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===E()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:D},opacity:{type:"number",min:0,max:1,value:1},_lighting:"flat",_enableOffsetModelMatrix:!1,_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},z=function(e){function t(){return r()(this,t),c()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:this.use64bitPositions()?5130:5126,accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:D,transition:!0},instanceModelMatrix:O})}},{key:"updateState",value:function(e){p()(u()(t.prototype),"updateState",this).call(this,e);var n=e.props,o=e.oldProps;n.scenegraph!==o.scenegraph?this._updateScenegraph(n):n._animations!==o._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){p()(u()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,o=this.context.gl;if(e.scenegraph instanceof v.ScenegraphNode)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,i=Object(v.createGLTFObjects)(o,r,this.getLoadOptions());t=Object.assign({gltf:r},i),function(e){return R.apply(this,arguments)}(i).then((function(){return n.setNeedsRedraw()}))}else v.log.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var a={layer:this,gl:o},s=e.getScene(t,a),c=e.getAnimator(t,a);s instanceof v.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,c,e._animations),this.setState({scenegraph:s,animator:c})):null!==s&&v.log.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse((function(e){t._setModelAttributes(e.model,n)}))}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var o=t.getAnimations();Object.keys(n).sort().forEach((function(e){var t=n[e];if("*"===e)o.forEach((function(e){Object.assign(e,t)}));else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r<o.length?Object.assign(o[r],t):v.log.warn("animation ".concat(e," not found"))()}else{var i=o.find((function(t){return t.name===e}));i?Object.assign(i,t):v.log.warn("animation ".concat(e," not found"))()}}))}}},{key:"_deleteScenegraph",value:function(){var e=this.state.scenegraph;e instanceof v.ScenegraphNode&&e.delete()}},{key:"addVersionToShader",value:function(e){return Object(v.isWebGL2)(this.context.gl)?"#version 300 es\n".concat(e):e}},{key:"getLoadOptions",value:function(){var e=["project32","picking"],t=this.props,n=t._lighting,o=t._imageBasedLightingEnvironment;"pbr"===n&&e.push(v.pbr);var r=null;return o&&(r="function"==typeof o?o({gl:this.context.gl,layer:this}):o),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:r,modelOptions:{vs:this.addVersionToShader("#if (__VERSION__ < 300)\n #define _attribute attribute\n #define _varying varying\n#else\n #define _attribute in\n#define _varying out\n#endif\n_attribute vec3 instancePositions;\n_attribute vec2 instancePositions64xyLow;\n_attribute vec4 instanceColors;\n_attribute vec3 instancePickingColors;\n_attribute mat3 instanceModelMatrix;\n_attribute vec3 instanceTranslation;\nuniform float sizeScale;\nuniform mat4 sceneModelMatrix;\nuniform bool enableOffsetModelMatrix;\n_attribute vec4 POSITION;\n\n#ifdef HAS_UV\n _attribute vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n _attribute vec4 NORMAL;\n #endif\n#endif\n_varying vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n _varying vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif \n geometry.uv = pbr_vUV;\n #endif\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;\n\n if(enableOffsetModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n"),fs:this.addVersionToShader("#if (__VERSION__ < 300)\n #define _varying varying\n #define _texture2D texture2D\n #define fragmentColor gl_FragColor\n#else\n #define _varying in\n #define _texture2D texture\n out vec4 fragmentColor;\n#endif\nuniform float opacity;\n_varying vec4 vColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n _varying vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * _texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n"),modules:e,isInstanced:!0},useTangents:!1}}},{key:"updateAttributes",value:function(e){var t=this;this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse((function(n){t._setModelAttributes(n.model,e)}))}},{key:"draw",value:function(e){var t=e.moduleParameters,n=void 0===t?null:t,o=e.parameters,r=void 0===o?{}:o,i=e.context;if(this.state.scenegraph){this.props._animations&&this.state.animator&&this.state.animator.animate(i.animationProps.time);var a=this.props,s=a.sizeScale,c=a.opacity,l=a._enableOffsetModelMatrix,u=this.getNumInstances();this.state.scenegraph.traverse((function(e,t){var o=t.worldMatrix;e.model.setInstanceCount(u),e.updateModuleSettings(n),e.draw({parameters:r,uniforms:{sizeScale:s,opacity:c,enableOffsetModelMatrix:l,sceneModelMatrix:o,u_Camera:e.model.program.uniforms.project_uCameraPosition}})}))}}}]),t}(d.Layer);z.layerName="ScenegraphLayer",z.defaultProps=N,n.d(t,"SimpleMeshLayer",(function(){return w})),n.d(t,"ScenegraphLayer",(function(){return z}))}])})); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("luma"),require("deck"));else if("function"==typeof define&&define.amd)define(["luma","deck"],t);else{var n="object"==typeof exports?t(require("luma"),require("deck")):t(e.luma,e.deck);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(t,n){t.exports=e},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var o=n(14);function r(t,n,i){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=r=Reflect.get:e.exports=r=function(e,t,n){var r=o(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}},r(t,n,i||t)}e.exports=r},function(e,n){e.exports=t},function(e,t,n){e.exports=n(16)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e}},function(e,t,n){var o=n(9),r=n(13);e.exports=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?r(e):t}},function(e,t,n){var o=n(15);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=o=function(e){return n(e)}:e.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},o(t)}e.exports=o},function(e,t){function n(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(o,r)}e.exports=function(e){return function(){var t=this,o=arguments;return new Promise((function(r,i){var a=e.apply(t,o);function s(e){n(a,r,i,s,c,"next",e)}function c(e){n(a,r,i,s,c,"throw",e)}s(void 0)}))}}},function(e,t,n){(function(t){const o=n(17),r=("undefined"==typeof window?t:window).deck||{};if(!r.Layer)throw new Error("@deck.gl/core is not found");e.exports=Object.assign(r,o)}).call(this,n(12))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var o=n(1);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}},function(e,t){function n(t,o){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,o)}e.exports=n},function(e,t,n){var o=function(e){"use strict";var t,n=Object.prototype,o=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function c(e,t,n,o){var r=t&&t.prototype instanceof d?t:d,i=Object.create(r.prototype),a=new P(o||[]);return i._invoke=function(e,t,n){var o=u;return function(r,i){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===r)throw i;return M()}for(n.method=r,n.arg=i;;){var a=n.delegate;if(a){var s=L(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===u)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=l(e,t,n);if("normal"===c.type){if(o=n.done?m:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u="suspendedStart",f="suspendedYield",p="executing",m="completed",h={};function d(){}function v(){}function y(){}var g={};g[i]=function(){return this};var _=Object.getPrototypeOf,x=_&&_(_(E([])));x&&x!==n&&o.call(x,i)&&(g=x);var b=y.prototype=d.prototype=Object.create(g);function O(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function S(e){var t;this._invoke=function(n,r){function i(){return new Promise((function(t,i){!function t(n,r,i,a){var s=l(e[n],e,r);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):Promise.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return t("throw",e,i,a)}))}a(s.arg)}(n,r,t,i)}))}return t=t?t.then(i,i):i()}}function L(e,n){var o=e.iterator[n.method];if(o===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=l(o,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;var i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function E(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:M}}function M(){return{value:t,done:!0}}return v.prototype=b.constructor=y,y.constructor=v,y[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},O(S.prototype),S.prototype[a]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,o,r){var i=new S(c(t,n,o,r));return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(b),b[s]="Generator",b[i]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var o=t.pop();if(o in e)return n.value=o,n.done=!1,n}return n.done=!0,n}},e.values=E,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(w),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(o,r){return s.type="throw",s.arg=e,n.next=o,r&&(n.method="next",n.arg=t),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;w(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,o){return this.delegate={iterator:E(e),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=o}catch(e){Function("r","regeneratorRuntime = r")(o)}},function(e,t,n){"use strict";n.r(t);var o=n(5),r=n.n(o),i=n(6),a=n.n(i),s=n(7),c=n.n(s),l=n(1),u=n.n(l),f=n(2),p=n.n(f),m=n(8),h=n.n(m),d=n(3),v=n(0),y=Math.PI/180,g=new Float32Array(16),_=new Float32Array(12);function x(e,t,n){var o=t[0]*y,r=t[1]*y,i=t[2]*y,a=Math.sin(i),s=Math.sin(o),c=Math.sin(r),l=Math.cos(i),u=Math.cos(o),f=Math.cos(r),p=n[0],m=n[1],h=n[2];e[0]=p*f*u,e[1]=p*c*u,e[2]=p*-s,e[3]=m*(-c*l+f*s*a),e[4]=m*(f*l+c*s*a),e[5]=m*u*a,e[6]=h*(c*a+f*s*l),e[7]=h*(-f*a+c*s*l),e[8]=h*u*l}function b(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var O={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,o=t.endRow,r=this.props,i=r.data,a=r.getOrientation,s=r.getScale,c=r.getTranslation,l=r.getTransformMatrix,u=Array.isArray(l),f=u&&16===l.length,p=Array.isArray(s),m=Array.isArray(a),h=Array.isArray(c),v=f||!u&&Boolean(l(i[0]));e.constant=v?f:m&&p&&h;var y=e.value;if(e.constant){var O;if(v)g.set(l),O=b(g);else x(O=_,a,s),O.set(c,9);e.value=new Float32Array(O)}else{var S=n*e.size,L=Object(d.createIterable)(i,n,o),C=L.iterable,w=L.objectInfo,P=!0,E=!1,M=void 0;try{for(var T,A=C[Symbol.iterator]();!(P=(T=A.next()).done);P=!0){var j=T.value;w.index++;var R=void 0;if(v)g.set(f?l:l(j,w)),R=b(g);else x(R=_,m?a:a(j,w),p?s:s(j,w)),R.set(h?c:c(j,w),9);y[S++]=R[0],y[S++]=R[1],y[S++]=R[2],y[S++]=R[3],y[S++]=R[4],y[S++]=R[5],y[S++]=R[6],y[S++]=R[7],y[S++]=R[8],y[S++]=R[9],y[S++]=R[10],y[S++]=R[11]}}catch(e){E=!0,M=e}finally{try{P||null==A.return||A.return()}finally{if(E)throw M}}}}};function S(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function L(e){if(e.attributes)return S(e.attributes),e instanceof v.Geometry?e:new v.Geometry(e);if(e.positions||e.POSITION)return S(e),new v.Geometry({attributes:e});throw Error("Invalid mesh")}var C={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},opacity:1,wireframe:!1,material:new v.PhongMaterial,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},w=function(e){function t(){return r()(this,t),c()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"getShaders",value:function(){var e=Object(v.isWebGL2)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xyLow;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",o=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return p()(u()(t.prototype),"getShaders",this).call(this,{vs:n,fs:o,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:this.use64bitPositions()?5130:5126,size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:O}),this.setState({emptyTexture:new v.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,o=e.oldProps,r=e.changeFlags;if(p()(u()(t.prototype),"updateState",this).call(this,{props:n,oldProps:o,changeFlags:r}),n.mesh!==o.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var i=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(i.NORMAL||i.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==o.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){p()(u()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new v.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:L(e),isInstanced:!0})),n=this.state,o=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:o||r,hasTexture:Boolean(o)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,o=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var i=e?function(e,t,n){return t instanceof v.Texture2D?t:new v.Texture2D(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:i}),r&&r.setUniforms({sampler:i||o,hasTexture:Boolean(i)})}}]),t}(d.Layer);w.layerName="SimpleMeshLayer",w.defaultProps=C;var P=n(9),E=n.n(P),M=n(4),T=n.n(M),A=n(10),j=n.n(A);function R(){return(R=j()(T.a.mark((function e(t){var n;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach((function(e){e.traverse((function(e){Object.values(e.model.program.uniforms).forEach((function(e){!1===e.loaded&&n.push(e)}))}))})),e.next=4,k((function(){return n.some((function(e){return!e.loaded}))}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return I.apply(this,arguments)}function I(){return(I=j()(T.a.mark((function e(t){return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise((function(e){return requestAnimationFrame(e)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var D=[255,255,255,255],N={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===E()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:D},opacity:{type:"number",min:0,max:1,value:1},_lighting:"flat",_composeModelMatrix:!1,_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},z=function(e){function t(){return r()(this,t),c()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:this.use64bitPositions()?5130:5126,accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:D,transition:!0},instanceModelMatrix:O})}},{key:"updateState",value:function(e){p()(u()(t.prototype),"updateState",this).call(this,e);var n=e.props,o=e.oldProps;n.scenegraph!==o.scenegraph?this._updateScenegraph(n):n._animations!==o._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){p()(u()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,o=this.context.gl;if(e.scenegraph instanceof v.ScenegraphNode)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,i=Object(v.createGLTFObjects)(o,r,this.getLoadOptions());t=Object.assign({gltf:r},i),function(e){return R.apply(this,arguments)}(i).then((function(){return n.setNeedsRedraw()}))}else v.log.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var a={layer:this,gl:o},s=e.getScene(t,a),c=e.getAnimator(t,a);s instanceof v.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,c,e._animations),this.setState({scenegraph:s,animator:c})):null!==s&&v.log.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse((function(e){t._setModelAttributes(e.model,n)}))}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var o=t.getAnimations();Object.keys(n).sort().forEach((function(e){var t=n[e];if("*"===e)o.forEach((function(e){Object.assign(e,t)}));else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r<o.length?Object.assign(o[r],t):v.log.warn("animation ".concat(e," not found"))()}else{var i=o.find((function(t){return t.name===e}));i?Object.assign(i,t):v.log.warn("animation ".concat(e," not found"))()}}))}}},{key:"_deleteScenegraph",value:function(){var e=this.state.scenegraph;e instanceof v.ScenegraphNode&&e.delete()}},{key:"addVersionToShader",value:function(e){return Object(v.isWebGL2)(this.context.gl)?"#version 300 es\n".concat(e):e}},{key:"getLoadOptions",value:function(){var e=["project32","picking"],t=this.props,n=t._lighting,o=t._imageBasedLightingEnvironment;"pbr"===n&&e.push(v.pbr);var r=null;return o&&(r="function"==typeof o?o({gl:this.context.gl,layer:this}):o),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:r,modelOptions:{vs:this.addVersionToShader("#if (__VERSION__ < 300)\n #define _attribute attribute\n #define _varying varying\n#else\n #define _attribute in\n#define _varying out\n#endif\n_attribute vec3 instancePositions;\n_attribute vec2 instancePositions64xyLow;\n_attribute vec4 instanceColors;\n_attribute vec3 instancePickingColors;\n_attribute mat3 instanceModelMatrix;\n_attribute vec3 instanceTranslation;\nuniform float sizeScale;\nuniform mat4 sceneModelMatrix;\nuniform bool enableOffsetModelMatrix;\n_attribute vec4 POSITION;\n\n#ifdef HAS_UV\n _attribute vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n _attribute vec4 NORMAL;\n #endif\n#endif\n_varying vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n _varying vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif \n geometry.uv = pbr_vUV;\n #endif\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale + instanceTranslation;\n\n if(enableOffsetModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n"),fs:this.addVersionToShader("#if (__VERSION__ < 300)\n #define _varying varying\n #define _texture2D texture2D\n #define fragmentColor gl_FragColor\n#else\n #define _varying in\n #define _texture2D texture\n out vec4 fragmentColor;\n#endif\nuniform float opacity;\n_varying vec4 vColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n _varying vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * _texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n"),modules:e,isInstanced:!0},useTangents:!1}}},{key:"updateAttributes",value:function(e){var t=this;this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse((function(n){t._setModelAttributes(n.model,e)}))}},{key:"draw",value:function(e){var t=e.moduleParameters,n=void 0===t?null:t,o=e.parameters,r=void 0===o?{}:o,i=e.context;if(this.state.scenegraph){this.props._animations&&this.state.animator&&this.state.animator.animate(i.animationProps.time);var a=this.props,s=a.sizeScale,c=a.opacity,l=a._composeModelMatrix,u=this.getNumInstances();this.state.scenegraph.traverse((function(e,t){var o=t.worldMatrix;e.model.setInstanceCount(u),e.updateModuleSettings(n),e.draw({parameters:r,uniforms:{sizeScale:s,opacity:c,enableOffsetModelMatrix:l,sceneModelMatrix:o,u_Camera:e.model.program.uniforms.project_uCameraPosition}})}))}}}]),t}(d.Layer);z.layerName="ScenegraphLayer",z.defaultProps=N,n.d(t,"SimpleMeshLayer",(function(){return w})),n.d(t,"ScenegraphLayer",(function(){return z}))}])})); |
@@ -464,3 +464,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
_lighting: 'flat', | ||
_enableOffsetModelMatrix: false, | ||
_composeModelMatrix: false, | ||
// _lighting must be pbr for this to work | ||
@@ -664,3 +664,3 @@ _imageBasedLightingEnvironment: null, | ||
const {sizeScale, opacity, _enableOffsetModelMatrix} = this.props; | ||
const {sizeScale, opacity, _composeModelMatrix} = this.props; | ||
const numInstances = this.getNumInstances(); | ||
@@ -675,3 +675,3 @@ this.state.scenegraph.traverse((model, {worldMatrix}) => { | ||
opacity, | ||
enableOffsetModelMatrix: _enableOffsetModelMatrix, | ||
enableOffsetModelMatrix: _composeModelMatrix, | ||
sceneModelMatrix: worldMatrix, | ||
@@ -678,0 +678,0 @@ // Needed for PBR (TODO: find better way to get it) |
@@ -78,3 +78,3 @@ "use strict"; | ||
_lighting: 'flat', | ||
_enableOffsetModelMatrix: false, | ||
_composeModelMatrix: false, | ||
_imageBasedLightingEnvironment: null, | ||
@@ -333,3 +333,3 @@ getOrientation: { | ||
opacity = _this$props2.opacity, | ||
_enableOffsetModelMatrix = _this$props2._enableOffsetModelMatrix; | ||
_composeModelMatrix = _this$props2._composeModelMatrix; | ||
var numInstances = this.getNumInstances(); | ||
@@ -345,3 +345,3 @@ this.state.scenegraph.traverse(function (model, _ref3) { | ||
opacity: opacity, | ||
enableOffsetModelMatrix: _enableOffsetModelMatrix, | ||
enableOffsetModelMatrix: _composeModelMatrix, | ||
sceneModelMatrix: worldMatrix, | ||
@@ -348,0 +348,0 @@ u_Camera: model.model.program.uniforms.project_uCameraPosition |
@@ -44,3 +44,3 @@ import { Layer } from '@deck.gl/core'; | ||
_lighting: 'flat', | ||
_enableOffsetModelMatrix: false, | ||
_composeModelMatrix: false, | ||
_imageBasedLightingEnvironment: null, | ||
@@ -275,3 +275,3 @@ getOrientation: { | ||
opacity, | ||
_enableOffsetModelMatrix | ||
_composeModelMatrix | ||
} = this.props; | ||
@@ -289,3 +289,3 @@ const numInstances = this.getNumInstances(); | ||
opacity, | ||
enableOffsetModelMatrix: _enableOffsetModelMatrix, | ||
enableOffsetModelMatrix: _composeModelMatrix, | ||
sceneModelMatrix: worldMatrix, | ||
@@ -292,0 +292,0 @@ u_Camera: model.model.program.uniforms.project_uCameraPosition |
@@ -55,3 +55,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
_lighting: 'flat', | ||
_enableOffsetModelMatrix: false, | ||
_composeModelMatrix: false, | ||
_imageBasedLightingEnvironment: null, | ||
@@ -311,3 +311,3 @@ getOrientation: { | ||
opacity = _this$props2.opacity, | ||
_enableOffsetModelMatrix = _this$props2._enableOffsetModelMatrix; | ||
_composeModelMatrix = _this$props2._composeModelMatrix; | ||
var numInstances = this.getNumInstances(); | ||
@@ -323,3 +323,3 @@ this.state.scenegraph.traverse(function (model, _ref3) { | ||
opacity: opacity, | ||
enableOffsetModelMatrix: _enableOffsetModelMatrix, | ||
enableOffsetModelMatrix: _composeModelMatrix, | ||
sceneModelMatrix: worldMatrix, | ||
@@ -326,0 +326,0 @@ u_Camera: model.model.program.uniforms.project_uCameraPosition |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "7.3.0-alpha.7", | ||
"version": "7.3.0-beta.1", | ||
"publishConfig": { | ||
@@ -37,5 +37,5 @@ "access": "public" | ||
"dependencies": { | ||
"@luma.gl/addons": "^7.3.0-alpha.8" | ||
"@luma.gl/addons": "^7.3.0-beta.2" | ||
}, | ||
"gitHead": "2732d1192132eaf0a2784116b7a0b69fb2143706" | ||
"gitHead": "d7d413276047af3a4ccd642ae665100950b0aa82" | ||
} |
@@ -53,3 +53,3 @@ // Copyright (c) 2019 Uber Technologies, Inc. | ||
_lighting: 'flat', | ||
_enableOffsetModelMatrix: false, | ||
_composeModelMatrix: false, | ||
// _lighting must be pbr for this to work | ||
@@ -253,3 +253,3 @@ _imageBasedLightingEnvironment: null, | ||
const {sizeScale, opacity, _enableOffsetModelMatrix} = this.props; | ||
const {sizeScale, opacity, _composeModelMatrix} = this.props; | ||
const numInstances = this.getNumInstances(); | ||
@@ -264,3 +264,3 @@ this.state.scenegraph.traverse((model, {worldMatrix}) => { | ||
opacity, | ||
enableOffsetModelMatrix: _enableOffsetModelMatrix, | ||
enableOffsetModelMatrix: _composeModelMatrix, | ||
sceneModelMatrix: worldMatrix, | ||
@@ -267,0 +267,0 @@ // Needed for PBR (TODO: find better way to get it) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
371259