Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace BABYLON

Index

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

BabylonFileParser

BabylonFileParser: (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => void

Defines how the parser contract is defined. These parsers are used to parse a list of specific assets (like particle systems, etc..)

Type declaration

CameraStageAction

CameraStageAction: (camera: Camera) => void

Strong typing of a Camera related stage step action

Type declaration

    • Parameters

      Returns void

CameraStageFrameBufferAction

CameraStageFrameBufferAction: (camera: Camera) => boolean

Strong typing of a Camera Frame buffer related stage step action

Type declaration

    • Parameters

      Returns boolean

ComputeBindingLocation

ComputeBindingLocation: { binding: number; group: number }

Type used to locate a resource in a compute shader. TODO: remove this when browsers support reflection for wgsl shaders

Type declaration

  • binding: number
  • group: number

ComputeBindingMapping

ComputeBindingMapping: {}

Type used to lookup a resource and retrieve its binding location TODO: remove this when browsers support reflection for wgsl shaders

Type declaration

DataArray

DataArray: number[] | ArrayBuffer | ArrayBufferView

Alias for types that can be used by a Buffer or VertexBuffer.

DeepImmutable

DeepImmutable<T>: T extends Primitive ? T : T extends Array<infer U> ? DeepImmutableArray<U> : DeepImmutableObject<T>

Type modifier to make all the properties of an object Readonly recursively

Type parameters

  • T

DeepImmutableObject

DeepImmutableObject<T>: {}

Type modifier to make object properties readonly.

Type parameters

  • T

Type declaration

DeviceInput

DeviceInput<T>: T extends Keyboard | Generic ? number : T extends Mouse | Touch ? PointerInput : T extends DualShock ? DualShockInput : T extends Xbox ? XboxInput : T extends Switch ? SwitchInput : never

Type to handle enforcement of inputs

Type parameters

EnvironmentTextureInfo

Raw texture data and descriptor sufficient for WebGL texture upload

EvaluateSubMeshStageAction

EvaluateSubMeshStageAction: (mesh: AbstractMesh, subMesh: SubMesh) => void

Strong typing of a Evaluate Sub Mesh related stage step action

Type declaration

FloatArray

FloatArray: number[] | Float32Array

Alias type for number array or Float32Array

IFresnelParametersCreationOptions

IFresnelParametersCreationOptions: { bias?: number; isEnabled?: boolean; leftColor?: Color3; power?: number; rightColor?: Color3 }

Options to be used when creating a FresnelParameters.

Type declaration

  • Optional bias?: number

    Define bias applied to computed fresnel term

  • Optional isEnabled?: boolean

    Define if the fresnel effect is enable or not.

  • Optional leftColor?: Color3

    Define the color used on edges (grazing angle)

  • Optional power?: number

    Defined the power exponent applied to fresnel term

  • Optional rightColor?: Color3

    Define the color used on center

IFresnelParametersSerialized

IFresnelParametersSerialized: { bias: number; isEnabled: boolean; leftColor: number[]; power?: number; rightColor: number[] }

Serialized format for FresnelParameters.

Type declaration

  • bias: number

    Define bias applied to computed fresnel term

  • isEnabled: boolean

    Define if the fresnel effect is enable or not.

  • leftColor: number[]

    Define the color used on edges (grazing angle) [as an array]

  • Optional power?: number

    Defined the power exponent applied to fresnel term

  • rightColor: number[]

    Define the color used on center [as an array]

Immutable

Immutable<T>: T extends Primitive ? T : T extends Array<infer U> ? ReadonlyArray<U> : DeepImmutable<T>

Type modifier to make all the properties of an object Readonly

Type parameters

  • T

IndicesArray

IndicesArray: number[] | Int32Array | Uint32Array | Uint16Array

Alias type for number array or Float32Array or Int32Array or Uint32Array or Uint16Array

IndividualBabylonFileParser

IndividualBabylonFileParser: (parsedData: any, scene: Scene, rootUrl: string) => any

Defines how the individual parser contract is defined. These parser can parse an individual asset

Type declaration

    • (parsedData: any, scene: Scene, rootUrl: string): any
    • Parameters

      • parsedData: any
      • scene: Scene
      • rootUrl: string

      Returns any

MeshStageAction

MeshStageAction: (mesh: AbstractMesh, hardwareInstancedRendering: boolean) => boolean

Strong typing of a Mesh related stage step action

Type declaration

    • (mesh: AbstractMesh, hardwareInstancedRendering: boolean): boolean
    • Parameters

      Returns boolean

MotionControllerComponentStateType

MotionControllerComponentStateType: "default" | "touched" | "pressed"

The state of a controller component

MotionControllerComponentType

MotionControllerComponentType: "trigger" | "squeeze" | "touchpad" | "thumbstick" | "button"

The type of components available in motion controllers. This is not the name of the component.

MotionControllerConstructor

MotionControllerConstructor: (xrInput: XRInputSource, scene: Scene) => WebXRAbstractMotionController

A construction function type to create a new controller based on an xrInput object

Type declaration

MotionControllerHandedness

MotionControllerHandedness: "none" | "left" | "right"

Handedness type in xrInput profiles. These can be used to define layouts in the Layout Map.

NodeConstructor

NodeConstructor: (name: string, scene: Scene, options?: any) => () => Node

Defines how a node can be built from a string name.

Type declaration

    • (name: string, scene: Scene, options?: any): () => Node
    • Parameters

      • name: string
      • scene: Scene
      • Optional options: any

      Returns () => Node

Nullable

Nullable<T>: T | null

Alias type for value that can be null

Type parameters

  • T

OBJLoadingOptions

OBJLoadingOptions: { UVScaling: Vector2; computeNormals: boolean; importVertexColors: boolean; invertTextureY: boolean; invertY: boolean; materialLoadingFailsSilently: boolean; optimizeNormals: boolean; optimizeWithUV: boolean; skipMaterials: boolean }

Options for loading OBJ/MTL files

Type declaration

  • UVScaling: Vector2

    Defines custom scaling of UV coordinates of loaded meshes.

  • computeNormals: boolean

    Compute the normals for the model, even if normals are present in the file.

  • importVertexColors: boolean

    Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.

  • invertTextureY: boolean

    Invert Y-Axis of referenced textures on load

  • invertY: boolean

    Invert model on y-axis (does a model scaling inversion)

  • materialLoadingFailsSilently: boolean

    When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.

  • optimizeNormals: boolean

    Optimize the normals for the model. Lighting can be uneven if you use OptimizeWithUV = true because new vertices can be created for the same location if they pertain to different faces. Using OptimizehNormals = true will help smoothing the lighting by averaging the normals of those vertices.

  • optimizeWithUV: boolean

    Defines if UVs are optimized by default during load.

  • skipMaterials: boolean

    Skip loading the materials even if defined in the OBJ file (materials are ignored).

PerfStrategyInitialization

PerfStrategyInitialization: (scene: Scene) => IPerfViewerCollectionStrategy

Initializer callback for a strategy

Type declaration

PointerMoveStageAction

PointerMoveStageAction: (unTranslatedPointerX: number, unTranslatedPointerY: number, pickResult: Nullable<PickingInfo>, isMeshPicked: boolean, element: Nullable<HTMLElement>) => Nullable<PickingInfo>

Strong typing of a pointer move action.

Type declaration

PointerUpDownStageAction

PointerUpDownStageAction: (unTranslatedPointerX: number, unTranslatedPointerY: number, pickResult: Nullable<PickingInfo>, evt: IPointerEvent) => Nullable<PickingInfo>

Strong typing of a pointer up/down action.

Type declaration

PostProcessOptions

PostProcessOptions: { height: number; width: number }

Size options for a post process

Type declaration

  • height: number
  • width: number

PreActiveMeshStageAction

PreActiveMeshStageAction: (mesh: AbstractMesh) => void

Strong typing of a pre active Mesh related stage step action

Type declaration

Primitive

Primitive: undefined | null | boolean | string | number | Function

Alias type for primitive types

ignorenaming

RenderTargetStageAction

RenderTargetStageAction: (renderTarget: RenderTargetTexture, faceIndex?: number, layer?: number) => void

Strong typing of a Render Target related stage step action

Type declaration

RenderTargetTextureSize

RenderTargetTextureSize: number | { height: number; layers?: number; width: number }

Type used to define a render target texture size (either with a number or with a rect width and height)

RenderTargetsStageAction

RenderTargetsStageAction: (renderTargets: SmartArrayNoDuplicate<RenderTargetTexture>) => void

Strong typing of a render target action.

Type declaration

RenderingGroupStageAction

RenderingGroupStageAction: (renderingGroupId: number) => void

Strong typing of a RenderingGroup related stage step action

Type declaration

    • (renderingGroupId: number): void
    • Parameters

      • renderingGroupId: number

      Returns void

RenderingMeshStageAction

RenderingMeshStageAction: (mesh: Mesh, subMesh: SubMesh, batch: any, effect: Nullable<Effect>) => void

Strong typing of a Mesh Render related stage step action

Type declaration

SceneLoaderSuccessCallback

SceneLoaderSuccessCallback: (meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], animationGroups: AnimationGroup[], transformNodes: TransformNode[], geometries: Geometry[], lights: Light[]) => void

