import type * as BABYLON from "@babylonjs/core"; import { Base } from "./base-inputs"; /** * Parameters for the scene itself: background and clear color, fog, environment and skybox settings, * active camera, and the scene-level options that affect everything drawn into it. */ export declare namespace BabylonScene { /** * Feeds `babylon.scene.backgroundColour` with the one plain color to fill the background with. */ class SceneBackgroundColourDto { /** * Provide options without default values */ constructor(colour?: string); /** * Hex color the whole background is painted in * @default #ffffff */ colour?: Base.Color | undefined; } /** * Feeds `babylon.scene.setAndAttachScene` with the scene this library should draw into from * then on. */ class SceneDto { /** * Provide scene */ constructor(scene?: BABYLON.Scene); /** * The scene to draw into; it gets the shadow bookkeeping and root node this library expects * @default undefined */ scene: BABYLON.Scene; } /** * Feeds `babylon.scene.enablePhysics` with the gravity that bodies fall under. */ class EnablePhysicsDto { constructor(vector?: Base.Vector3); /** * The gravity as a vector, `[0, -9.81, 0]` being Earth's pull downward along Y * @default [0, -9.81, 0] */ vector?: Base.Vector3 | undefined; } /** * Feeds `babylon.scene.drawPointLight`: where the bulb sits, its colors and brightness, the * size of its visible sphere and the shadow settings. */ class PointLightDto { constructor(position?: Base.Point3, intensity?: number, diffuse?: Base.Color, specular?: Base.Color, radius?: number, shadowGeneratorMapSize?: number, enableShadows?: boolean, shadowDarkness?: number, transparencyShadow?: boolean, shadowUsePercentageCloserFiltering?: boolean, shadowContactHardeningLightSizeUVRatio?: number, shadowBias?: number, shadowNormalBias?: number, shadowMaxZ?: number, shadowMinZ?: number, shadowRefreshRate?: number); /** * Where the light shines from * @default [0, 0, 0] */ position?: Base.Point3 | undefined; /** * Brightness as luminous power, so values in the thousands are normal; 0 gives no light * @default 2000 * @minimum 0 * @maximum Infinity * @step 500 */ intensity?: number | undefined; /** * Hex color of the light on surfaces * @default #ffffff */ diffuse?: Base.Color | undefined; /** * Hex color of the highlights the light makes on shiny surfaces * @default #ffffff */ specular?: Base.Color | undefined; /** * Radius of the glowing sphere drawn at the light's position, in scene units; 0 draws none * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * Resolution of the shadow map in pixels; higher gives sharper shadows at more GPU cost * @default 1024 * @minimum 0 * @maximum Infinity * @step 1 */ shadowGeneratorMapSize?: number | undefined; /** * When true, the light casts shadows from every mesh in the scene * @default true */ enableShadows?: boolean | undefined; /** * How light the shadows are, from 0 for fully dark to 1 for invisible * @default 0 * @minimum 0 * @maximum 1 * @step 0.1 */ shadowDarkness?: number | undefined; /** * When true, transparent parts of meshes let light through the shadow, which Gaussian * splats need * @default false */ transparencyShadow?: boolean | undefined; /** * When true, shadow edges are softened by sampling the map several times * @default true */ shadowUsePercentageCloserFiltering?: boolean | undefined; /** * How much shadow edges blur with distance from the caster when filtering is on; larger * blurs more * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ shadowContactHardeningLightSizeUVRatio?: number | undefined; /** * Small depth offset that stops surfaces from shadowing themselves in stripes; raise it if * stripes appear * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.00001 */ shadowBias?: number | undefined; /** * Extra offset along surface normals against self-shadowing, in scene units * @default 0.002 * @minimum 0 * @maximum Infinity * @step 0.0001 */ shadowNormalBias?: number | undefined; /** * The farthest distance from the light that shadows are computed for, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 50 */ shadowMaxZ?: number | undefined; /** * The nearest distance from the light that shadows are computed for, in scene units * @default 0.1 * @minimum 0 * @maximum Infinity * @step 50 */ shadowMinZ?: number | undefined; /** * How often the shadow map is redrawn: 1 every frame, 0 once only, 2 every second frame * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ shadowRefreshRate?: number | undefined; } /** * Feeds `babylon.scene.activateCamera` with the camera the scene should render through. */ class ActiveCameraDto { constructor(camera?: BABYLON.Camera); /** * The camera that becomes active * @default undefined */ camera: BABYLON.Camera; } /** * Feeds `babylon.scene.useRightHandedSystem` with the choice between the two coordinate * handednesses. */ class UseRightHandedSystemDto { constructor(use?: boolean); /** * When true, the scene uses the right-handed system of most CAD tools and glTF; when false, * the engine's default left-handed one * @default true */ use?: boolean | undefined; } /** * Feeds `babylon.scene.drawDirectionalLight`: the direction the sun-like light shines in, its * colors and brightness and the shadow settings. */ class DirectionalLightDto { constructor(direction?: Base.Vector3, intensity?: number, diffuse?: Base.Color, specular?: Base.Color, shadowGeneratorMapSize?: number, enableShadows?: boolean, shadowDarkness?: number, shadowUsePercentageCloserFiltering?: boolean, shadowContactHardeningLightSizeUVRatio?: number, shadowBias?: number, shadowNormalBias?: number, shadowMaxZ?: number, shadowMinZ?: number, shadowRefreshRate?: number); /** * The direction the light travels in; `[-100, -100, -100]` shines down and diagonally, and * only the direction matters, not the length * @default [-100, -100, -100] */ direction?: Base.Vector3 | undefined; /** * Brightness as a plain factor, 1 being full strength * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ intensity?: number | undefined; /** * Hex color of the light on surfaces * @default #ffffff */ diffuse?: Base.Color | undefined; /** * Hex color of the highlights the light makes on shiny surfaces * @default #ffffff */ specular?: Base.Color | undefined; /** * Resolution of the shadow map in pixels; higher gives sharper shadows at more GPU cost * @default 1024 * @minimum 0 * @maximum Infinity * @step 1 */ shadowGeneratorMapSize?: number | undefined; /** * When true, the light casts shadows from every mesh in the scene * @default true */ enableShadows?: boolean | undefined; /** * How light the shadows are, from 0 for fully dark to 1 for invisible * @default 0 * @minimum 0 * @maximum 1 * @step 0.1 */ shadowDarkness?: number | undefined; /** * When true, shadow edges are softened by sampling the map several times * @default true */ shadowUsePercentageCloserFiltering?: boolean | undefined; /** * When true, transparent parts of meshes let light through the shadow, which Gaussian * splats need * @default false */ transparencyShadow?: boolean | undefined; /** * How much shadow edges blur with distance from the caster when filtering is on; larger * blurs more * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ shadowContactHardeningLightSizeUVRatio?: number | undefined; /** * Small depth offset that stops surfaces from shadowing themselves in stripes; raise it if * stripes appear * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.00001 */ shadowBias?: number | undefined; /** * Extra offset along surface normals against self-shadowing, in scene units * @default 0.002 * @minimum 0 * @maximum Infinity * @step 0.0001 */ shadowNormalBias?: number | undefined; /** * The farthest distance from the light that shadows are computed for, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 50 */ shadowMaxZ?: number | undefined; /** * The nearest distance from the light that shadows are computed for, in scene units * @default 0 * @minimum 0 * @maximum Infinity * @step 50 */ shadowMinZ?: number | undefined; /** * How often the shadow map is redrawn: 1 every frame, 0 once only, 2 every second frame * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ shadowRefreshRate?: number | undefined; } /** * Feeds `babylon.scene.adjustActiveArcRotateCamera`: where the default orbiting camera goes, * what it looks at, and its limits and sensitivities, each set to its default when left out * except the radius and alpha limits, which then stay as they are. */ class CameraConfigurationDto { constructor(position?: Base.Point3, lookAt?: Base.Point3, lowerRadiusLimit?: number, upperRadiusLimit?: number, lowerAlphaLimit?: number, upperAlphaLimit?: number, lowerBetaLimit?: number, upperBetaLimit?: number, angularSensibilityX?: number, angularSensibilityY?: number, maxZ?: number, panningSensibility?: number, wheelPrecision?: number); /** * Where the camera is placed; its orbit radius becomes the distance to `lookAt` * @default [10, 10, 10] */ position?: Base.Point3 | undefined; /** * The point the camera looks at and orbits around * @default [0, 0, 0] */ lookAt?: Base.Point3 | undefined; /** * The closest the camera may zoom to the target, in scene units; left out, it is not * changed * @default undefined * @minimum 0 * @maximum Infinity * @step 1 * @optional true */ lowerRadiusLimit?: number | undefined; /** * The farthest the camera may zoom from the target, in scene units; left out, it is not * changed * @default undefined * @minimum 0 * @maximum Infinity * @step 1 * @optional true */ upperRadiusLimit?: number | undefined; /** * The smallest angle around the vertical axis the camera may orbit to, in degrees; left * out, it is not changed * @default undefined * @minimum -Infinity * @maximum Infinity * @step 1 * @optional true */ lowerAlphaLimit?: number | undefined; /** * The largest angle around the vertical axis the camera may orbit to, in degrees; left out, * it is not changed * @default undefined * @minimum -Infinity * @maximum Infinity * @step 1 * @optional true */ upperAlphaLimit?: number | undefined; /** * How close to straight above the camera may go, in degrees down from the top; 0 would look * straight down * @default 1 * @minimum 0 * @maximum 180 * @step 1 */ lowerBetaLimit?: number | undefined; /** * How close to straight below the camera may go, in degrees down from the top; 180 would * look straight up * @default 179 * @minimum 0 * @maximum 180 * @step 1 */ upperBetaLimit?: number | undefined; /** * How much pointer movement a horizontal orbit takes; lower turns faster * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ angularSensibilityX?: number | undefined; /** * How much pointer movement a vertical orbit takes; lower turns faster * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ angularSensibilityY?: number | undefined; /** * The farthest distance the camera draws, in scene units; anything beyond is not rendered * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ maxZ?: number | undefined; /** * How much pointer movement a pan takes; lower pans faster, so lower it for large models * @default 1000 * @minimum 0 * @maximum Infinity * @step 0.1 */ panningSensibility?: number | undefined; /** * How much wheel movement a zoom step takes; lower zooms faster, so lower it for large * models * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ wheelPrecision?: number | undefined; } /** * How a skybox is shown, shared by `SkyboxDto`, `SkyboxCustomTextureDto` and * `SkyboxFromTextureDto`: its size, blur, lighting and the projected ground. */ abstract class SkyboxSharedDto { /** * Edge length of the sky cube, in scene units; make it larger than the scene so nothing * pokes through * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ size?: number | undefined; /** * How much the visible sky is blurred, from 0 for sharp to 1 for fully soft; the lighting * is unaffected * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ blur?: number | undefined; /** * How strongly the sky lights the scene through reflections and ambient light; 1 is full * strength * @default 0.7 * @minimum 0 * @maximum Infinity * @step 0.1 */ environmentIntensity?: number | undefined; /** * When true, the sky is not drawn but still lights the scene * @default false */ hideSkybox?: boolean | undefined; /** * When true, the lower sky is projected onto a flat ground at height 0, so the model seems * to stand on the environment and casts shadows onto it * @default false */ enableGroundProjection?: boolean | undefined; /** * Radius of the projected ground and of the sky dome around it, in scene units; keep the * camera inside it * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ projectedGroundRadius?: number | undefined; /** * Height the environment was captured at, above the floor, in scene units; the floor itself * is always at height 0 * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ projectedGroundHeight?: number | undefined; } /** * Feeds `babylon.scene.enableSkybox`: which built-in sky to use, how big and blurred it is, how * much it lights the scene and whether it is shown. */ class SkyboxDto extends SkyboxSharedDto { constructor(skybox?: Base.skyboxEnum, size?: number, blur?: number, environmentIntensity?: number, hideSkybox?: boolean, enableGroundProjection?: boolean, projectedGroundRadius?: number, projectedGroundHeight?: number); /** * The built-in sky to surround the scene with * @default clearSky */ skybox?: Base.skyboxEnum | undefined; } /** * Feeds `babylon.scene.enableSkyboxCustomTexture`: your own sky texture by URL, its size, and * the same size, blur, intensity and visibility options as the built-in skies. */ class SkyboxCustomTextureDto extends SkyboxSharedDto { constructor(textureUrl?: string, textureSize?: number, size?: number, blur?: number, environmentIntensity?: number, hideSkybox?: boolean, enableGroundProjection?: boolean, projectedGroundRadius?: number, projectedGroundHeight?: number); /** * Address of an `.hdr` file, an `.env` file or the root of six cube face images; nothing * happens without it * @default undefined * @optional true */ textureUrl?: string | undefined; /** * Resolution the sky texture is loaded at, in pixels per face; used for `.hdr` files * @default 512 */ textureSize?: number | undefined; } /** * Feeds `babylon.scene.enableSkyboxFromTexture`: a cube texture you already loaded, and the same * size, blur, intensity, visibility and ground projection options as the built-in skies. */ class SkyboxFromTextureDto extends SkyboxSharedDto { constructor(texture?: BABYLON.BaseTexture, size?: number, blur?: number, environmentIntensity?: number, hideSkybox?: boolean, enableGroundProjection?: boolean, projectedGroundRadius?: number, projectedGroundHeight?: number); /** * Cube texture to surround the scene with and light it by, such as one loaded from an * `.hdr` or `.env` file * @default undefined */ texture: BABYLON.BaseTexture; } /** * Feeds `babylon.scene.onPointerDown`, `onPointerUp` and `onPointerMove` with the function to * run on that pointer event. */ class PointerDto { /** * The function to run each time the event happens; it takes no arguments */ statement_update: () => void; } /** * Feeds `babylon.scene.fog`: the fog mode, its color, how dense it is and, for linear fog, * where it starts and ends. */ class FogDto { constructor(mode?: Base.fogModeEnum, color?: Base.Color, density?: number, start?: number, end?: number); /** * `none` turns fog off, `linear` fades between `start` and `end`, `exponential` and * `exponentialSquared` fade by `density` * @default none */ mode?: Base.fogModeEnum | undefined; /** * Hex color distant geometry fades into, normally the background color * @default #ffffff */ color?: Base.Color | undefined; /** * How quickly the exponential modes thicken with distance; ignored by linear fog * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ density?: number | undefined; /** * Distance from the camera where linear fog begins, in scene units * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ start?: number | undefined; /** * Distance from the camera where linear fog hides everything, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ end?: number | undefined; } /** * Feeds `babylon.scene.canvasCSSBackgroundImage` with any CSS background image value to paint * behind the scene. */ class SceneCanvasCSSBackgroundImageDto { /** * Provide options without default values */ constructor(cssBackgroundImage?: string); /** * A CSS `background-image` value, such as a gradient function or `url(...)` * @default linear-gradient(to top, #1a1c1f 0%, #93aacd 100%) */ cssBackgroundImage?: string | undefined; } /** * Feeds `babylon.scene.twoColorLinearGradientBackground`: the two colors, the direction the * gradient runs in and where each color stops. */ class SceneTwoColorLinearGradientDto { constructor(colorFrom?: Base.Color, colorTo?: Base.Color, direction?: Base.gradientDirectionEnum, stopFrom?: number, stopTo?: number); /** * Hex color the gradient starts with * @default #1a1c1f */ colorFrom?: Base.Color | undefined; /** * Hex color the gradient ends with * @default #93aacd */ colorTo?: Base.Color | undefined; /** * Which way the gradient runs, such as to the top or to the bottom right * @default toBottom */ direction?: Base.gradientDirectionEnum | undefined; /** * Where the first color is still pure, as a percentage along the gradient * @default 0 * @minimum 0 * @maximum 100 * @step 1 */ stopFrom?: number | undefined; /** * Where the second color becomes pure, as a percentage along the gradient * @default 100 * @minimum 0 * @maximum 100 * @step 1 */ stopTo?: number | undefined; } /** * Feeds `babylon.scene.twoColorRadialGradientBackground`: the two colors, where the gradient * spreads from, its shape and where each color stops. */ class SceneTwoColorRadialGradientDto { constructor(colorFrom?: Base.Color, colorTo?: Base.Color, position?: Base.gradientPositionEnum, stopFrom?: number, stopTo?: number, shape?: Base.gradientShapeEnum); /** * Hex color at the center of the gradient * @default #1a1c1f */ colorFrom?: Base.Color | undefined; /** * Hex color at the outer edge of the gradient * @default #93aacd */ colorTo?: Base.Color | undefined; /** * Where the center of the gradient sits on the canvas * @default center */ position?: Base.gradientPositionEnum | undefined; /** * How far from the center the first color is still pure, as a percentage * @default 0 * @minimum 0 * @maximum 100 * @step 1 */ stopFrom?: number | undefined; /** * How far from the center the second color becomes pure, as a percentage * @default 100 * @minimum 0 * @maximum 100 * @step 1 */ stopTo?: number | undefined; /** * Whether the gradient spreads as a circle or stretches into an ellipse with the canvas * @default circle */ shape?: Base.gradientShapeEnum | undefined; } /** * Feeds `babylon.scene.multiColorLinearGradientBackground`: the colors, one stop each, and the * direction the gradient runs in. */ class SceneMultiColorLinearGradientDto { constructor(colors?: Base.Color[], stops?: number[], direction?: Base.gradientDirectionEnum); /** * The hex colors in order; the list must be as long as `stops` * @default ["#1a1c1f", "#93aacd"] */ colors?: Base.Color[] | undefined; /** * Where each color is pure, as percentages along the gradient, one per color * @default [0, 100] */ stops?: number[] | undefined; /** * Which way the gradient runs, such as to the top or to the bottom right * @default toTop */ direction?: Base.gradientDirectionEnum | undefined; } /** * Feeds `babylon.scene.multiColorRadialGradientBackground`: the colors, one stop each, where * the gradient spreads from and its shape. */ class SceneMultiColorRadialGradientDto { constructor(colors?: Base.Color[], stops?: number[], position?: Base.gradientPositionEnum, shape?: Base.gradientShapeEnum); /** * The hex colors from the center outward; the list must be as long as `stops` * @default ["#1a1c1f", "#93aacd"] */ colors?: Base.Color[] | undefined; /** * How far from the center each color is pure, as percentages, one per color * @default [0, 100] */ stops?: number[] | undefined; /** * Where the center of the gradient sits on the canvas * @default center */ position?: Base.gradientPositionEnum | undefined; /** * Whether the gradient spreads as a circle or stretches into an ellipse with the canvas * @default circle */ shape?: Base.gradientShapeEnum | undefined; } /** * Feeds `babylon.scene.canvasBackgroundImage`: the image to show behind the scene and the CSS * options for how it repeats, scales, sits and scrolls. */ class SceneCanvasBackgroundImageDto { constructor(imageUrl?: string, repeat?: Base.backgroundRepeatEnum, size?: Base.backgroundSizeEnum, position?: Base.gradientPositionEnum, attachment?: Base.backgroundAttachmentEnum, origin?: Base.backgroundOriginClipEnum, clip?: Base.backgroundOriginClipEnum); /** * Address of the image to show behind the scene * @default undefined * @optional true */ imageUrl?: string | undefined; /** * Whether the image tiles across the canvas, in one direction or not at all * @default noRepeat */ repeat?: Base.backgroundRepeatEnum | undefined; /** * How the image is scaled: cover fills the canvas, contain shows all of it, or a CSS size * such as `100px 50px` * @default cover */ size?: Base.backgroundSizeEnum | undefined; /** * Where the image sits on the canvas, such as the center or a corner, or a CSS position * such as `50% 50%` * @default center */ position?: Base.gradientPositionEnum | undefined; /** * Whether the image scrolls with the page or stays fixed to the viewport * @default scroll */ attachment?: Base.backgroundAttachmentEnum | undefined; /** * Which box of the canvas the image is positioned against: its padding, border or content * box * @default paddingBox */ origin?: Base.backgroundOriginClipEnum | undefined; /** * Which box of the canvas the image is clipped to: its padding, border or content box * @default borderBox */ clip?: Base.backgroundOriginClipEnum | undefined; } }