|
276 | 276 | loopMaxIterations: this.PCOUNT, |
277 | 277 | output: [ this.PCOUNT*3 ], |
278 | 278 | pipeline: true, |
279 | | - // argumentTypes: { |
280 | | - // particles: 'NumberTexture', |
281 | | - // velocities: 'NumberTexture', |
282 | | - // attrs: 'NumberTexture', |
283 | | - // playerPos: 'Array(3)', |
284 | | - // pullMass: 'Number', |
285 | | - // dt: 'Number' |
286 | | - // } |
287 | 279 | }); |
288 | 280 |
|
289 | 281 | /* |
|
303 | 295 | pipeline: true, |
304 | 296 | constants: { PCOUNT: this.PCOUNT, pitch }, |
305 | 297 | loopMaxIterations: this.PCOUNT, |
306 | | - // argumentTypes: { |
307 | | - // list: 'NumberTexture', |
308 | | - // index: 'Number', |
309 | | - // setv: 'Array(3)' |
310 | | - // } |
311 | 298 | }); |
312 | 299 | }; |
313 | 300 |
|
|
326 | 313 | output: [ this.PCOUNT*3 ], |
327 | 314 | pipeline: true, |
328 | 315 | loopMaxIterations: this.PCOUNT, |
329 | | - // argumentTypes: { |
330 | | - // particles: 'NumberTexture', |
331 | | - // velocities: 'NumberTexture', |
332 | | - // dt: 'Number' |
333 | | - // } |
334 | 316 | }); |
335 | 317 |
|
336 | 318 | this.camRotKernel = this.gpu.createKernel(function(rotLR, rotUD, camCenter, camDir, camUp, camNearWidth, camFarWidth, camDist) { |
|
353 | 335 | }, { |
354 | 336 | debug: false, |
355 | 337 | output: [ 3 ], |
356 | | - // argumentTypes: { |
357 | | - // rotLR: 'Number', |
358 | | - // rotUD: 'Number', |
359 | | - // camCenter: 'Array(3)', |
360 | | - // camDir: 'Array(3)', |
361 | | - // camUp: 'Array(3)', |
362 | | - // camNearWidth: 'Number', |
363 | | - // camFarWidth: 'Number', |
364 | | - // camDist: 'Number' |
365 | | - // } |
366 | 338 | }); |
367 | 339 |
|
368 | 340 | /* |
|
470 | 442 | }, |
471 | 443 | loopMaxIterations: 48 * this.PCOUNT, |
472 | 444 | output: [this.RSIZE, this.RSIZE], |
473 | | - // argumentTypes: { |
474 | | - // hash: 'Array', |
475 | | - // attrs: 'NumberTexture', |
476 | | - // camCenter: 'Array(3)', |
477 | | - // camDir: 'Array(3)', |
478 | | - // camUp: 'Array(3)', |
479 | | - // camNearWidth: 'Number', |
480 | | - // camFarWidth: 'Number', |
481 | | - // camDist: 'Number' |
482 | | - // } |
483 | 445 | }), |
484 | 446 | this.gpu.createKernel(function(positions, camCenter, camDir, camUp, camNearWidth, camFarWidth, camDist) { |
485 | 447 | let uv = [this.thread.x / (this.constants.RSIZE-1), this.thread.y / (this.constants.RSIZE-1)]; |
|
654 | 616 | }, |
655 | 617 | loopMaxIterations: 48 * this.PCOUNT, |
656 | 618 | output: [this.RSIZE, this.RSIZE], |
657 | | - // argumentTypes: { |
658 | | - // hash: 'Array', |
659 | | - // attrs: 'NumberTexture', |
660 | | - // camCenter: 'Array(3)', |
661 | | - // camDir: 'Array(3)', |
662 | | - // camUp: 'Array(3)', |
663 | | - // camNearWidth: 'Number', |
664 | | - // camFarWidth: 'Number', |
665 | | - // camDist: 'Number' |
666 | | - // } |
667 | 619 | }) |
668 | 620 | ]; |
669 | 621 |
|
|
820 | 772 | return arr[this.thread.x]; |
821 | 773 | }, { |
822 | 774 | debug: false, |
823 | | - outputToTexture: false, |
| 775 | + pipeline: false, |
824 | 776 | output: [this.PCOUNT * 3] |
825 | 777 | }); |
826 | 778 |
|
|
1076 | 1028 | this.cam.dir.y = ret[1]; |
1077 | 1029 | this.cam.dir.z = ret[2]; |
1078 | 1030 |
|
1079 | | - dlen = Math.sqrt(this.cam.dir.x*this.cam.dir.x + this.cam.dir.y*this.cam.dir.y + this.cam.dir.z*this.cam.dir.z); |
| 1031 | + var dlen = Math.sqrt(this.cam.dir.x*this.cam.dir.x + this.cam.dir.y*this.cam.dir.y + this.cam.dir.z*this.cam.dir.z); |
1080 | 1032 | this.cam.p.x += (this.cam.dir.x/dlen) * this.move.tFR * dt * 6; |
1081 | 1033 | this.cam.p.y += (this.cam.dir.y/dlen) * this.move.tFR * dt * 6; |
1082 | 1034 | this.cam.p.z += (this.cam.dir.z/dlen) * this.move.tFR * dt * 6; |
|
1313 | 1265 | out[1] = a[1] / length; |
1314 | 1266 | out[2] = a[2] / length; |
1315 | 1267 | return out; |
1316 | | - } |
| 1268 | + }; |
1317 | 1269 |
|
1318 | 1270 | /** |
1319 | 1271 | * Basis quaternions, for your convenience. |
|
0 commit comments