Type used for the success callback of ImportMesh

Type declaration

SimpleStageAction

SimpleStageAction: () => void

Strong typing of a simple stage step action

Type declaration

    • (): void
    • Returns void

TrianglePickingPredicate

TrianglePickingPredicate: (p0: Vector3, p1: Vector3, p2: Vector3, ray: Ray) => boolean

Type used to define predicate used to select faces when a mesh intersection is detected

Type declaration

VirtualMeshInfo

VirtualMeshInfo: { dragMesh: AbstractMesh; dragging: boolean; lastDragPosition: Vector3; lastOriginPosition: Vector3; moving: boolean; originMesh: AbstractMesh; pivotMesh: AbstractMesh; startingOrientation: Quaternion; startingPivotOrientation: Quaternion; startingPivotPosition: Vector3; startingPosition: Vector3 }

Data store to track virtual pointers movement

Type declaration

WebXRControllerMovementFeatureContext

WebXRControllerMovementFeatureContext: { movementEnabled: boolean; movementOrientationFollowsViewerPose: boolean; movementSpeed: number; movementThreshold: number; rotationEnabled: boolean; rotationSpeed: number; rotationThreshold: number }

Feature context is used in handlers and on each XR frame to control the camera movement/direction.

Type declaration

  • movementEnabled: boolean
  • movementOrientationFollowsViewerPose: boolean
  • movementSpeed: number
  • movementThreshold: number
  • rotationEnabled: boolean
  • rotationSpeed: number
  • rotationThreshold: number

