Skip to content

Commit

Permalink
WebGPURenderer: QuadMesh extended from Mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Mar 6, 2024
1 parent f9e5848 commit 8574b43
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions examples/jsm/objects/QuadMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,25 @@ class QuadGeometry extends BufferGeometry {

const _geometry = new QuadGeometry();

class QuadMesh {
class QuadMesh extends Mesh {

constructor( material = null ) {

this._mesh = new Mesh( _geometry, material );
super( _geometry, material );

}

dispose() {

this._mesh.geometry.dispose();

}

async renderAsync( renderer ) {

await renderer.renderAsync( this._mesh, _camera );

}

get material() {

return this._mesh.material;
this.camera = _camera;

}

set material( value ) {
renderAsync( renderer ) {

this._mesh.material = value;
return renderer.renderAsync( this, _camera );

}

get render() {
render( renderer ) {

return this.renderAsync;
renderer.render( this, _camera );

}

Expand Down

0 comments on commit 8574b43

Please sign in to comment.