(meshes = [])
| 347 | } |
| 348 | |
| 349 | draw(meshes = []) { |
| 350 | const mesh = this.mesh; |
| 351 | |
| 352 | if(mesh) { |
| 353 | applyFilters(mesh, this.filters); |
| 354 | meshes.push(mesh); |
| 355 | if(this[_program]) { |
| 356 | mesh.setProgram(this[_program]); |
| 357 | const shaderAttrs = this[_shaderAttrs]; |
| 358 | if(shaderAttrs) { |
| 359 | Object.entries(shaderAttrs).forEach(([key, setter]) => { |
| 360 | mesh.setAttribute(key, setter); |
| 361 | }); |
| 362 | } |
| 363 | const uniforms = this[_uniforms]; |
| 364 | if(this[_uniforms]) { |
| 365 | const _uniform = {}; |
| 366 | Object.entries(uniforms).forEach(([key, value]) => { |
| 367 | if(typeof value === 'function') { |
| 368 | value = value(this, key); |
| 369 | } |
| 370 | _uniform[key] = value; |
| 371 | }); |
| 372 | mesh.setUniforms(_uniform); |
| 373 | } |
| 374 | } |
| 375 | applyRenderEvent(this, mesh); |
| 376 | } |
| 377 | return meshes; |
| 378 | } |
| 379 | |
| 380 | forceUpdate() { |
| 381 | if(this.parent) this.parent.forceUpdate(); |
no test coverage detected