WebXRControllerMovementRegistrationConfiguration

WebXRControllerMovementRegistrationConfiguration: { allowedComponentTypes?: MotionControllerComponentType[]; componentSelectionPredicate?: (xrController: WebXRInputSource) => Nullable<WebXRControllerComponent>; forceHandedness?: XRHandedness; mainComponentOnly?: boolean } & { axisChangedHandler: (axes: IWebXRMotionControllerAxesValue, movementState: WebXRControllerMovementState, featureContext: WebXRControllerMovementFeatureContext, xrInput: WebXRInput) => void } | { buttonChangedhandler: (pressed: IWebXRMotionControllerComponentChangesValues<boolean>, movementState: WebXRControllerMovementState, featureContext: WebXRControllerMovementFeatureContext, xrInput: WebXRInput) => void }

Button of Axis Handler must be specified.

WebXRControllerMovementState

WebXRControllerMovementState: { moveX: number; moveY: number; rotateX: number; rotateY: number }

Current state of Movements shared across components and handlers.

Type declaration

  • moveX: number
  • moveY: number
  • rotateX: number
  • rotateY: number

WebXRDomOverlayType

WebXRDomOverlayType: "screen" | "floating" | "head-locked"

Type of DOM overlay provided by UA.

WebXRFeatureConstructor

WebXRFeatureConstructor: (xrSessionManager: WebXRSessionManager, options?: any) => () => IWebXRFeature

Defining the constructor of a feature. Used to register the modules.

Type declaration

XRHandMeshRigMapping

XRHandMeshRigMapping: {}

A type encapsulating a dictionary mapping WebXR joints to bone names in a rigged hand mesh.

Type declaration

double

double: number

Alias type for number that are doubles.

ignorenaming

float

float: number

Alias type for number that are floats

ignorenaming

int

int: number

Alias type for number that are integer

ignorenaming

Variables

Let Epsilon

Epsilon: number

Constant used to define the minimal number value in Babylon.js

ignorenaming

Const PHI

PHI: number

Constant Golden Ratio value in Babylon.js

ignorenaming

Const ToGammaSpace

ToGammaSpace: number

Constant used to convert a value to gamma space

ignorenaming

Const ToLinearSpace

ToLinearSpace: 2.2 = 2.2

Constant used to convert a value to linear space

ignorenaming

Functions

