Buckets:
| import ChainMap from './ChainMap.js'; | |
| import RenderList from './RenderList.js'; | |
| const _chainKeys = []; | |
| /** | |
| * This renderer module manages the render lists which are unique | |
| * per scene and camera combination. | |
| * | |
| * @private | |
| */ | |
| class RenderLists { | |
| /** | |
| * Constructs a render lists management component. | |
| * | |
| * @param {Lighting} lighting - The lighting management component. | |
| */ | |
| constructor( lighting ) { | |
| /** | |
| * The lighting management component. | |
| * | |
| * @type {Lighting} | |
| */ | |
| this.lighting = lighting; | |
| /** | |
| * The internal chain map which holds the render lists. | |
| * | |
| * @type {ChainMap} | |
| */ | |
| this.lists = new ChainMap(); | |
| } | |
| /** | |
| * Returns a render list for the given scene and camera. | |
| * | |
| * @param {Scene} scene - The scene. | |
| * @param {Camera} camera - The camera. | |
| * @return {RenderList} The render list. | |
| */ | |
| get( scene, camera ) { | |
| const lists = this.lists; | |
| _chainKeys[ 0 ] = scene; | |
| _chainKeys[ 1 ] = camera; | |
| let list = lists.get( _chainKeys ); | |
| if ( list === undefined ) { | |
| list = new RenderList( this.lighting, scene, camera ); | |
| lists.set( _chainKeys, list ); | |
| } | |
| _chainKeys.length = 0; | |
| return list; | |
| } | |
| /** | |
| * Frees all internal resources. | |
| */ | |
| dispose() { | |
| this.lists = new ChainMap(); | |
| } | |
| } | |
| export default RenderLists; | |
Xet Storage Details
- Size:
- 1.3 kB
- Xet hash:
- d6c16f020a6de3b67c0f752bbd26184d99e7e3c5432e7db1eb71e8819b31ee88
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.