|
@@ -4707,6 +4707,14 @@ declare module "babylonjs/Maths/math.vector" {
|
|
|
*/
|
|
|
static FromEulerVectorToRef(vec: DeepImmutable<Vector3>, result: Quaternion): Quaternion;
|
|
|
/**
|
|
|
+ * Updates a quaternion so that it rotates vector vecFrom to vector vecTo
|
|
|
+ * @param vecFrom defines the direction vector from which to rotate
|
|
|
+ * @param vecTo defines the direction vector to which to rotate
|
|
|
+ * @param result the quaternion to store the result
|
|
|
+ * @returns the updated quaternion
|
|
|
+ */
|
|
|
+ static FromUnitVectorsToRef(vecFrom: DeepImmutable<Vector3>, vecTo: DeepImmutable<Vector3>, result: Quaternion): Quaternion;
|
|
|
+ /**
|
|
|
* Creates a new quaternion from the given Euler float angles (y, x, z)
|
|
|
* @param yaw defines the rotation around Y axis
|
|
|
* @param pitch defines the rotation around X axis
|
|
@@ -6977,8 +6985,32 @@ declare module "babylonjs/Behaviors/behavior" {
|
|
|
getBehaviorByName(name: string): Nullable<Behavior<T>>;
|
|
|
}
|
|
|
}
|
|
|
+declare module "babylonjs/Misc/sliceTools" {
|
|
|
+ /**
|
|
|
+ * Class used to provide helpers for slicing
|
|
|
+ */
|
|
|
+ export class SliceTools {
|
|
|
+ /**
|
|
|
+ * Provides a slice function that will work even on IE
|
|
|
+ * @param data defines the array to slice
|
|
|
+ * @param start defines the start of the data (optional)
|
|
|
+ * @param end defines the end of the data (optional)
|
|
|
+ * @returns the new sliced array
|
|
|
+ */
|
|
|
+ static Slice<T>(data: T, start?: number, end?: number): T;
|
|
|
+ /**
|
|
|
+ * Provides a slice function that will work even on IE
|
|
|
+ * The difference between this and Slice is that this will force-convert to array
|
|
|
+ * @param data defines the array to slice
|
|
|
+ * @param start defines the start of the data (optional)
|
|
|
+ * @param end defines the end of the data (optional)
|
|
|
+ * @returns the new sliced array
|
|
|
+ */
|
|
|
+ static SliceToArray<T, P>(data: T, start?: number, end?: number): Array<P>;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs/Meshes/buffer" {
|
|
|
- import { Nullable, DataArray } from "babylonjs/types";
|
|
|
+ import { Nullable, DataArray, FloatArray } from "babylonjs/types";
|
|
|
import { DataBuffer } from "babylonjs/Meshes/dataBuffer";
|
|
|
/**
|
|
|
* Class used to store data that will be store in GPU memory
|
|
@@ -7170,6 +7202,13 @@ declare module "babylonjs/Meshes/buffer" {
|
|
|
*/
|
|
|
getData(): Nullable<DataArray>;
|
|
|
/**
|
|
|
+ * Gets current buffer's data as a float array. Float data is constructed if the vertex buffer data cannot be returned directly.
|
|
|
+ * @param totalVertices number of vertices in the buffer to take into account
|
|
|
+ * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
|
|
|
+ * @returns a float array containing vertex data
|
|
|
+ */
|
|
|
+ getFloatData(totalVertices: number, forceCopy?: boolean): Nullable<FloatArray>;
|
|
|
+ /**
|
|
|
* Gets underlying native buffer
|
|
|
* @returns underlying native buffer
|
|
|
*/
|
|
@@ -7714,6 +7753,18 @@ declare module "babylonjs/Culling/boundingInfo" {
|
|
|
*/
|
|
|
centerOn(center: DeepImmutable<Vector3>, extend: DeepImmutable<Vector3>): BoundingInfo;
|
|
|
/**
|
|
|
+ * Grows the bounding info to include the given point.
|
|
|
+ * @param point The point that will be included in the current bounding info
|
|
|
+ * @returns the current bounding info
|
|
|
+ */
|
|
|
+ encapsulate(point: Vector3): BoundingInfo;
|
|
|
+ /**
|
|
|
+ * Grows the bounding info to encapsulate the given bounding info.
|
|
|
+ * @param toEncapsulate The bounding info that will be encapsulated in the current bounding info
|
|
|
+ * @returns the current bounding info
|
|
|
+ */
|
|
|
+ encapsulateBoundingInfo(toEncapsulate: BoundingInfo): BoundingInfo;
|
|
|
+ /**
|
|
|
* Scale the current bounding info by applying a scale factor
|
|
|
* @param factor defines the scale factor to apply
|
|
|
* @returns the current bounding info
|
|
@@ -8095,6 +8146,8 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
|
|
|
*/
|
|
|
readPixels(faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): Nullable<Promise<ArrayBufferView>>;
|
|
|
/** @hidden */
|
|
|
+ _readPixelsSync(faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): Nullable<ArrayBufferView>;
|
|
|
+ /** @hidden */
|
|
|
get _lodTextureHigh(): Nullable<BaseTexture>;
|
|
|
/** @hidden */
|
|
|
get _lodTextureMid(): Nullable<BaseTexture>;
|
|
@@ -11530,6 +11583,7 @@ declare module "babylonjs/Misc/instantiationTools" {
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Misc/copyTools" {
|
|
|
+ import { ISize } from "babylonjs/Maths/math.size";
|
|
|
import { Nullable } from "babylonjs/types";
|
|
|
import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
|
/**
|
|
@@ -11537,13 +11591,29 @@ declare module "babylonjs/Misc/copyTools" {
|
|
|
*/
|
|
|
export class CopyTools {
|
|
|
/**
|
|
|
+ * Transform some pixel data to a base64 string
|
|
|
+ * @param pixels defines the pixel data to transform to base64
|
|
|
+ * @param size defines the width and height of the (texture) data
|
|
|
+ * @param invertY true if the data must be inverted for the Y coordinate during the conversion
|
|
|
+ * @returns The base64 encoded string or null
|
|
|
+ */
|
|
|
+ static GenerateBase64StringFromPixelData(pixels: ArrayBufferView, size: ISize, invertY?: boolean): Nullable<string>;
|
|
|
+ /**
|
|
|
* Reads the pixels stored in the webgl texture and returns them as a base64 string
|
|
|
* @param texture defines the texture to read pixels from
|
|
|
* @param faceIndex defines the face of the texture to read (in case of cube texture)
|
|
|
* @param level defines the LOD level of the texture to read (in case of Mip Maps)
|
|
|
* @returns The base64 encoded string or null
|
|
|
*/
|
|
|
- static GenerateBase64StringFromTexture(texture: BaseTexture, faceIndex?: number, level?: number): Promise<Nullable<string>>;
|
|
|
+ static GenerateBase64StringFromTexture(texture: BaseTexture, faceIndex?: number, level?: number): Nullable<string>;
|
|
|
+ /**
|
|
|
+ * Reads the pixels stored in the webgl texture and returns them as a base64 string
|
|
|
+ * @param texture defines the texture to read pixels from
|
|
|
+ * @param faceIndex defines the face of the texture to read (in case of cube texture)
|
|
|
+ * @param level defines the LOD level of the texture to read (in case of Mip Maps)
|
|
|
+ * @returns The base64 encoded string or null wrapped in a promise
|
|
|
+ */
|
|
|
+ static GenerateBase64StringFromTextureAsync(texture: BaseTexture, faceIndex?: number, level?: number): Promise<Nullable<string>>;
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Engines/depthTextureCreationOptions" {
|
|
@@ -13064,6 +13134,7 @@ declare module "babylonjs/Materials/Node/Blocks/Dual/textureBlock" {
|
|
|
protected _dumpPropertiesCode(): string;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Shaders/ShadersInclude/reflectionFunction" {
|
|
@@ -13205,6 +13276,7 @@ declare module "babylonjs/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock"
|
|
|
protected _dumpPropertiesCode(): string;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Materials/Node/nodeMaterialConnectionPointCustomObject" {
|
|
@@ -13404,6 +13476,7 @@ declare module "babylonjs/Materials/Node/Blocks/PBR/refractionBlock" {
|
|
|
protected _dumpPropertiesCode(): string;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Materials/Node/Blocks/Dual/currentScreenBlock" {
|
|
@@ -13490,6 +13563,7 @@ declare module "babylonjs/Materials/Node/Blocks/Dual/currentScreenBlock" {
|
|
|
protected _buildBlock(state: NodeMaterialBuildState): this | undefined;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Materials/Node/Blocks/Particle/particleTextureBlock" {
|
|
@@ -13572,6 +13646,7 @@ declare module "babylonjs/Materials/Node/Blocks/Particle/particleTextureBlock" {
|
|
|
protected _buildBlock(state: NodeMaterialBuildState): this | undefined;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Materials/Node/nodeMaterialBuildStateSharedData" {
|
|
@@ -13895,6 +13970,8 @@ declare module "babylonjs/Materials/Node/nodeMaterialBlock" {
|
|
|
_outputs: NodeMaterialConnectionPoint[];
|
|
|
/** @hidden */
|
|
|
_preparationId: number;
|
|
|
+ /** @hidden */
|
|
|
+ readonly _originalTargetIsNeutral: boolean;
|
|
|
/**
|
|
|
* Gets the name of the block
|
|
|
*/
|
|
@@ -15440,6 +15517,7 @@ declare module "babylonjs/Particles/baseParticleSystem" {
|
|
|
* automatic start to happen and let you decide when to start emitting particles.
|
|
|
*/
|
|
|
preventAutoStart: boolean;
|
|
|
+ protected _rootUrl: string;
|
|
|
private _noiseTexture;
|
|
|
/**
|
|
|
* Gets or sets a texture used to add random noise to particle positions
|
|
@@ -17745,6 +17823,10 @@ declare module "babylonjs/Particles/IParticleSystem" {
|
|
|
*/
|
|
|
disposeOnStop: boolean;
|
|
|
/**
|
|
|
+ * If you want to launch only a few particles at once, that can be done, as well.
|
|
|
+ */
|
|
|
+ manualEmitCount: number;
|
|
|
+ /**
|
|
|
* Specifies if the particles are updated in emitter local space or world space
|
|
|
*/
|
|
|
isLocal: boolean;
|
|
@@ -19963,6 +20045,7 @@ declare module "babylonjs/Materials/standardMaterial" {
|
|
|
REFLECTIONMAP_EQUIRECTANGULAR: boolean;
|
|
|
REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
|
|
|
REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
|
|
|
+ REFLECTIONMAP_OPPOSITEZ: boolean;
|
|
|
INVERTCUBICMAP: boolean;
|
|
|
LOGARITHMICDEPTH: boolean;
|
|
|
REFRACTION: boolean;
|
|
@@ -29504,6 +29587,10 @@ declare module "babylonjs/Meshes/instancedMesh" {
|
|
|
*/
|
|
|
registerInstancedBuffer(kind: string, stride: number): void;
|
|
|
/**
|
|
|
+ * Invalidate VertexArrayObjects belonging to the mesh (but not to the Geometry of the mesh).
|
|
|
+ */
|
|
|
+ _invalidateInstanceVertexArrayObject(): void;
|
|
|
+ /**
|
|
|
* true to use the edge renderer for all instances of this mesh
|
|
|
*/
|
|
|
edgesShareWithInstances: boolean;
|
|
@@ -29521,6 +29608,9 @@ declare module "babylonjs/Meshes/instancedMesh" {
|
|
|
strides: {
|
|
|
[key: string]: number;
|
|
|
};
|
|
|
+ vertexArrayObjects?: {
|
|
|
+ [key: string]: WebGLVertexArrayObject;
|
|
|
+ };
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -32502,7 +32592,11 @@ declare module "babylonjs/Meshes/geometry" {
|
|
|
updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean): void;
|
|
|
private _updateBoundingInfo;
|
|
|
/** @hidden */
|
|
|
- _bind(effect: Nullable<Effect>, indexToBind?: Nullable<DataBuffer>): void;
|
|
|
+ _bind(effect: Nullable<Effect>, indexToBind?: Nullable<DataBuffer>, overrideVertexBuffers?: {
|
|
|
+ [kind: string]: Nullable<VertexBuffer>;
|
|
|
+ }, overrideVertexArrayObjects?: {
|
|
|
+ [key: string]: WebGLVertexArrayObject;
|
|
|
+ }): void;
|
|
|
/**
|
|
|
* Gets total number of vertices
|
|
|
* @returns the total number of vertices
|
|
@@ -41123,6 +41217,8 @@ declare module "babylonjs/Engines/engineFeatures" {
|
|
|
supportExtendedTextureFormats: boolean;
|
|
|
/** Indicates that the switch/case construct is supported in shaders */
|
|
|
supportSwitchCaseInShader: boolean;
|
|
|
+ /** Indicates that synchronous texture reading is supported */
|
|
|
+ supportSyncTextureRead: boolean;
|
|
|
/** @hidden */
|
|
|
_collectUbosUpdatedInFrame: boolean;
|
|
|
}
|
|
@@ -41961,11 +42057,14 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
* @param vertexBuffers defines the list of vertex buffers to store
|
|
|
* @param indexBuffer defines the index buffer to store
|
|
|
* @param effect defines the effect to store
|
|
|
+ * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
|
|
|
* @returns the new vertex array object
|
|
|
*/
|
|
|
recordVertexArrayObject(vertexBuffers: {
|
|
|
[key: string]: VertexBuffer;
|
|
|
- }, indexBuffer: Nullable<DataBuffer>, effect: Effect): WebGLVertexArrayObject;
|
|
|
+ }, indexBuffer: Nullable<DataBuffer>, effect: Effect, overrideVertexBuffers?: {
|
|
|
+ [kind: string]: Nullable<VertexBuffer>;
|
|
|
+ }): WebGLVertexArrayObject;
|
|
|
/**
|
|
|
* Bind a specific vertex array object
|
|
|
* @see https://doc.babylonjs.com/features/webgl2#vertex-array-objects
|
|
@@ -41988,10 +42087,13 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
* @param vertexBuffers defines the list of vertex buffers to bind
|
|
|
* @param indexBuffer defines the index buffer to bind
|
|
|
* @param effect defines the effect associated with the vertex buffers
|
|
|
+ * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
|
|
|
*/
|
|
|
bindBuffers(vertexBuffers: {
|
|
|
[key: string]: Nullable<VertexBuffer>;
|
|
|
- }, indexBuffer: Nullable<DataBuffer>, effect: Effect): void;
|
|
|
+ }, indexBuffer: Nullable<DataBuffer>, effect: Effect, overrideVertexBuffers?: {
|
|
|
+ [kind: string]: Nullable<VertexBuffer>;
|
|
|
+ }): void;
|
|
|
/**
|
|
|
* Unbind all instance attributes
|
|
|
*/
|
|
@@ -43189,6 +43291,8 @@ declare module "babylonjs/Engines/Extensions/engine.readTexture" {
|
|
|
interface ThinEngine {
|
|
|
/** @hidden */
|
|
|
_readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): Promise<ArrayBufferView>;
|
|
|
+ /** @hidden */
|
|
|
+ _readTexturePixelsSync(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): ArrayBufferView;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -46376,6 +46480,7 @@ declare module "babylonjs/Engines/WebGPU/webgpuCacheRenderPipeline" {
|
|
|
private _stencilWriteMask;
|
|
|
private _depthStencilState;
|
|
|
private _vertexBuffers;
|
|
|
+ private _overrideVertexBuffers;
|
|
|
private _indexBuffer;
|
|
|
constructor(device: GPUDevice, emptyVertexBuffer: VertexBuffer);
|
|
|
reset(): void;
|
|
@@ -46409,7 +46514,9 @@ declare module "babylonjs/Engines/WebGPU/webgpuCacheRenderPipeline" {
|
|
|
setStencilState(stencilEnabled: boolean, compare: Nullable<number>, depthFailOp: Nullable<number>, passOp: Nullable<number>, failOp: Nullable<number>, readMask: number, writeMask: number): void;
|
|
|
setBuffers(vertexBuffers: Nullable<{
|
|
|
[key: string]: Nullable<VertexBuffer>;
|
|
|
- }>, indexBuffer: Nullable<DataBuffer>): void;
|
|
|
+ }>, indexBuffer: Nullable<DataBuffer>, overrideVertexBuffers: Nullable<{
|
|
|
+ [key: string]: Nullable<VertexBuffer>;
|
|
|
+ }>): void;
|
|
|
private static _GetTopology;
|
|
|
private static _GetAphaBlendOperation;
|
|
|
private static _GetAphaBlendFactor;
|
|
@@ -46587,6 +46694,7 @@ declare module "babylonjs/Engines/webgpuEngine" {
|
|
|
private _rttRenderPassWrapper;
|
|
|
private _pendingDebugCommands;
|
|
|
private _currentVertexBuffers;
|
|
|
+ private _currentOverrideVertexBuffers;
|
|
|
private _currentIndexBuffer;
|
|
|
private __colorWrite;
|
|
|
private _uniformsBuffers;
|
|
@@ -46769,10 +46877,13 @@ declare module "babylonjs/Engines/webgpuEngine" {
|
|
|
* @param vertexBuffers defines the list of vertex buffers to bind
|
|
|
* @param indexBuffer defines the index buffer to bind
|
|
|
* @param effect defines the effect associated with the vertex buffers
|
|
|
+ * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
|
|
|
*/
|
|
|
bindBuffers(vertexBuffers: {
|
|
|
[key: string]: Nullable<VertexBuffer>;
|
|
|
- }, indexBuffer: Nullable<DataBuffer>, effect: Effect): void;
|
|
|
+ }, indexBuffer: Nullable<DataBuffer>, effect: Effect, overrideVertexBuffers?: {
|
|
|
+ [kind: string]: Nullable<VertexBuffer>;
|
|
|
+ }): void;
|
|
|
/** @hidden */
|
|
|
_releaseBuffer(buffer: DataBuffer): boolean;
|
|
|
createUniformBuffer(elements: FloatArray): DataBuffer;
|
|
@@ -47095,6 +47206,8 @@ declare module "babylonjs/Engines/webgpuEngine" {
|
|
|
readPixels(x: number, y: number, width: number, height: number, hasAlpha?: boolean, flushRenderer?: boolean): Promise<ArrayBufferView>;
|
|
|
/** @hidden */
|
|
|
_readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): Promise<ArrayBufferView>;
|
|
|
+ /** @hidden */
|
|
|
+ _readTexturePixelsSync(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): ArrayBufferView;
|
|
|
/**
|
|
|
* Creates a new render target texture
|
|
|
* @param size defines the size of the texture
|
|
@@ -62615,6 +62728,8 @@ declare module "babylonjs/Engines/nativeEngine" {
|
|
|
* @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
|
|
|
*/
|
|
|
updateDynamicTexture(texture: Nullable<InternalTexture>, canvas: HTMLCanvasElement, invertY: boolean, premulAlpha?: boolean, format?: number): void;
|
|
|
+ createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number): InternalTexture;
|
|
|
+ updateRawTexture(texture: Nullable<InternalTexture>, bufferView: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number): void;
|
|
|
/**
|
|
|
* Usually called from Texture.ts.
|
|
|
* Passed information to create a WebGLTexture
|
|
@@ -82666,10 +82781,20 @@ declare module "babylonjs/Misc/sceneSerializer" {
|
|
|
static ClearCache(): void;
|
|
|
/**
|
|
|
* Serialize a scene into a JSON compatible object
|
|
|
+ * Note that if the current engine does not support synchronous texture reading (like WebGPU), you should use SerializeAsync instead
|
|
|
+ * as else you may not retrieve the proper base64 encoded texture data (when using the Texture.ForceSerializeBuffers flag)
|
|
|
* @param scene defines the scene to serialize
|
|
|
* @returns a JSON compatible object
|
|
|
*/
|
|
|
static Serialize(scene: Scene): any;
|
|
|
+ private static _Serialize;
|
|
|
+ /**
|
|
|
+ * Serialize a scene into a JSON compatible object
|
|
|
+ * @param scene defines the scene to serialize
|
|
|
+ * @returns a JSON promise compatible object
|
|
|
+ */
|
|
|
+ static SerializeAsync(scene: Scene): Promise<any>;
|
|
|
+ private static _CollectPromises;
|
|
|
/**
|
|
|
* Serialize a mesh into a JSON compatible object
|
|
|
* @param toSerialize defines the mesh to serialize
|
|
@@ -82982,7 +83107,7 @@ declare module "babylonjs/Misc/sceneRecorder" {
|
|
|
track(scene: Scene): void;
|
|
|
/**
|
|
|
* Get the delta between current state and original state
|
|
|
- * @returns a string containing the delta
|
|
|
+ * @returns a any containing the delta
|
|
|
*/
|
|
|
getDelta(): any;
|
|
|
private _compareArray;
|
|
@@ -89541,6 +89666,14 @@ declare module BABYLON {
|
|
|
*/
|
|
|
static FromEulerVectorToRef(vec: DeepImmutable<Vector3>, result: Quaternion): Quaternion;
|
|
|
/**
|
|
|
+ * Updates a quaternion so that it rotates vector vecFrom to vector vecTo
|
|
|
+ * @param vecFrom defines the direction vector from which to rotate
|
|
|
+ * @param vecTo defines the direction vector to which to rotate
|
|
|
+ * @param result the quaternion to store the result
|
|
|
+ * @returns the updated quaternion
|
|
|
+ */
|
|
|
+ static FromUnitVectorsToRef(vecFrom: DeepImmutable<Vector3>, vecTo: DeepImmutable<Vector3>, result: Quaternion): Quaternion;
|
|
|
+ /**
|
|
|
* Creates a new quaternion from the given Euler float angles (y, x, z)
|
|
|
* @param yaw defines the rotation around Y axis
|
|
|
* @param pitch defines the rotation around X axis
|
|
@@ -91809,6 +91942,30 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
+ * Class used to provide helpers for slicing
|
|
|
+ */
|
|
|
+ export class SliceTools {
|
|
|
+ /**
|
|
|
+ * Provides a slice function that will work even on IE
|
|
|
+ * @param data defines the array to slice
|
|
|
+ * @param start defines the start of the data (optional)
|
|
|
+ * @param end defines the end of the data (optional)
|
|
|
+ * @returns the new sliced array
|
|
|
+ */
|
|
|
+ static Slice<T>(data: T, start?: number, end?: number): T;
|
|
|
+ /**
|
|
|
+ * Provides a slice function that will work even on IE
|
|
|
+ * The difference between this and Slice is that this will force-convert to array
|
|
|
+ * @param data defines the array to slice
|
|
|
+ * @param start defines the start of the data (optional)
|
|
|
+ * @param end defines the end of the data (optional)
|
|
|
+ * @returns the new sliced array
|
|
|
+ */
|
|
|
+ static SliceToArray<T, P>(data: T, start?: number, end?: number): Array<P>;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
* Class used to store data that will be store in GPU memory
|
|
|
*/
|
|
|
export class Buffer {
|
|
@@ -91998,6 +92155,13 @@ declare module BABYLON {
|
|
|
*/
|
|
|
getData(): Nullable<DataArray>;
|
|
|
/**
|
|
|
+ * Gets current buffer's data as a float array. Float data is constructed if the vertex buffer data cannot be returned directly.
|
|
|
+ * @param totalVertices number of vertices in the buffer to take into account
|
|
|
+ * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
|
|
|
+ * @returns a float array containing vertex data
|
|
|
+ */
|
|
|
+ getFloatData(totalVertices: number, forceCopy?: boolean): Nullable<FloatArray>;
|
|
|
+ /**
|
|
|
* Gets underlying native buffer
|
|
|
* @returns underlying native buffer
|
|
|
*/
|
|
@@ -92523,6 +92687,18 @@ declare module BABYLON {
|
|
|
*/
|
|
|
centerOn(center: DeepImmutable<Vector3>, extend: DeepImmutable<Vector3>): BoundingInfo;
|
|
|
/**
|
|
|
+ * Grows the bounding info to include the given point.
|
|
|
+ * @param point The point that will be included in the current bounding info
|
|
|
+ * @returns the current bounding info
|
|
|
+ */
|
|
|
+ encapsulate(point: Vector3): BoundingInfo;
|
|
|
+ /**
|
|
|
+ * Grows the bounding info to encapsulate the given bounding info.
|
|
|
+ * @param toEncapsulate The bounding info that will be encapsulated in the current bounding info
|
|
|
+ * @returns the current bounding info
|
|
|
+ */
|
|
|
+ encapsulateBoundingInfo(toEncapsulate: BoundingInfo): BoundingInfo;
|
|
|
+ /**
|
|
|
* Scale the current bounding info by applying a scale factor
|
|
|
* @param factor defines the scale factor to apply
|
|
|
* @returns the current bounding info
|
|
@@ -92893,6 +93069,8 @@ declare module BABYLON {
|
|
|
*/
|
|
|
readPixels(faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): Nullable<Promise<ArrayBufferView>>;
|
|
|
/** @hidden */
|
|
|
+ _readPixelsSync(faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): Nullable<ArrayBufferView>;
|
|
|
+ /** @hidden */
|
|
|
get _lodTextureHigh(): Nullable<BaseTexture>;
|
|
|
/** @hidden */
|
|
|
get _lodTextureMid(): Nullable<BaseTexture>;
|
|
@@ -96235,13 +96413,29 @@ declare module BABYLON {
|
|
|
*/
|
|
|
export class CopyTools {
|
|
|
/**
|
|
|
+ * Transform some pixel data to a base64 string
|
|
|
+ * @param pixels defines the pixel data to transform to base64
|
|
|
+ * @param size defines the width and height of the (texture) data
|
|
|
+ * @param invertY true if the data must be inverted for the Y coordinate during the conversion
|
|
|
+ * @returns The base64 encoded string or null
|
|
|
+ */
|
|
|
+ static GenerateBase64StringFromPixelData(pixels: ArrayBufferView, size: ISize, invertY?: boolean): Nullable<string>;
|
|
|
+ /**
|
|
|
* Reads the pixels stored in the webgl texture and returns them as a base64 string
|
|
|
* @param texture defines the texture to read pixels from
|
|
|
* @param faceIndex defines the face of the texture to read (in case of cube texture)
|
|
|
* @param level defines the LOD level of the texture to read (in case of Mip Maps)
|
|
|
* @returns The base64 encoded string or null
|
|
|
*/
|
|
|
- static GenerateBase64StringFromTexture(texture: BaseTexture, faceIndex?: number, level?: number): Promise<Nullable<string>>;
|
|
|
+ static GenerateBase64StringFromTexture(texture: BaseTexture, faceIndex?: number, level?: number): Nullable<string>;
|
|
|
+ /**
|
|
|
+ * Reads the pixels stored in the webgl texture and returns them as a base64 string
|
|
|
+ * @param texture defines the texture to read pixels from
|
|
|
+ * @param faceIndex defines the face of the texture to read (in case of cube texture)
|
|
|
+ * @param level defines the LOD level of the texture to read (in case of Mip Maps)
|
|
|
+ * @returns The base64 encoded string or null wrapped in a promise
|
|
|
+ */
|
|
|
+ static GenerateBase64StringFromTextureAsync(texture: BaseTexture, faceIndex?: number, level?: number): Promise<Nullable<string>>;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -97690,6 +97884,7 @@ declare module BABYLON {
|
|
|
protected _dumpPropertiesCode(): string;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -97820,6 +98015,7 @@ declare module BABYLON {
|
|
|
protected _dumpPropertiesCode(): string;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -98005,6 +98201,7 @@ declare module BABYLON {
|
|
|
protected _dumpPropertiesCode(): string;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -98081,6 +98278,7 @@ declare module BABYLON {
|
|
|
protected _buildBlock(state: NodeMaterialBuildState): this | undefined;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -98154,6 +98352,7 @@ declare module BABYLON {
|
|
|
protected _buildBlock(state: NodeMaterialBuildState): this | undefined;
|
|
|
serialize(): any;
|
|
|
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -98450,6 +98649,8 @@ declare module BABYLON {
|
|
|
_outputs: NodeMaterialConnectionPoint[];
|
|
|
/** @hidden */
|
|
|
_preparationId: number;
|
|
|
+ /** @hidden */
|
|
|
+ readonly _originalTargetIsNeutral: boolean;
|
|
|
/**
|
|
|
* Gets the name of the block
|
|
|
*/
|
|
@@ -99906,6 +100107,7 @@ declare module BABYLON {
|
|
|
* automatic start to happen and let you decide when to start emitting particles.
|
|
|
*/
|
|
|
preventAutoStart: boolean;
|
|
|
+ protected _rootUrl: string;
|
|
|
private _noiseTexture;
|
|
|
/**
|
|
|
* Gets or sets a texture used to add random noise to particle positions
|
|
@@ -102109,6 +102311,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
disposeOnStop: boolean;
|
|
|
/**
|
|
|
+ * If you want to launch only a few particles at once, that can be done, as well.
|
|
|
+ */
|
|
|
+ manualEmitCount: number;
|
|
|
+ /**
|
|
|
* Specifies if the particles are updated in emitter local space or world space
|
|
|
*/
|
|
|
isLocal: boolean;
|
|
@@ -104194,6 +104400,7 @@ declare module BABYLON {
|
|
|
REFLECTIONMAP_EQUIRECTANGULAR: boolean;
|
|
|
REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
|
|
|
REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
|
|
|
+ REFLECTIONMAP_OPPOSITEZ: boolean;
|
|
|
INVERTCUBICMAP: boolean;
|
|
|
LOGARITHMICDEPTH: boolean;
|
|
|
REFRACTION: boolean;
|
|
@@ -113274,6 +113481,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
registerInstancedBuffer(kind: string, stride: number): void;
|
|
|
/**
|
|
|
+ * Invalidate VertexArrayObjects belonging to the mesh (but not to the Geometry of the mesh).
|
|
|
+ */
|
|
|
+ _invalidateInstanceVertexArrayObject(): void;
|
|
|
+ /**
|
|
|
* true to use the edge renderer for all instances of this mesh
|
|
|
*/
|
|
|
edgesShareWithInstances: boolean;
|
|
@@ -113291,6 +113502,9 @@ declare module BABYLON {
|
|
|
strides: {
|
|
|
[key: string]: number;
|
|
|
};
|
|
|
+ vertexArrayObjects?: {
|
|
|
+ [key: string]: WebGLVertexArrayObject;
|
|
|
+ };
|
|
|
};
|
|
|
}
|
|
|
interface AbstractMesh {
|
|
@@ -116130,7 +116344,11 @@ declare module BABYLON {
|
|
|
updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean): void;
|
|
|
private _updateBoundingInfo;
|
|
|
/** @hidden */
|
|
|
- _bind(effect: Nullable<Effect>, indexToBind?: Nullable<DataBuffer>): void;
|
|
|
+ _bind(effect: Nullable<Effect>, indexToBind?: Nullable<DataBuffer>, overrideVertexBuffers?: {
|
|
|
+ [kind: string]: Nullable<VertexBuffer>;
|
|
|
+ }, overrideVertexArrayObjects?: {
|
|
|
+ [key: string]: WebGLVertexArrayObject;
|
|
|
+ }): void;
|
|
|
/**
|
|
|
* Gets total number of vertices
|
|
|
* @returns the total number of vertices
|
|
@@ -124526,6 +124744,8 @@ declare module BABYLON {
|
|
|
supportExtendedTextureFormats: boolean;
|
|
|
/** Indicates that the switch/case construct is supported in shaders */
|
|
|
supportSwitchCaseInShader: boolean;
|
|
|
+ /** Indicates that synchronous texture reading is supported */
|
|
|
+ supportSyncTextureRead: boolean;
|
|
|
/** @hidden */
|
|
|
_collectUbosUpdatedInFrame: boolean;
|
|
|
}
|
|
@@ -125321,11 +125541,14 @@ declare module BABYLON {
|
|
|
* @param vertexBuffers defines the list of vertex buffers to store
|
|
|
* @param indexBuffer defines the index buffer to store
|
|
|
* @param effect defines the effect to store
|
|
|
+ * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
|
|
|
* @returns the new vertex array object
|
|
|
*/
|
|
|
recordVertexArrayObject(vertexBuffers: {
|
|
|
[key: string]: VertexBuffer;
|
|
|
- }, indexBuffer: Nullable<DataBuffer>, effect: Effect): WebGLVertexArrayObject;
|
|
|
+ }, indexBuffer: Nullable<DataBuffer>, effect: Effect, overrideVertexBuffers?: {
|
|
|
+ [kind: string]: Nullable<VertexBuffer>;
|
|
|
+ }): WebGLVertexArrayObject;
|
|
|
/**
|
|
|
* Bind a specific vertex array object
|
|
|
* @see https://doc.babylonjs.com/features/webgl2#vertex-array-objects
|
|
@@ -125348,10 +125571,13 @@ declare module BABYLON {
|
|
|
* @param vertexBuffers defines the list of vertex buffers to bind
|
|
|
* @param indexBuffer defines the index buffer to bind
|
|
|
* @param effect defines the effect associated with the vertex buffers
|
|
|
+ * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
|
|
|
*/
|
|
|
bindBuffers(vertexBuffers: {
|
|
|
[key: string]: Nullable<VertexBuffer>;
|
|
|
- }, indexBuffer: Nullable<DataBuffer>, effect: Effect): void;
|
|
|
+ }, indexBuffer: Nullable<DataBuffer>, effect: Effect, overrideVertexBuffers?: {
|
|
|
+ [kind: string]: Nullable<VertexBuffer>;
|
|
|
+ }): void;
|
|
|
/**
|
|
|
* Unbind all instance attributes
|
|
|
*/
|
|
@@ -126540,6 +126766,8 @@ declare module BABYLON {
|
|
|
interface ThinEngine {
|
|
|
/** @hidden */
|
|
|
_readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): Promise<ArrayBufferView>;
|
|
|
+ /** @hidden */
|
|
|
+ _readTexturePixelsSync(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): ArrayBufferView;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -129638,6 +129866,7 @@ declare module BABYLON {
|
|
|
private _stencilWriteMask;
|
|
|
private _depthStencilState;
|
|
|
private _vertexBuffers;
|
|
|
+ private _overrideVertexBuffers;
|
|
|
private _indexBuffer;
|
|
|
constructor(device: GPUDevice, emptyVertexBuffer: VertexBuffer);
|
|
|
reset(): void;
|
|
@@ -129671,7 +129900,9 @@ declare module BABYLON {
|
|
|
setStencilState(stencilEnabled: boolean, compare: Nullable<number>, depthFailOp: Nullable<number>, passOp: Nullable<number>, failOp: Nullable<number>, readMask: number, writeMask: number): void;
|
|
|
setBuffers(vertexBuffers: Nullable<{
|
|
|
[key: string]: Nullable<VertexBuffer>;
|
|
|
- }>, indexBuffer: Nullable<DataBuffer>): void;
|
|
|
+ }>, indexBuffer: Nullable<DataBuffer>, overrideVertexBuffers: Nullable<{
|
|
|
+ [key: string]: Nullable<VertexBuffer>;
|
|
|
+ }>): void;
|
|
|
private static _GetTopology;
|
|
|
private static _GetAphaBlendOperation;
|
|
|
private static _GetAphaBlendFactor;
|
|
@@ -129828,6 +130059,7 @@ declare module BABYLON {
|
|
|
private _rttRenderPassWrapper;
|
|
|
private _pendingDebugCommands;
|
|
|
private _currentVertexBuffers;
|
|
|
+ private _currentOverrideVertexBuffers;
|
|
|
private _currentIndexBuffer;
|
|
|
private __colorWrite;
|
|
|
private _uniformsBuffers;
|
|
@@ -130010,10 +130242,13 @@ declare module BABYLON {
|
|
|
* @param vertexBuffers defines the list of vertex buffers to bind
|
|
|
* @param indexBuffer defines the index buffer to bind
|
|
|
* @param effect defines the effect associated with the vertex buffers
|
|
|
+ * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
|
|
|
*/
|
|
|
bindBuffers(vertexBuffers: {
|
|
|
[key: string]: Nullable<VertexBuffer>;
|
|
|
- }, indexBuffer: Nullable<DataBuffer>, effect: Effect): void;
|
|
|
+ }, indexBuffer: Nullable<DataBuffer>, effect: Effect, overrideVertexBuffers?: {
|
|
|
+ [kind: string]: Nullable<VertexBuffer>;
|
|
|
+ }): void;
|
|
|
/** @hidden */
|
|
|
_releaseBuffer(buffer: DataBuffer): boolean;
|
|
|
createUniformBuffer(elements: FloatArray): DataBuffer;
|
|
@@ -130336,6 +130571,8 @@ declare module BABYLON {
|
|
|
readPixels(x: number, y: number, width: number, height: number, hasAlpha?: boolean, flushRenderer?: boolean): Promise<ArrayBufferView>;
|
|
|
/** @hidden */
|
|
|
_readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): Promise<ArrayBufferView>;
|
|
|
+ /** @hidden */
|
|
|
+ _readTexturePixelsSync(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean): ArrayBufferView;
|
|
|
/**
|
|
|
* Creates a new render target texture
|
|
|
* @param size defines the size of the texture
|
|
@@ -144948,6 +145185,8 @@ declare module BABYLON {
|
|
|
* @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
|
|
|
*/
|
|
|
updateDynamicTexture(texture: Nullable<InternalTexture>, canvas: HTMLCanvasElement, invertY: boolean, premulAlpha?: boolean, format?: number): void;
|
|
|
+ createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number): InternalTexture;
|
|
|
+ updateRawTexture(texture: Nullable<InternalTexture>, bufferView: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number): void;
|
|
|
/**
|
|
|
* Usually called from Texture.ts.
|
|
|
* Passed information to create a WebGLTexture
|
|
@@ -163292,10 +163531,20 @@ declare module BABYLON {
|
|
|
static ClearCache(): void;
|
|
|
/**
|
|
|
* Serialize a scene into a JSON compatible object
|
|
|
+ * Note that if the current engine does not support synchronous texture reading (like WebGPU), you should use SerializeAsync instead
|
|
|
+ * as else you may not retrieve the proper base64 encoded texture data (when using the Texture.ForceSerializeBuffers flag)
|
|
|
* @param scene defines the scene to serialize
|
|
|
* @returns a JSON compatible object
|
|
|
*/
|
|
|
static Serialize(scene: Scene): any;
|
|
|
+ private static _Serialize;
|
|
|
+ /**
|
|
|
+ * Serialize a scene into a JSON compatible object
|
|
|
+ * @param scene defines the scene to serialize
|
|
|
+ * @returns a JSON promise compatible object
|
|
|
+ */
|
|
|
+ static SerializeAsync(scene: Scene): Promise<any>;
|
|
|
+ private static _CollectPromises;
|
|
|
/**
|
|
|
* Serialize a mesh into a JSON compatible object
|
|
|
* @param toSerialize defines the mesh to serialize
|
|
@@ -163602,7 +163851,7 @@ declare module BABYLON {
|
|
|
track(scene: Scene): void;
|
|
|
/**
|
|
|
* Get the delta between current state and original state
|
|
|
- * @returns a string containing the delta
|
|
|
+ * @returns a any containing the delta
|
|
|
*/
|
|
|
getDelta(): any;
|
|
|
private _compareArray;
|