/** * A loadable 3D scene parsed from a glTF / GLB asset. Instances are created * and registered with the {@link level} director (usually automatically by * the preloader), so a glTF scene loads with the same one-call ergonomics as * a Tiled map: `level.load("myScene")`. * * Each glTF mesh node is instantiated as a {@link Mesh} carrying its own * world transform, so the scene's relative scale and layout are preserved. * View the result under a `Camera3d` for a coherent perspective. */ export default class GLTFScene { /** * @param {string} levelId - the glTF/GLB asset name (as preloaded) */ constructor(levelId: string); /** * the level/asset name * @type {string} */ name: string; /** * level format discriminator used by the level director's dispatch * @type {string} */ format: string; /** * the parsed scene descriptor (`{ nodes, cameras, lights, bounds }`) * @type {object} */ data: object; /** * the world-space bounds of the scene (`{ min, max }` in glTF units), or * undefined if the scene failed to load. Handy for framing a `Camera3d`. * @returns {object|undefined} */ get bounds(): object | undefined; /** * the cameras parsed from the glTF scene (each with a world matrix + * perspective parameters), or an empty array. * @returns {Array} */ get cameras(): any[]; /** * Instantiate every glTF mesh node as a `Mesh` in the given container. * Called by the level director on `level.load(...)`. * @param {Container} container - the target container (e.g. `game.world`) * @param {object} [options] * @param {number} [options.scale=1] - pixels per glTF unit (uniform scene scale) * @param {boolean} [options.rightHanded=true] - convert glTF Y-up right-handed * geometry to the engine's Y-down via a rotation (no mirror). See the wiki. * @param {boolean} [options.lights=true] - add the scene's authored * `KHR_lights_punctual` lights — directional suns, point and spot lamps * (plus a soft ambient fill) — to the world as {@link Light3d} * renderables, so the meshes are lit as set up in the authoring tool. * Set false to keep the meshes unlit / manage lighting yourself with * `world.addChild(new Light3d(...))`. Each instantiated light carries * its authored name, so `world.getChildByName("Sun")` finds it for * runtime tuning (day/night cycles, flicker). * @param {number} [options.lightIntensityScale] - multiply each light's * AUTHORED intensity by this factor instead of normalizing it to 1. * glTF stores physical units — lux for suns (a Blender daylight sun is * ~1000+), candela for lamps — which blow out the engine's stylized * half-Lambert shading when used raw, so the default keeps every light * at unit intensity and lets the app tune. With this option the * authored ratios survive: e.g. `0.001` maps a 1000-lux sun to 1 while * a half-strength 500-lux fill lands at 0.5. * @param {boolean} [options.castGroundShadow] - give this scene's meshes a * ground shadow ({@link Mesh#castGroundShadow}), overriding the * application's setting for this scene in both directions; omit it to * inherit. As a scene-wide opt-in it skips nodes with no vertical extent — * a scene's ground plane is exactly that, and shadowing it with itself * smears a blob across the whole floor. * @param {number} [options.shadowGroundY] - world Y of the floor those * shadows land on ({@link Mesh#shadowGroundY}); omit it and each blob sits * at its own object's base at full strength, which is right for a scene * whose props already rest on the ground. */ addTo(container: Container, options?: { scale?: number | undefined; rightHanded?: boolean | undefined; lights?: boolean | undefined; lightIntensityScale?: number | undefined; castGroundShadow?: boolean | undefined; shadowGroundY?: number | undefined; }): void; } import InstancedMesh from "../../renderable/instanced_mesh.js"; //# sourceMappingURL=GLTFScene.d.ts.map