|
@@ -767,7 +767,7 @@ declare module BABYLON {
|
|
|
/** @hidden */
|
|
|
_environmentBRDFTexture: BaseTexture;
|
|
|
/** @hidden */
|
|
|
- protected _environmentTexture: Nullable<BaseTexture>;
|
|
|
+ protected _environmentTexture: BaseTexture;
|
|
|
/**
|
|
|
* Texture used in all pbr material as the reflection texture.
|
|
|
* As in the majority of the scene they are the same (exception for multi room and so on),
|
|
@@ -778,7 +778,7 @@ declare module BABYLON {
|
|
|
* As in the majority of the scene they are the same (exception for multi room and so on),
|
|
|
* this is easier to set here than in all the materials.
|
|
|
*/
|
|
|
- environmentTexture: Nullable<BaseTexture>;
|
|
|
+ environmentTexture: BaseTexture;
|
|
|
/** @hidden */
|
|
|
protected _imageProcessingConfiguration: ImageProcessingConfiguration;
|
|
|
/**
|
|
@@ -9225,337 +9225,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * Module Debug contains the (visual) components to debug a scene correctly
|
|
|
- */
|
|
|
-declare module BABYLON.Debug {
|
|
|
- /**
|
|
|
- * The Axes viewer will show 3 axes in a specific point in space
|
|
|
- */
|
|
|
- class AxesViewer {
|
|
|
- private _xline;
|
|
|
- private _yline;
|
|
|
- private _zline;
|
|
|
- private _xmesh;
|
|
|
- private _ymesh;
|
|
|
- private _zmesh;
|
|
|
- /**
|
|
|
- * Gets the hosting scene
|
|
|
- */
|
|
|
- scene: Nullable<Scene>;
|
|
|
- /**
|
|
|
- * Gets or sets a number used to scale line length
|
|
|
- */
|
|
|
- scaleLines: number;
|
|
|
- /**
|
|
|
- * Creates a new AxesViewer
|
|
|
- * @param scene defines the hosting scene
|
|
|
- * @param scaleLines defines a number used to scale line length (1 by default)
|
|
|
- */
|
|
|
- constructor(scene: Scene, scaleLines?: number);
|
|
|
- /**
|
|
|
- * Force the viewer to update
|
|
|
- * @param position defines the position of the viewer
|
|
|
- * @param xaxis defines the x axis of the viewer
|
|
|
- * @param yaxis defines the y axis of the viewer
|
|
|
- * @param zaxis defines the z axis of the viewer
|
|
|
- */
|
|
|
- update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void;
|
|
|
- /** Releases resources */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON.Debug {
|
|
|
- /**
|
|
|
- * The BoneAxesViewer will attach 3 axes to a specific bone of a specific mesh
|
|
|
- * @see demo here: https://www.babylonjs-playground.com/#0DE8F4#8
|
|
|
- */
|
|
|
- class BoneAxesViewer extends AxesViewer {
|
|
|
- /**
|
|
|
- * Gets or sets the target mesh where to display the axes viewer
|
|
|
- */
|
|
|
- mesh: Nullable<Mesh>;
|
|
|
- /**
|
|
|
- * Gets or sets the target bone where to display the axes viewer
|
|
|
- */
|
|
|
- bone: Nullable<Bone>;
|
|
|
- /** Gets current position */
|
|
|
- pos: Vector3;
|
|
|
- /** Gets direction of X axis */
|
|
|
- xaxis: Vector3;
|
|
|
- /** Gets direction of Y axis */
|
|
|
- yaxis: Vector3;
|
|
|
- /** Gets direction of Z axis */
|
|
|
- zaxis: Vector3;
|
|
|
- /**
|
|
|
- * Creates a new BoneAxesViewer
|
|
|
- * @param scene defines the hosting scene
|
|
|
- * @param bone defines the target bone
|
|
|
- * @param mesh defines the target mesh
|
|
|
- * @param scaleLines defines a scaling factor for line length (1 by default)
|
|
|
- */
|
|
|
- constructor(scene: Scene, bone: Bone, mesh: Mesh, scaleLines?: number);
|
|
|
- /**
|
|
|
- * Force the viewer to update
|
|
|
- */
|
|
|
- update(): void;
|
|
|
- /** Releases resources */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- interface IExplorerExtensibilityOption {
|
|
|
- label: string;
|
|
|
- action: (entity: any) => void;
|
|
|
- }
|
|
|
- interface IExplorerExtensibilityGroup {
|
|
|
- predicate: (entity: any) => boolean;
|
|
|
- entries: IExplorerExtensibilityOption[];
|
|
|
- }
|
|
|
- interface IInspectorOptions {
|
|
|
- overlay?: boolean;
|
|
|
- globalRoot?: HTMLElement;
|
|
|
- showExplorer?: boolean;
|
|
|
- showInspector?: boolean;
|
|
|
- embedMode?: boolean;
|
|
|
- handleResize?: boolean;
|
|
|
- enablePopup?: boolean;
|
|
|
- explorerExtensibility?: IExplorerExtensibilityGroup[];
|
|
|
- }
|
|
|
- interface Scene {
|
|
|
- /**
|
|
|
- * @hidden
|
|
|
- * Backing field
|
|
|
- */
|
|
|
- _debugLayer: DebugLayer;
|
|
|
- /**
|
|
|
- * Gets the debug layer (aka Inspector) associated with the scene
|
|
|
- * @see http://doc.babylonjs.com/features/playground_debuglayer
|
|
|
- */
|
|
|
- debugLayer: DebugLayer;
|
|
|
- }
|
|
|
- /**
|
|
|
- * The debug layer (aka Inspector) is the go to tool in order to better understand
|
|
|
- * what is happening in your scene
|
|
|
- * @see http://doc.babylonjs.com/features/playground_debuglayer
|
|
|
- */
|
|
|
- class DebugLayer {
|
|
|
- /**
|
|
|
- * Define the url to get the inspector script from.
|
|
|
- * By default it uses the babylonjs CDN.
|
|
|
- * @ignoreNaming
|
|
|
- */
|
|
|
- static InspectorURL: string;
|
|
|
- private _scene;
|
|
|
- private BJSINSPECTOR;
|
|
|
- /**
|
|
|
- * Observable triggered when a property is changed through the inspector.
|
|
|
- */
|
|
|
- onPropertyChangedObservable: Observable<{
|
|
|
- object: any;
|
|
|
- property: string;
|
|
|
- value: any;
|
|
|
- initialValue: any;
|
|
|
- }>;
|
|
|
- /**
|
|
|
- * Instantiates a new debug layer.
|
|
|
- * The debug layer (aka Inspector) is the go to tool in order to better understand
|
|
|
- * what is happening in your scene
|
|
|
- * @see http://doc.babylonjs.com/features/playground_debuglayer
|
|
|
- * @param scene Defines the scene to inspect
|
|
|
- */
|
|
|
- constructor(scene: Scene);
|
|
|
- /** Creates the inspector window. */
|
|
|
- private _createInspector;
|
|
|
- /**
|
|
|
- * Get if the inspector is visible or not.
|
|
|
- * @returns true if visible otherwise, false
|
|
|
- */
|
|
|
- isVisible(): boolean;
|
|
|
- /**
|
|
|
- * Hide the inspector and close its window.
|
|
|
- */
|
|
|
- hide(): void;
|
|
|
- /**
|
|
|
- * Launch the debugLayer.
|
|
|
- * @param config Define the configuration of the inspector
|
|
|
- */
|
|
|
- show(config?: IInspectorOptions): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON.Debug {
|
|
|
- /**
|
|
|
- * Used to show the physics impostor around the specific mesh
|
|
|
- */
|
|
|
- class PhysicsViewer {
|
|
|
- /** @hidden */
|
|
|
- protected _impostors: Array<Nullable<PhysicsImpostor>>;
|
|
|
- /** @hidden */
|
|
|
- protected _meshes: Array<Nullable<AbstractMesh>>;
|
|
|
- /** @hidden */
|
|
|
- protected _scene: Nullable<Scene>;
|
|
|
- /** @hidden */
|
|
|
- protected _numMeshes: number;
|
|
|
- /** @hidden */
|
|
|
- protected _physicsEnginePlugin: Nullable<IPhysicsEnginePlugin>;
|
|
|
- private _renderFunction;
|
|
|
- private _debugBoxMesh;
|
|
|
- private _debugSphereMesh;
|
|
|
- private _debugMaterial;
|
|
|
- /**
|
|
|
- * Creates a new PhysicsViewer
|
|
|
- * @param scene defines the hosting scene
|
|
|
- */
|
|
|
- constructor(scene: Scene);
|
|
|
- /** @hidden */
|
|
|
- protected _updateDebugMeshes(): void;
|
|
|
- /**
|
|
|
- * Renders a specified physic impostor
|
|
|
- * @param impostor defines the impostor to render
|
|
|
- */
|
|
|
- showImpostor(impostor: PhysicsImpostor): void;
|
|
|
- /**
|
|
|
- * Hides a specified physic impostor
|
|
|
- * @param impostor defines the impostor to hide
|
|
|
- */
|
|
|
- hideImpostor(impostor: Nullable<PhysicsImpostor>): void;
|
|
|
- private _getDebugMaterial;
|
|
|
- private _getDebugBoxMesh;
|
|
|
- private _getDebugSphereMesh;
|
|
|
- private _getDebugMesh;
|
|
|
- /** Releases all resources */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
- * As raycast might be hard to debug, the RayHelper can help rendering the different rays
|
|
|
- * in order to better appreciate the issue one might have.
|
|
|
- * @see http://doc.babylonjs.com/babylon101/raycasts#debugging
|
|
|
- */
|
|
|
- class RayHelper {
|
|
|
- /**
|
|
|
- * Defines the ray we are currently tryin to visualize.
|
|
|
- */
|
|
|
- ray: Nullable<Ray>;
|
|
|
- private _renderPoints;
|
|
|
- private _renderLine;
|
|
|
- private _renderFunction;
|
|
|
- private _scene;
|
|
|
- private _updateToMeshFunction;
|
|
|
- private _attachedToMesh;
|
|
|
- private _meshSpaceDirection;
|
|
|
- private _meshSpaceOrigin;
|
|
|
- /**
|
|
|
- * Helper function to create a colored helper in a scene in one line.
|
|
|
- * @param ray Defines the ray we are currently tryin to visualize
|
|
|
- * @param scene Defines the scene the ray is used in
|
|
|
- * @param color Defines the color we want to see the ray in
|
|
|
- * @returns The newly created ray helper.
|
|
|
- */
|
|
|
- static CreateAndShow(ray: Ray, scene: Scene, color: Color3): RayHelper;
|
|
|
- /**
|
|
|
- * Instantiate a new ray helper.
|
|
|
- * As raycast might be hard to debug, the RayHelper can help rendering the different rays
|
|
|
- * in order to better appreciate the issue one might have.
|
|
|
- * @see http://doc.babylonjs.com/babylon101/raycasts#debugging
|
|
|
- * @param ray Defines the ray we are currently tryin to visualize
|
|
|
- */
|
|
|
- constructor(ray: Ray);
|
|
|
- /**
|
|
|
- * Shows the ray we are willing to debug.
|
|
|
- * @param scene Defines the scene the ray needs to be rendered in
|
|
|
- * @param color Defines the color the ray needs to be rendered in
|
|
|
- */
|
|
|
- show(scene: Scene, color?: Color3): void;
|
|
|
- /**
|
|
|
- * Hides the ray we are debugging.
|
|
|
- */
|
|
|
- hide(): void;
|
|
|
- private _render;
|
|
|
- /**
|
|
|
- * Attach a ray helper to a mesh so that we can easily see its orientation for instance or information like its normals.
|
|
|
- * @param mesh Defines the mesh we want the helper attached to
|
|
|
- * @param meshSpaceDirection Defines the direction of the Ray in mesh space (local space of the mesh node)
|
|
|
- * @param meshSpaceOrigin Defines the origin of the Ray in mesh space (local space of the mesh node)
|
|
|
- * @param length Defines the length of the ray
|
|
|
- */
|
|
|
- attachToMesh(mesh: AbstractMesh, meshSpaceDirection?: Vector3, meshSpaceOrigin?: Vector3, length?: number): void;
|
|
|
- /**
|
|
|
- * Detach the ray helper from the mesh it has previously been attached to.
|
|
|
- */
|
|
|
- detachFromMesh(): void;
|
|
|
- private _updateToMesh;
|
|
|
- /**
|
|
|
- * Dispose the helper and release its associated resources.
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON.Debug {
|
|
|
- /**
|
|
|
- * Class used to render a debug view of a given skeleton
|
|
|
- * @see http://www.babylonjs-playground.com/#1BZJVJ#8
|
|
|
- */
|
|
|
- class SkeletonViewer {
|
|
|
- /** defines the skeleton to render */
|
|
|
- skeleton: Skeleton;
|
|
|
- /** defines the mesh attached to the skeleton */
|
|
|
- mesh: AbstractMesh;
|
|
|
- /** defines a boolean indicating if bones matrices must be forced to update before rendering (true by default) */
|
|
|
- autoUpdateBonesMatrices: boolean;
|
|
|
- /** defines the rendering group id to use with the viewer */
|
|
|
- renderingGroupId: number;
|
|
|
- /** defines an optional utility layer to render the helper on */
|
|
|
- utilityLayerRenderer?: UtilityLayerRenderer | undefined;
|
|
|
- /** Gets or sets the color used to render the skeleton */
|
|
|
- color: Color3;
|
|
|
- private _scene;
|
|
|
- private _debugLines;
|
|
|
- private _debugMesh;
|
|
|
- private _isEnabled;
|
|
|
- private _renderFunction;
|
|
|
- /**
|
|
|
- * Returns the mesh used to render the bones
|
|
|
- */
|
|
|
- readonly debugMesh: Nullable<LinesMesh>;
|
|
|
- /**
|
|
|
- * Creates a new SkeletonViewer
|
|
|
- * @param skeleton defines the skeleton to render
|
|
|
- * @param mesh defines the mesh attached to the skeleton
|
|
|
- * @param scene defines the hosting scene
|
|
|
- * @param autoUpdateBonesMatrices defines a boolean indicating if bones matrices must be forced to update before rendering (true by default)
|
|
|
- * @param renderingGroupId defines the rendering group id to use with the viewer
|
|
|
- * @param utilityLayerRenderer defines an optional utility layer to render the helper on
|
|
|
- */
|
|
|
- constructor(
|
|
|
- /** defines the skeleton to render */
|
|
|
- skeleton: Skeleton,
|
|
|
- /** defines the mesh attached to the skeleton */
|
|
|
- mesh: AbstractMesh, scene: Scene,
|
|
|
- /** defines a boolean indicating if bones matrices must be forced to update before rendering (true by default) */
|
|
|
- autoUpdateBonesMatrices?: boolean,
|
|
|
- /** defines the rendering group id to use with the viewer */
|
|
|
- renderingGroupId?: number,
|
|
|
- /** defines an optional utility layer to render the helper on */
|
|
|
- utilityLayerRenderer?: UtilityLayerRenderer | undefined);
|
|
|
- /** Gets or sets a boolean indicating if the viewer is enabled */
|
|
|
- isEnabled: boolean;
|
|
|
- private _getBonePosition;
|
|
|
- private _getLinesForBonesWithLength;
|
|
|
- private _getLinesForBonesNoLength;
|
|
|
- /** Update the viewer to sync with current skeleton state */
|
|
|
- update(): void;
|
|
|
- /** Release associated resources */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
declare module BABYLON {
|
|
|
/** @hidden */
|
|
|
class Collider {
|
|
@@ -9907,6 +9576,356 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Module Debug contains the (visual) components to debug a scene correctly
|
|
|
+ */
|
|
|
+declare module BABYLON.Debug {
|
|
|
+ /**
|
|
|
+ * The Axes viewer will show 3 axes in a specific point in space
|
|
|
+ */
|
|
|
+ class AxesViewer {
|
|
|
+ private _xline;
|
|
|
+ private _yline;
|
|
|
+ private _zline;
|
|
|
+ private _xmesh;
|
|
|
+ private _ymesh;
|
|
|
+ private _zmesh;
|
|
|
+ /**
|
|
|
+ * Gets the hosting scene
|
|
|
+ */
|
|
|
+ scene: Nullable<Scene>;
|
|
|
+ /**
|
|
|
+ * Gets or sets a number used to scale line length
|
|
|
+ */
|
|
|
+ scaleLines: number;
|
|
|
+ /**
|
|
|
+ * Creates a new AxesViewer
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @param scaleLines defines a number used to scale line length (1 by default)
|
|
|
+ */
|
|
|
+ constructor(scene: Scene, scaleLines?: number);
|
|
|
+ /**
|
|
|
+ * Force the viewer to update
|
|
|
+ * @param position defines the position of the viewer
|
|
|
+ * @param xaxis defines the x axis of the viewer
|
|
|
+ * @param yaxis defines the y axis of the viewer
|
|
|
+ * @param zaxis defines the z axis of the viewer
|
|
|
+ */
|
|
|
+ update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void;
|
|
|
+ /** Releases resources */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON.Debug {
|
|
|
+ /**
|
|
|
+ * The BoneAxesViewer will attach 3 axes to a specific bone of a specific mesh
|
|
|
+ * @see demo here: https://www.babylonjs-playground.com/#0DE8F4#8
|
|
|
+ */
|
|
|
+ class BoneAxesViewer extends AxesViewer {
|
|
|
+ /**
|
|
|
+ * Gets or sets the target mesh where to display the axes viewer
|
|
|
+ */
|
|
|
+ mesh: Nullable<Mesh>;
|
|
|
+ /**
|
|
|
+ * Gets or sets the target bone where to display the axes viewer
|
|
|
+ */
|
|
|
+ bone: Nullable<Bone>;
|
|
|
+ /** Gets current position */
|
|
|
+ pos: Vector3;
|
|
|
+ /** Gets direction of X axis */
|
|
|
+ xaxis: Vector3;
|
|
|
+ /** Gets direction of Y axis */
|
|
|
+ yaxis: Vector3;
|
|
|
+ /** Gets direction of Z axis */
|
|
|
+ zaxis: Vector3;
|
|
|
+ /**
|
|
|
+ * Creates a new BoneAxesViewer
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @param bone defines the target bone
|
|
|
+ * @param mesh defines the target mesh
|
|
|
+ * @param scaleLines defines a scaling factor for line length (1 by default)
|
|
|
+ */
|
|
|
+ constructor(scene: Scene, bone: Bone, mesh: Mesh, scaleLines?: number);
|
|
|
+ /**
|
|
|
+ * Force the viewer to update
|
|
|
+ */
|
|
|
+ update(): void;
|
|
|
+ /** Releases resources */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ interface Scene {
|
|
|
+ /**
|
|
|
+ * @hidden
|
|
|
+ * Backing field
|
|
|
+ */
|
|
|
+ _debugLayer: DebugLayer;
|
|
|
+ /**
|
|
|
+ * Gets the debug layer (aka Inspector) associated with the scene
|
|
|
+ * @see http://doc.babylonjs.com/features/playground_debuglayer
|
|
|
+ */
|
|
|
+ debugLayer: DebugLayer;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * The debug layer (aka Inspector) is the go to tool in order to better understand
|
|
|
+ * what is happening in your scene
|
|
|
+ * @see http://doc.babylonjs.com/features/playground_debuglayer
|
|
|
+ */
|
|
|
+ class DebugLayer {
|
|
|
+ /**
|
|
|
+ * Define the url to get the inspector script from.
|
|
|
+ * By default it uses the babylonjs CDN.
|
|
|
+ * @ignoreNaming
|
|
|
+ */
|
|
|
+ static InspectorURL: string;
|
|
|
+ private _scene;
|
|
|
+ private _inspector;
|
|
|
+ private BJSINSPECTOR;
|
|
|
+ /**
|
|
|
+ * Observable triggered when a property is changed through the inspector.
|
|
|
+ */
|
|
|
+ onPropertyChangedObservable: Observable<{
|
|
|
+ object: any;
|
|
|
+ property: string;
|
|
|
+ value: any;
|
|
|
+ initialValue: any;
|
|
|
+ }>;
|
|
|
+ /**
|
|
|
+ * Instantiates a new debug layer.
|
|
|
+ * The debug layer (aka Inspector) is the go to tool in order to better understand
|
|
|
+ * what is happening in your scene
|
|
|
+ * @see http://doc.babylonjs.com/features/playground_debuglayer
|
|
|
+ * @param scene Defines the scene to inspect
|
|
|
+ */
|
|
|
+ constructor(scene: Scene);
|
|
|
+ /** Creates the inspector window. */
|
|
|
+ private _createInspector;
|
|
|
+ /**
|
|
|
+ * Get if the inspector is visible or not.
|
|
|
+ * @returns true if visible otherwise, false
|
|
|
+ */
|
|
|
+ isVisible(): boolean;
|
|
|
+ /**
|
|
|
+ * Hide the inspector and close its window.
|
|
|
+ */
|
|
|
+ hide(): void;
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * Launch the debugLayer.
|
|
|
+ *
|
|
|
+ * initialTab:
|
|
|
+ * | Value | Tab Name |
|
|
|
+ * | --- | --- |
|
|
|
+ * | 0 | Scene |
|
|
|
+ * | 1 | Console |
|
|
|
+ * | 2 | Stats |
|
|
|
+ * | 3 | Textures |
|
|
|
+ * | 4 | Mesh |
|
|
|
+ * | 5 | Light |
|
|
|
+ * | 6 | Material |
|
|
|
+ * | 7 | GLTF |
|
|
|
+ * | 8 | GUI |
|
|
|
+ * | 9 | Physics |
|
|
|
+ * | 10 | Camera |
|
|
|
+ * | 11 | Audio |
|
|
|
+ *
|
|
|
+ * @param config Define the configuration of the inspector
|
|
|
+ */
|
|
|
+ show(config?: {
|
|
|
+ popup?: boolean;
|
|
|
+ initialTab?: number | string;
|
|
|
+ parentElement?: HTMLElement;
|
|
|
+ newColors?: {
|
|
|
+ backgroundColor?: string;
|
|
|
+ backgroundColorLighter?: string;
|
|
|
+ backgroundColorLighter2?: string;
|
|
|
+ backgroundColorLighter3?: string;
|
|
|
+ color?: string;
|
|
|
+ colorTop?: string;
|
|
|
+ colorBot?: string;
|
|
|
+ };
|
|
|
+ }): void;
|
|
|
+ /**
|
|
|
+ * Gets the active tab
|
|
|
+ * @return the index of the active tab or -1 if the inspector is hidden
|
|
|
+ */
|
|
|
+ getActiveTab(): number;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON.Debug {
|
|
|
+ /**
|
|
|
+ * Used to show the physics impostor around the specific mesh
|
|
|
+ */
|
|
|
+ class PhysicsViewer {
|
|
|
+ /** @hidden */
|
|
|
+ protected _impostors: Array<Nullable<PhysicsImpostor>>;
|
|
|
+ /** @hidden */
|
|
|
+ protected _meshes: Array<Nullable<AbstractMesh>>;
|
|
|
+ /** @hidden */
|
|
|
+ protected _scene: Nullable<Scene>;
|
|
|
+ /** @hidden */
|
|
|
+ protected _numMeshes: number;
|
|
|
+ /** @hidden */
|
|
|
+ protected _physicsEnginePlugin: Nullable<IPhysicsEnginePlugin>;
|
|
|
+ private _renderFunction;
|
|
|
+ private _debugBoxMesh;
|
|
|
+ private _debugSphereMesh;
|
|
|
+ private _debugMaterial;
|
|
|
+ /**
|
|
|
+ * Creates a new PhysicsViewer
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ */
|
|
|
+ constructor(scene: Scene);
|
|
|
+ /** @hidden */
|
|
|
+ protected _updateDebugMeshes(): void;
|
|
|
+ /**
|
|
|
+ * Renders a specified physic impostor
|
|
|
+ * @param impostor defines the impostor to render
|
|
|
+ */
|
|
|
+ showImpostor(impostor: PhysicsImpostor): void;
|
|
|
+ /**
|
|
|
+ * Hides a specified physic impostor
|
|
|
+ * @param impostor defines the impostor to hide
|
|
|
+ */
|
|
|
+ hideImpostor(impostor: Nullable<PhysicsImpostor>): void;
|
|
|
+ private _getDebugMaterial;
|
|
|
+ private _getDebugBoxMesh;
|
|
|
+ private _getDebugSphereMesh;
|
|
|
+ private _getDebugMesh;
|
|
|
+ /** Releases all resources */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * As raycast might be hard to debug, the RayHelper can help rendering the different rays
|
|
|
+ * in order to better appreciate the issue one might have.
|
|
|
+ * @see http://doc.babylonjs.com/babylon101/raycasts#debugging
|
|
|
+ */
|
|
|
+ class RayHelper {
|
|
|
+ /**
|
|
|
+ * Defines the ray we are currently tryin to visualize.
|
|
|
+ */
|
|
|
+ ray: Nullable<Ray>;
|
|
|
+ private _renderPoints;
|
|
|
+ private _renderLine;
|
|
|
+ private _renderFunction;
|
|
|
+ private _scene;
|
|
|
+ private _updateToMeshFunction;
|
|
|
+ private _attachedToMesh;
|
|
|
+ private _meshSpaceDirection;
|
|
|
+ private _meshSpaceOrigin;
|
|
|
+ /**
|
|
|
+ * Helper function to create a colored helper in a scene in one line.
|
|
|
+ * @param ray Defines the ray we are currently tryin to visualize
|
|
|
+ * @param scene Defines the scene the ray is used in
|
|
|
+ * @param color Defines the color we want to see the ray in
|
|
|
+ * @returns The newly created ray helper.
|
|
|
+ */
|
|
|
+ static CreateAndShow(ray: Ray, scene: Scene, color: Color3): RayHelper;
|
|
|
+ /**
|
|
|
+ * Instantiate a new ray helper.
|
|
|
+ * As raycast might be hard to debug, the RayHelper can help rendering the different rays
|
|
|
+ * in order to better appreciate the issue one might have.
|
|
|
+ * @see http://doc.babylonjs.com/babylon101/raycasts#debugging
|
|
|
+ * @param ray Defines the ray we are currently tryin to visualize
|
|
|
+ */
|
|
|
+ constructor(ray: Ray);
|
|
|
+ /**
|
|
|
+ * Shows the ray we are willing to debug.
|
|
|
+ * @param scene Defines the scene the ray needs to be rendered in
|
|
|
+ * @param color Defines the color the ray needs to be rendered in
|
|
|
+ */
|
|
|
+ show(scene: Scene, color?: Color3): void;
|
|
|
+ /**
|
|
|
+ * Hides the ray we are debugging.
|
|
|
+ */
|
|
|
+ hide(): void;
|
|
|
+ private _render;
|
|
|
+ /**
|
|
|
+ * Attach a ray helper to a mesh so that we can easily see its orientation for instance or information like its normals.
|
|
|
+ * @param mesh Defines the mesh we want the helper attached to
|
|
|
+ * @param meshSpaceDirection Defines the direction of the Ray in mesh space (local space of the mesh node)
|
|
|
+ * @param meshSpaceOrigin Defines the origin of the Ray in mesh space (local space of the mesh node)
|
|
|
+ * @param length Defines the length of the ray
|
|
|
+ */
|
|
|
+ attachToMesh(mesh: AbstractMesh, meshSpaceDirection?: Vector3, meshSpaceOrigin?: Vector3, length?: number): void;
|
|
|
+ /**
|
|
|
+ * Detach the ray helper from the mesh it has previously been attached to.
|
|
|
+ */
|
|
|
+ detachFromMesh(): void;
|
|
|
+ private _updateToMesh;
|
|
|
+ /**
|
|
|
+ * Dispose the helper and release its associated resources.
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON.Debug {
|
|
|
+ /**
|
|
|
+ * Class used to render a debug view of a given skeleton
|
|
|
+ * @see http://www.babylonjs-playground.com/#1BZJVJ#8
|
|
|
+ */
|
|
|
+ class SkeletonViewer {
|
|
|
+ /** defines the skeleton to render */
|
|
|
+ skeleton: Skeleton;
|
|
|
+ /** defines the mesh attached to the skeleton */
|
|
|
+ mesh: AbstractMesh;
|
|
|
+ /** defines a boolean indicating if bones matrices must be forced to update before rendering (true by default) */
|
|
|
+ autoUpdateBonesMatrices: boolean;
|
|
|
+ /** defines the rendering group id to use with the viewer */
|
|
|
+ renderingGroupId: number;
|
|
|
+ /** defines an optional utility layer to render the helper on */
|
|
|
+ utilityLayerRenderer?: UtilityLayerRenderer | undefined;
|
|
|
+ /** Gets or sets the color used to render the skeleton */
|
|
|
+ color: Color3;
|
|
|
+ private _scene;
|
|
|
+ private _debugLines;
|
|
|
+ private _debugMesh;
|
|
|
+ private _isEnabled;
|
|
|
+ private _renderFunction;
|
|
|
+ /**
|
|
|
+ * Returns the mesh used to render the bones
|
|
|
+ */
|
|
|
+ readonly debugMesh: Nullable<LinesMesh>;
|
|
|
+ /**
|
|
|
+ * Creates a new SkeletonViewer
|
|
|
+ * @param skeleton defines the skeleton to render
|
|
|
+ * @param mesh defines the mesh attached to the skeleton
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @param autoUpdateBonesMatrices defines a boolean indicating if bones matrices must be forced to update before rendering (true by default)
|
|
|
+ * @param renderingGroupId defines the rendering group id to use with the viewer
|
|
|
+ * @param utilityLayerRenderer defines an optional utility layer to render the helper on
|
|
|
+ */
|
|
|
+ constructor(
|
|
|
+ /** defines the skeleton to render */
|
|
|
+ skeleton: Skeleton,
|
|
|
+ /** defines the mesh attached to the skeleton */
|
|
|
+ mesh: AbstractMesh, scene: Scene,
|
|
|
+ /** defines a boolean indicating if bones matrices must be forced to update before rendering (true by default) */
|
|
|
+ autoUpdateBonesMatrices?: boolean,
|
|
|
+ /** defines the rendering group id to use with the viewer */
|
|
|
+ renderingGroupId?: number,
|
|
|
+ /** defines an optional utility layer to render the helper on */
|
|
|
+ utilityLayerRenderer?: UtilityLayerRenderer | undefined);
|
|
|
+ /** Gets or sets a boolean indicating if the viewer is enabled */
|
|
|
+ isEnabled: boolean;
|
|
|
+ private _getBonePosition;
|
|
|
+ private _getLinesForBonesWithLength;
|
|
|
+ private _getLinesForBonesNoLength;
|
|
|
+ /** Update the viewer to sync with current skeleton state */
|
|
|
+ update(): void;
|
|
|
+ /** Release associated resources */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
* Interface for attribute information associated with buffer instanciation
|
|
@@ -11557,9 +11576,10 @@ declare module BABYLON {
|
|
|
* @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
|
|
|
* @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures
|
|
|
* @param forcedExtension defines the extension to use to pick the right loader
|
|
|
+ * @param excludeLoaders array of texture loaders that should be excluded when picking a loader for the texture (default: empty array)
|
|
|
* @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
|
*/
|
|
|
- createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>): InternalTexture;
|
|
|
+ createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, excludeLoaders?: Array<IInternalTextureLoader>): InternalTexture;
|
|
|
private _rescaleTexture;
|
|
|
/**
|
|
|
* Update a raw texture
|
|
@@ -11747,9 +11767,10 @@ declare module BABYLON {
|
|
|
* @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
|
|
|
* @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
|
|
|
* @param fallback defines texture to use while falling back when (compressed) texture file not found.
|
|
|
+ * @param excludeLoaders array of texture loaders that should be excluded when picking a loader for the texture (defualt: empty array)
|
|
|
* @returns the cube texture as an InternalTexture
|
|
|
*/
|
|
|
- createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>): InternalTexture;
|
|
|
+ createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>, excludeLoaders?: Array<IInternalTextureLoader>): InternalTexture;
|
|
|
/**
|
|
|
* @hidden
|
|
|
*/
|
|
@@ -38345,6 +38366,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
loadType: number;
|
|
|
/**
|
|
|
+ * If the container has been made invalid (eg. constructor failed to correctly load array buffer)
|
|
|
+ */
|
|
|
+ isInvalid: boolean;
|
|
|
+ /**
|
|
|
* Creates a new KhronosTextureContainer
|
|
|
* @param arrayBuffer contents of the KTX container file
|
|
|
* @param facesExpected should be either 1 or 6, based whether a cube texture or or
|
|
@@ -39635,6 +39660,20 @@ declare module BABYLON {
|
|
|
*/
|
|
|
static BaseUrl: string;
|
|
|
/**
|
|
|
+ * Enable/Disable Custom HTTP Request Headers globally.
|
|
|
+ * default = false
|
|
|
+ * @see CustomRequestHeaders
|
|
|
+ */
|
|
|
+ static UseCustomRequestHeaders: boolean;
|
|
|
+ /**
|
|
|
+ * Custom HTTP Request Headers to be sent with XMLHttpRequests
|
|
|
+ * i.e. when loading files, where the server/service expects an Authorization header.
|
|
|
+ * @see InjectCustomRequestHeaders injects them to an XMLHttpRequest
|
|
|
+ */
|
|
|
+ static CustomRequestHeaders: {
|
|
|
+ [key: string]: string;
|
|
|
+ };
|
|
|
+ /**
|
|
|
* Gets or sets the retry strategy to apply when an error happens while loading an asset
|
|
|
*/
|
|
|
static DefaultRetryStrategy: (url: string, request: XMLHttpRequest, retryIndex: number) => number;
|
|
@@ -40139,6 +40178,11 @@ declare module BABYLON {
|
|
|
private static _StartPerformanceConsole;
|
|
|
private static _EndPerformanceConsole;
|
|
|
/**
|
|
|
+ * Injects the @see CustomRequestHeaders into the given request
|
|
|
+ * @param request the request that should be used for injection
|
|
|
+ */
|
|
|
+ static InjectCustomRequestHeaders(request: XMLHttpRequest): void;
|
|
|
+ /**
|
|
|
* Starts a performance counter
|
|
|
*/
|
|
|
static StartPerformanceCounter: (counterName: string, condition?: boolean) => void;
|
|
@@ -47334,7 +47378,7 @@ declare module BABYLON {
|
|
|
* @param texture defines the BabylonJS internal texture
|
|
|
* @param callback defines the method to call once ready to upload
|
|
|
*/
|
|
|
- loadData(data: ArrayBuffer, texture: InternalTexture, callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void) => void): void;
|
|
|
+ loadData(data: ArrayBuffer, texture: InternalTexture, callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void, loadFailed?: boolean) => void): void;
|
|
|
}
|
|
|
}
|
|
|
|