mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-07-08 01:50:42 +02:00
20 lines
435 B
JavaScript
20 lines
435 B
JavaScript
|
export default class RenderChain {
|
||
|
constructor(renderer, scene, camera) {
|
||
|
this._renderer = renderer;
|
||
|
this._scene = scene;
|
||
|
this._camera = camera;
|
||
|
}
|
||
|
|
||
|
setSize(width, height) {
|
||
|
this._renderer.setSize(width, height);
|
||
|
|
||
|
// adjust aspect ratio of camera
|
||
|
this._camera.aspect = width / height;
|
||
|
this._camera.updateProjectionMatrix();
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
this._renderer.render(this._scene, this._camera);
|
||
|
}
|
||
|
}
|