allocateAndCopyTypedBuffer

  • allocateAndCopyTypedBuffer(type: number, sizeOrDstBuffer: number | ArrayBuffer, sizeInBytes?: boolean, copyBuffer?: ArrayBuffer): ArrayBufferView
  • Allocate a typed array depending on a texture type. Optionally can copy existing data in the buffer.

    Parameters

    • type: number

      type of the texture

    • sizeOrDstBuffer: number | ArrayBuffer

      size of the array OR an existing buffer that will be used as the destination of the copy (if copyBuffer is provided)

    • Optional sizeInBytes: boolean

      true if the size of the array is given in bytes, false if it is the number of elements of the array

    • Optional copyBuffer: ArrayBuffer

      if provided, buffer to copy into the destination buffer (either a newly allocated buffer if sizeOrDstBuffer is a number or use sizeOrDstBuffer as the destination buffer otherwise)

    Returns ArrayBufferView

    the allocated buffer or sizeOrDstBuffer if the latter is an ArrayBuffer

className

  • className(name: string, module?: string): (target: Object) => void
  • Use this className as a decorator on a given class definition to add it a name and optionally its module. You can then use the Tools.getClassName(obj) on an instance to retrieve its class name. This method is the only way to get it done in all cases, even if the .js file declaring the class is minified

    Parameters

    • name: string

      The name of the class, case should be preserved

    • Optional module: string

      The name of the Module hosting the class, optional, but strongly recommended to specify if possible. Case should be preserved.

    Returns (target: Object) => void

      • (target: Object): void
      • Parameters

        • target: Object

        Returns void

editableInPropertyPage

  • Decorator that flags a property in a node material block as being editable

    Parameters

    Returns (target: any, propertyKey: string) => void

      • (target: any, propertyKey: string): void
      • Parameters

        • target: any
        • propertyKey: string

        Returns void

expandToProperty

  • expandToProperty(callback: string, targetKey?: Nullable<string>): (target: any, propertyKey: string) => void
  • Parameters

    • callback: string
    • Optional targetKey: Nullable<string>

    Returns (target: any, propertyKey: string) => void

      • (target: any, propertyKey: string): void
      • Parameters

        • target: any
        • propertyKey: string

        Returns void

extractMinAndMax

  • Extracts minimum and maximum values from a list of positions

    Parameters

    • positions: FloatArray

      defines the positions to use

    • start: number

      defines the start index in the positions array

    • count: number

      defines the number of positions to handle

    • Optional bias: Nullable<Vector2>

      defines bias value to add to the result

    • Optional stride: number

      defines the stride size to use (distance between two positions in the positions array)

    Returns { maximum: Vector3; minimum: Vector3 }

    minimum and maximum values

extractMinAndMaxIndexed

  • Extracts minimum and maximum values from a list of indexed positions

    Parameters

    • positions: FloatArray

      defines the positions to use

    • indices: IndicesArray

      defines the indices to the positions

    • indexStart: number

      defines the start index

    • indexCount: number

      defines the end index

    • Optional bias: Nullable<Vector2>

      defines bias value to add to the result

    Returns { maximum: Vector3; minimum: Vector3 }

    minimum and maximum values

serialize

  • serialize(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsCameraReference

  • serializeAsCameraReference(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Decorator used to define property that can be serialized as reference to a camera

    Parameters

    • Optional sourceName: string

      defines the name of the property to decorate

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsColor3

  • serializeAsColor3(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsColor4

  • serializeAsColor4(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsColorCurves

  • serializeAsColorCurves(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsFresnelParameters

  • serializeAsFresnelParameters(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsImageProcessingConfiguration

  • serializeAsImageProcessingConfiguration(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsMatrix

  • serializeAsMatrix(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsMeshReference

  • serializeAsMeshReference(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsQuaternion

  • serializeAsQuaternion(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsTexture

  • serializeAsTexture(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsVector2

  • serializeAsVector2(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

serializeAsVector3

  • serializeAsVector3(sourceName?: string): (target: any, propertyKey: string | symbol) => void
  • Parameters

    • Optional sourceName: string

    Returns (target: any, propertyKey: string | symbol) => void

      • (target: any, propertyKey: string | symbol): void
      • Parameters

        • target: any
        • propertyKey: string | symbol

        Returns void

setAndStartTimer

  • A simple version of the timer. Will take options and start the timer immediately after calling it

    Parameters

    • options: ITimerOptions<any>

      options with which to initialize this timer

    Returns Nullable<Observer<any>>

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method