-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaframe-ground-component.min.js
More file actions
1 lines (1 loc) · 18.3 KB
/
aframe-ground-component.min.js
File metadata and controls
1 lines (1 loc) · 18.3 KB
1
!function(r){function o(t){if(e[t])return e[t].exports;var a=e[t]={exports:{},id:t,loaded:!1};return r[t].call(a.exports,a,a.exports,o),a.loaded=!0,a.exports}var e={};return o.m=r,o.c=e,o.p="",o(0)}([function(r,o){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("ground",{schema:{active:{default:!1},preset:{default:"default",oneOf:["none","default","contact","egypt","checkerboard","forest","goaland","yavapai","goldmine","arches","threetowers","poison","tron","japan","dream","volcano","starry","osiris"]},seed:{type:"int",default:1,min:0,max:1e3},shadow:{default:!1},shadowSize:{default:10},flatShading:{default:!1},playArea:{type:"float",default:1,min:.5,max:10},ground:{default:"hills",oneOf:["none","flat","hills","canyon","spikes","noise"]},groundYScale:{type:"float",default:3,min:0,max:50},groundXZScale:{type:"float",default:1},groundTexture:{default:"none",oneOf:["none","checkerboard","squares","walkernoise"]},groundColor:{type:"color",default:"#553e35"},groundColor2:{type:"color",default:"#694439"},grid:{default:"none",oneOf:["none","1x1","2x2","crosses","dots","xlines","ylines"]},gridColor:{type:"color",default:"#ccc"},positionY:{type:"float",default:0},resolution:{type:"int",default:64}},multiple:!1,presets:{none:{},default:{active:!0,seed:1,skyType:"atmosphere",skyColor:"#88c",horizonColor:"#ddd",lighting:"distant",lightPosition:{x:-.11,y:1,z:.33},fog:.78,flatShading:!1,playArea:1,ground:"hills",groundYScale:3,groundTexture:"checkerboard",groundColor:"#454545",groundColor2:"#5d5d5d",dressing:"none",dressingAmount:10,dressingColor:"#795449",dressingScale:1,dressingVariance:{x:0,y:0,z:0},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"none",gridColor:"#ccc",shadow:!1},contact:{active:!0,seed:14,skyType:"gradient",skyColor:"#478d54",horizonColor:"#b696cb",lighting:"distant",lightPosition:{x:0,y:2.01,z:-1},fog:.8,flatShading:!1,playArea:1,ground:"spikes",groundYScale:4.91,groundTexture:"none",groundColor:"#2e455f",groundColor2:"#694439",dressing:"apparatus",dressingAmount:7,dressingColor:"#657067",dressingScale:20,dressingVariance:{x:20,y:20,z:20},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"1x1",gridColor:"#478d54",shadow:!1},egypt:{active:!0,seed:26,skyType:"gradient",skyColor:"#1b7660",horizonColor:"#e4b676",lighting:"distant",lightPosition:{x:0,y:1.65,z:-1},fog:.75,flatShading:!1,playArea:1,ground:"hills",groundYScale:5,groundTexture:"walkernoise",groundColor:"#664735",groundColor2:"#6c4b39",dressing:"pyramids",dressingAmount:10,dressingColor:"#7c5c45",dressingScale:5,dressingVariance:{x:20,y:20,z:20},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"spots",gridColor:"#e4b676",shadow:!1},checkerboard:{active:!0,seed:1,skyType:"gradient",skyColor:"#0d0d0d",horizonColor:"#404040",lighting:"distant",lightPosition:{x:0,y:1,z:-.2},fog:.81,flatShading:!0,playArea:1,ground:"hills",groundYScale:4.81,groundTexture:"checkerboard",groundColor:"#252525",groundColor2:"#111111",dressing:"cubes",dressingAmount:10,dressingColor:"#9f9f9f",dressingScale:1.51,dressingVariance:{x:5,y:20,z:5},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"dots",gridColor:"#ccc",shadow:!1},forest:{active:!0,seed:8,skyType:"gradient",skyColor:"#24b59f",horizonColor:"#eff9b7",lighting:"distant",lightPosition:{x:-1.2,y:.88,z:-.55},fog:.8,flatShading:!1,playArea:1,ground:"noise",groundYScale:4.18,groundTexture:"squares",groundColor:"#937a24",groundColor2:"#987d2e",dressing:"trees",dressingAmount:500,dressingColor:"#888b1d",dressingScale:1,dressingVariance:{x:10,y:10,z:10},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"none",gridColor:"#c5a543",shadow:!1},goaland:{active:!0,seed:17,skyType:"gradient",skyColor:"#14645f",horizonColor:"#a3dab8",lighting:"point",lightPosition:{x:.1,y:4,z:.56},fog:.73,flatShading:!1,playArea:1,ground:"noise",groundYScale:.81,groundTexture:"none",groundColor:"#ae3241",groundColor2:"#db4453",dressing:"mushrooms",dressingAmount:150,dressingColor:"#a9313d",dressingScale:5,dressingVariance:{x:5,y:10,z:5},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"dots",gridColor:"#239893",shadow:!1},yavapai:{active:!0,seed:11,skyType:"gradient",skyColor:"#239849",horizonColor:"#cfe0af",lighting:"distant",lightPosition:{x:.5,y:1,z:0},fog:.8,flatShading:!0,playArea:1,ground:"canyon",groundYScale:9.76,groundTexture:"walkernoise",groundColor:"#C66344",groundColor2:"#c96b4b",dressing:"stones",dressingAmount:500,dressingColor:"#C66344",dressingScale:.06,dressingVariance:{x:.2,y:.1,z:.2},dressingUniformScale:!0,dressingOnPlayArea:1,grid:"none",gridColor:"#239893",shadow:!1},goldmine:{active:!0,seed:53,skyType:"gradient",skyColor:"#1e1c1a",horizonColor:"#8c7964",lighting:"point",lightPosition:{x:-.09,y:3,z:.33},fog:.43,flatShading:!0,playArea:1.08,ground:"canyon",groundYScale:50,groundTexture:"none",groundColor:"#353535",groundColor2:"#454545",dressing:"hexagons",dressingAmount:300,dressingColor:"#fe921b",dressingScale:.5,dressingVariance:{x:2,y:8,z:2},dressingUniformScale:!0,dressingOnPlayArea:.03,grid:"none",gridColor:"#ccc",shadow:!1},threetowers:{active:!0,seed:5,skyType:"gradient",skyColor:"#23a06b",horizonColor:"#f5e170",lighting:"distant",lightPosition:{x:.5,y:1,z:0},fog:.8,flatShading:!1,playArea:1,ground:"spikes",groundYScale:4.26,groundTexture:"walkernoise",groundColor:"#273a49",groundColor2:"#2b464f",dressing:"towers",dressingAmount:3,dressingColor:"#5f6d94",dressingScale:50,dressingVariance:{x:10,y:100,z:10},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"none",gridColor:"#239893",shadow:!1},poison:{active:!0,seed:92,skyType:"gradient",skyColor:"#1ea84a",horizonColor:"#177132",lighting:"distant",lightPosition:{x:.5,y:1,z:0},fog:.8,flatShading:!1,playArea:1,ground:"canyon",groundYScale:9.76,groundTexture:"none",groundColor:"#851f31",groundColor2:"#912235",dressing:"hexagons",dressingAmount:20,dressingColor:"#c7415b",dressingScale:20,dressingVariance:{x:20,y:200,z:20},dressingUniformScale:!1,dressingOnPlayArea:0,grid:"crosses",gridColor:"#1ea84a",shadow:!1},arches:{active:!0,seed:19,skyType:"atmosphere",skyColor:"#8cbdc8",horizonColor:"#ddd",lighting:"distant",lightPosition:{x:-.11,y:.16,z:.33},fog:.67,flatShading:!0,playArea:1,ground:"canyon",groundYScale:10,groundTexture:"walkernoise",groundColor:"#a87d6f",groundColor2:"#795449",dressing:"arches",dressingAmount:6,dressingColor:"#795449",dressingScale:26,dressingVariance:{x:20,y:40,z:20},dressingUniformScale:!0,dressingOnPlayArea:.04,grid:"none",gridColor:"#ccc",shadow:!1},tron:{active:!0,seed:14,skyType:"gradient",skyColor:"#091b39",horizonColor:"#284a9e",lighting:"distant",lightPosition:{x:-.72,y:.62,z:.4},fog:.8,flatShading:!1,playArea:1,ground:"spikes",groundYScale:4.91,groundTexture:"none",groundColor:"#061123",groundColor2:"#694439",dressing:"towers",dressingAmount:5,dressingColor:"#fb000e",dressingScale:15,dressingVariance:{x:20,y:20,z:20},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"1x1",gridColor:"#fb000e",shadow:!1},japan:{active:!0,seed:14,skyType:"gradient",skyColor:"#7e5db5",horizonColor:"#b4adda",lighting:"distant",lightPosition:{x:1.33,y:1,z:.24},fog:.9,flatShading:!1,playArea:1,ground:"hills",groundYScale:25,groundTexture:"walkernoise",groundColor:"#7e5db5",groundColor2:"#cabdf5",dressing:"torii",dressingAmount:4,dressingColor:"#bc5e7c",dressingScale:15,dressingVariance:{x:0,y:0,z:0},dressingUniformScale:!0,dressingOnPlayArea:0,grid:"spots",gridColor:"#e4b676",shadow:!1},dream:{active:!0,seed:17,skyType:"gradient",skyColor:"#87faf4",horizonColor:"#b34093",lighting:"distant",lightPosition:{x:-.72,y:.53,z:.97},fog:.8,flatShading:!1,playArea:1,ground:"hills",groundYScale:20,groundTexture:"checkerboard",groundColor:"#b34093",groundColor2:"#c050a2",dressing:"mushrooms",dressingAmount:300,dressingColor:"#3cf7ed",dressingScale:.2,dressingVariance:{x:.2,y:.2,z:.2},dressingUniformScale:!0,dressingOnPlayArea:1,grid:"none",gridColor:"#239893",shadow:!1},volcano:{active:!0,seed:92,skyType:"gradient",skyColor:"#4a070f",horizonColor:"#f62300",lighting:"point",lightPosition:{x:.5,y:2.25,z:0},fog:.87,flatShading:!1,playArea:1,ground:"canyon",groundYScale:9.76,groundTexture:"walkernoise",groundColor:"#fb0803",groundColor2:"#510000",dressing:"arches",dressingAmount:15,dressingColor:"#fb0803",dressingScale:3,dressingVariance:{x:10,y:100,z:10},dressingUniformScale:!1,dressingOnPlayArea:.2,grid:"none",gridColor:"#fa0e00",shadow:!1},starry:{active:!0,seed:1,skyType:"atmosphere",skyColor:"#88c",horizonColor:"#ddd",lighting:"distant",lightPosition:{x:0,y:-.01,z:-.46},fog:.7,flatShading:!1,playArea:1,ground:"hills",groundYScale:3,groundTexture:"none",groundColor:"#553e35",groundColor2:"#694439",dressing:"none",dressingAmount:100,dressingColor:"#795449",dressingScale:5,dressingVariance:{x:1,y:1,z:1},dressingUniformScale:!0,grid:"1x1",dressingOnPlayArea:0,gridColor:"#39d2f2",shadow:!1},osiris:{active:!0,seed:46,skyType:"atmosphere",skyColor:"#88c",horizonColor:"#ddd",lighting:"distant",lightPosition:{x:0,y:.02,z:-.46},fog:0,flatShading:!1,playArea:1,ground:"hills",groundYScale:3,groundTexture:"none",groundColor:"#9e7b47",groundColor2:"#9e7b47",dressing:"pyramids",dressingAmount:7,dressingColor:"#9e7b47",dressingScale:5,dressingVariance:{x:30,y:30,z:30},dressingUniformScale:!0,grid:"dots",dressingOnPlayArea:0,gridColor:"#daa452",shadow:!1}},init:function(){this.groundData={},this.STAGE_SIZE=200,this.groundMaterial=null,this.ground=document.createElement("a-entity"),this.ground.setAttribute("rotation","-90 0 0"),this.ground.setAttribute("position","0 "+this.data.positionY+" 0"),this.ground.classList.add("groundGround"),this.ground.classList.add("ground"),this.groundCanvas=null,this.groundTexture=null,this.groundMaterial=null,this.groundGeometry=null,this.gridCanvas=null,this.gridTexture=null,this.el.appendChild(this.ground)},update:function(r){var o;this.data.preset?(o=AFRAME.utils.clone(this.groundData),this.groundData={},Object.assign(this.groundData,this.data),Object.assign(this.groundData,this.presets[this.data.preset]),Object.assign(this.groundData,this.el.components.ground.attrValue),console.log(this.groundData)):(o=r,this.groundData=this.data);var e=!this.groundGeometry||this.groundData.seed!=o.seed||this.groundData.ground!=o.ground||this.groundData.playArea!=o.playArea||this.groundData.flatShading!=o.flatShading;(e||this.groundData.groundColor!=o.groundColor||this.groundData.groundColor2!=o.groundColor2||this.groundData.groundYScale!=o.groundYScale||this.groundData.groundTexture!=o.groundTexture||this.groundData.gridColor!=o.gridColor||this.groundData.grid!=o.grid)&&this.updateGround(e),this.el.setAttribute("visible",this.groundData.active),this.dumpParametersDiff()},logPreset:function(){var r="{";for(var o in this.schema)if("preset"!=o){r+=o+": ";var e=this.schema[o].type;r+="vec3"==e?"{ x: "+this.groundData[o].x+", y: "+this.groundData[o].y+", z: "+this.groundData[o].z+"}":"string"==e||"color"==e?'"'+this.groundData[o]+'"':this.groundData[o],r+=", "}r+="}",console.log(r)},dumpParametersDiff:function(){function r(r){return Math.floor(1e3*r)/1e3}var o=[],e="none"!=this.data.preset&&this.presets[this.data.preset];e&&o.push("preset: "+this.data.preset);for(var t in this.schema)if(!("preset"==t||e&&void 0===e[t])){var a=e?e[t]:this.schema[t].default,n=this.groundData[t],s=this.schema[t].type;if("vec3"==s){var i=a;"string"==typeof a&&(a=a.split(" "),i={x:a[0],y:a[1],z:a[2]}),r(i.x)==r(n.x)&&r(i.y)==r(n.y)&&r(i.z)==r(n.z)||o.push(t+": "+r(n.x)+" "+r(n.y)+" "+r(n.z))}else a!=n&&("number"==this.schema[t].type&&(n=r(n)),o.push(t+": "+n))}console.log("%c"+o.join("; "),"color: #f48;font-weight:bold")},random:function(r){return parseFloat("0."+Math.sin(9999*this.groundData.seed*r).toString().substr(7))},updateGround:function(r){var o=this.data.resolution;if(r){var t="none"!=this.groundData.ground;if(this.ground.setAttribute("visible",t),!t)return;this.groundGeometry||(this.groundGeometry=new THREE.PlaneGeometry(this.STAGE_SIZE+2,this.STAGE_SIZE+2,o-1,o-1));for(var a=new e,n=this.groundGeometry.vertices,s=this.groundGeometry.vertices.length,i=10,d=i/o,g=0,l=0,h=0;g<s;g++)if("flat"!=this.groundData.ground){var u;switch(this.groundData.ground){case"hills":u=Math.max(0,a.noise(l,h,0));break;case"canyon":u=.2+.8*a.noise(l,h,0),u=Math.min(1,10*Math.pow(u,2));break;case"spikes":u=this.random(g)<.02?this.random(g+1):0;break;case"noise":u=this.random(g)<.35?this.random(g+1):0}u+=.1*this.random(g+2);var c=2*l/i-1,f=2*h/i-1,y=this.groundData.playArea;c=Math.max(0,Math.min(1,(Math.abs(c)-(y-.9))*(1/y))),f=Math.max(0,Math.min(1,(Math.abs(f)-(y-.9))*(1/y))),u*=c>f?c:f,u<.01&&(u=0),n[g].z=u,l+=d,l>=10&&(l=0,h+=d)}else n[g].z=0;this.groundGeometry.computeFaceNormals(),this.groundData.flatShading?this.groundGeometry.computeFlatVertexNormals():this.groundGeometry.computeVertexNormals(),this.groundGeometry.verticesNeedUpdate=!0,this.groundGeometry.normalsNeedUpdate=!0}this.ground.setAttribute("scale",{z:this.groundData.groundYScale}),this.ground.setAttribute("scale",{x:this.groundData.groundXZScale}),this.ground.setAttribute("scale",{y:this.groundData.groundXZScale});var p=2048,m=20,C=this.STAGE_SIZE/m;this.groundCanvas&&this.groundCanvas.width==p||(this.gridCanvas=document.createElement("canvas"),this.gridCanvas.width=p,this.gridCanvas.height=p,this.gridTexture=new THREE.Texture(this.gridCanvas),this.gridTexture.wrapS=THREE.RepeatWrapping,this.gridTexture.wrapT=THREE.RepeatWrapping,this.gridTexture.repeat.set(C,C),this.groundCanvas=document.createElement("canvas"),this.groundCanvas.width=p,this.groundCanvas.height=p,this.groundTexture=new THREE.Texture(this.groundCanvas),this.groundTexture.wrapS=THREE.RepeatWrapping,this.groundTexture.wrapT=THREE.RepeatWrapping,this.groundTexture.repeat.set(C,C),this.groundMaterialProps={map:this.groundTexture,emissive:new THREE.Color(16777215),emissiveMap:this.gridTexture},(new THREE.Material).hasOwnProperty("shading")?this.groundMaterialProps.shading=this.groundData.flatShading?THREE.FlatShading:THREE.SmoothShading:this.groundMaterialProps.flatShading=this.groundData.flatShading,this.groundMaterial=new THREE.MeshLambertMaterial(this.groundMaterialProps));var x=this.groundCanvas.getContext("2d"),S=this.gridCanvas.getContext("2d");if(this.drawTexture(x,p,m),S.fillStyle="#000000",S.fillRect(0,0,p,p),this.drawGrid(S,p,m),this.groundTexture.needsUpdate=!0,this.gridTexture.needsUpdate=!0,r){var v=new THREE.Mesh(this.groundGeometry,this.groundMaterial);this.ground.setObject3D("mesh",v)}else this.ground.getObject3D("mesh").material=this.groundMaterial;this.ground.setAttribute("shadow",{cast:!1,receive:this.groundData.shadow})},drawGrid:function(r,o,e){if("none"!=this.groundData.grid){var t,a,n,s=Math.floor(e/2),i=o/(e/2);switch(r.fillStyle=this.groundData.gridColor,this.groundData.grid){case"1x1":case"2x2":for("1x1"==this.groundData.grid&&(s*=2,i=o/e),t=0;t<s;t++)n=Math.floor(t*i),r.fillRect(0,n,o,1),r.fillRect(n,0,1,o);break;case"crosses":var d=Math.floor(i/20);for(t=0;t<s+1;t++)for(n=Math.floor(t*i),a=0;a<s+1;a++){var g=Math.floor(-d+a*i);r.fillRect(g,n,2*d,1),r.fillRect(n,g,1,2*d)}break;case"dots":for(t=0;t<s+1;t++)for(a=0;a<s+1;a++)r.beginPath(),r.arc(Math.floor(a*i),Math.floor(t*i),4,0,2*Math.PI),r.fill();break;case"xlines":for(t=0;t<s;t++)r.fillRect(Math.floor(t*i),0,1,o);break;case"ylines":for(t=0;t<s;t++)r.fillRect(0,Math.floor(t*i),o,1)}}},drawTexture:function(r,o,t){r.fillStyle=this.groundData.groundColor,r.fillRect(0,0,o,o);var a,n,s,i,d,g,l;if("none"!=this.groundData.groundTexture)switch(this.groundData.groundTexture){case"checkerboard":r.fillStyle=this.groundData.groundColor2;var h=Math.floor(t/2),u=o/(t/2);for(a=0;a<h+1;a+=2)for(var c=0;c<h+1;c++)r.fillRect(Math.floor((a+c%2)*u),Math.floor(c*u),Math.floor(u),Math.floor(u));break;case"squares":var f=16,y=o/f;for(s=new THREE.Color(this.groundData.groundColor),i=new THREE.Color(this.groundData.groundColor2),a=0;a<f*f;a++)n=this.random(a+3)>.5?s.clone():i.clone(),n.addScalar(.1*this.random(a+3)-.05),r.fillStyle="#"+n.getHexString(),r.fillRect(a%f*y,Math.floor(a/f)*y,y,y);break;case"noise":g=r.getImageData(0,0,o,o),d=g.data,s=new THREE.Color(this.groundData.groundColor),i=new THREE.Color(this.groundData.groundColor2);var p=new THREE.Color(i.r-s.r,i.g-s.g,i.b-s.b),m=new e;for(a=0,c=0,l=d.length;a<l;a+=4,c++){var C=m.noise(c%o/o*3,c/o/o*3,0);d[a+0]=Math.floor(255*(s.r+p.r*C)),d[a+1]=Math.floor(255*(s.g+p.g*C)),d[a+2]=Math.floor(255*(s.b+p.b*C))}r.putImageData(g,0,0);break;case"walkernoise":var x=Math.floor(o/2),S=document.createElement("canvas");S.width=x,S.height=x;var v=S.getContext("2d");v.fillStyle=this.groundData.groundColor,v.fillRect(0,0,x,x),g=v.getImageData(0,0,x,x),d=g.data,s=new THREE.Color(this.groundData.groundColor),i=new THREE.Color(this.groundData.groundColor2);var b=[],T=1e3;for(a=0;a<T;a++)n=s.clone().lerp(i,Math.random()),b.push({x:Math.random()*x,y:Math.random()*x,r:Math.floor(255*n.r),g:Math.floor(255*n.g),b:Math.floor(255*n.b)});for(var A=5e3,w=0;w<A;w++)for(a=0;a<T;a++){var M=b[a],k=4*Math.floor(M.y*x+M.x);d[k+0]=M.r,d[k+1]=M.g,d[k+2]=M.b,M.x+=Math.floor(3*Math.random())-1,M.y+=Math.floor(3*Math.random())-1,M.x>=x&&(M.x=M.x-x),M.y>=x&&(M.y=M.y-x),M.x<0&&(M.x=x+M.x),M.y<0&&(M.y=x+M.y)}v.putImageData(g,0,0),r.drawImage(S,0,0,o,o)}}});var e=function(r){void 0==r&&(r=Math),this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];var o;for(o=0;o<256;o++)this.p[o]=Math.floor(256*r.random(666));for(this.perm=[],o=0;o<512;o++)this.perm[o]=this.p[255&o]};e.prototype.dot=function(r,o,e,t){return r[0]*o+r[1]*e+r[2]*t},e.prototype.mix=function(r,o,e){return(1-e)*r+e*o},e.prototype.fade=function(r){return r*r*r*(r*(6*r-15)+10)},e.prototype.noise=function(r,o,e){var t=Math.floor(r),a=Math.floor(o),n=Math.floor(e);r-=t,o-=a,e-=n,t&=255,a&=255,n&=255;var s=this.perm[t+this.perm[a+this.perm[n]]]%12,i=this.perm[t+this.perm[a+this.perm[n+1]]]%12,d=this.perm[t+this.perm[a+1+this.perm[n]]]%12,g=this.perm[t+this.perm[a+1+this.perm[n+1]]]%12,l=this.perm[t+1+this.perm[a+this.perm[n]]]%12,h=this.perm[t+1+this.perm[a+this.perm[n+1]]]%12,u=this.perm[t+1+this.perm[a+1+this.perm[n]]]%12,c=this.perm[t+1+this.perm[a+1+this.perm[n+1]]]%12,f=this.dot(this.grad3[s],r,o,e),y=this.dot(this.grad3[l],r-1,o,e),p=this.dot(this.grad3[d],r,o-1,e),m=this.dot(this.grad3[u],r-1,o-1,e),C=this.dot(this.grad3[i],r,o,e-1),x=this.dot(this.grad3[h],r-1,o,e-1),S=this.dot(this.grad3[g],r,o-1,e-1),v=this.dot(this.grad3[c],r-1,o-1,e-1),b=this.fade(r),T=this.fade(o),A=this.fade(e),w=this.mix(f,y,b),M=this.mix(C,x,b),k=this.mix(p,m,b),z=this.mix(S,v,b),D=this.mix(w,k,T),E=this.mix(M,z,T),P=this.mix(D,E,A);return P}}]);