Extract doRender() so that subclasses can customize rendering

This commit is contained in:
yushijinhun 2020-01-31 01:36:49 +08:00
parent 1bcd8b50b1
commit f84f88251e
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
1 changed files with 5 additions and 1 deletions

View File

@ -111,10 +111,14 @@ export class SkinViewer {
return; return;
} }
this.animations.runAnimationLoop(this.playerObject); this.animations.runAnimationLoop(this.playerObject);
this.renderer.render(this.scene, this.camera); this.doRender();
window.requestAnimationFrame(() => this.draw()); window.requestAnimationFrame(() => this.draw());
} }
protected doRender() {
this.renderer.render(this.scene, this.camera);
}
setSize(width: number, height: number) { setSize(width: number, height: number) {
this.camera.aspect = width / height; this.camera.aspect = width / height;
this.camera.updateProjectionMatrix(); this.camera.updateProjectionMatrix();