@babylonjs/core 8.16.1 → 8.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Materials/Textures/Loaders/iesTextureLoader.js +1 -1
- package/Materials/Textures/Loaders/iesTextureLoader.js.map +1 -1
- package/Materials/Textures/thinTexture.d.ts +2 -1
- package/Materials/Textures/thinTexture.js +3 -2
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Meshes/transformNode.js +5 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/index.d.ts +1 -0
- package/Particles/Node/Blocks/Emitters/index.js +1 -0
- package/Particles/Node/Blocks/Emitters/index.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.d.ts +79 -0
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js +223 -0
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js.map +1 -0
- package/Physics/v2/ragdoll.d.ts +1 -0
- package/Physics/v2/ragdoll.js +15 -1
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/postProcess.js +2 -5
- package/PostProcesses/postProcess.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +19 -0
- package/scene.js +34 -0
- package/scene.js.map +1 -1
|
@@ -28,7 +28,7 @@ export class _IESTextureLoader {
|
|
|
28
28
|
loadData(data, texture, callback) {
|
|
29
29
|
const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
30
30
|
const textureData = LoadIESData(uint8array);
|
|
31
|
-
callback(textureData.width, textureData.height,
|
|
31
|
+
callback(textureData.width, textureData.height, texture.useMipMaps, false, () => {
|
|
32
32
|
const engine = texture.getEngine();
|
|
33
33
|
texture.type = 1;
|
|
34
34
|
texture.format = 6;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iesTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/iesTextureLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,yCAAkC;AAExD;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,iBAAiB;IAA9B;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;IAiC5C,CAAC;IA/BG;;OAEG;IACI,YAAY;QACf,4CAA4C;QAC5C,MAAM,6BAA6B,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CACX,IAAqB,EACrB,OAAwB,EACxB,QAA+G;QAE/G,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjF,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QAE5C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"iesTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/iesTextureLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,yCAAkC;AAExD;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,iBAAiB;IAA9B;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;IAiC5C,CAAC;IA/BG;;OAEG;IACI,YAAY;QACf,4CAA4C;QAC5C,MAAM,6BAA6B,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CACX,IAAqB,EACrB,OAAwB,EACxB,QAA+G;QAE/G,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjF,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QAE5C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE;YAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;YACnC,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,iBAAiB,CAAC;YAC3C,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC;YAC3C,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;YAC5B,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import type { InternalTexture } from \"../internalTexture\";\r\nimport type { IInternalTextureLoader } from \"./internalTextureLoader\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\nimport { LoadIESData } from \"core/Lights/IES/iesLoader\";\r\n\r\n/**\r\n * Implementation of the IES Texture Loader.\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _IESTextureLoader implements IInternalTextureLoader {\r\n /**\r\n * Defines whether the loader supports cascade loading the different faces.\r\n */\r\n public readonly supportCascades = false;\r\n\r\n /**\r\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\r\n */\r\n public loadCubeData(): void {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \".ies not supported in Cube.\";\r\n }\r\n\r\n /**\r\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param callback defines the method to call once ready to upload\r\n */\r\n public loadData(\r\n data: ArrayBufferView,\r\n texture: InternalTexture,\r\n callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void) => void\r\n ): void {\r\n const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\r\n\r\n const textureData = LoadIESData(uint8array);\r\n\r\n callback(textureData.width, textureData.height, texture.useMipMaps, false, () => {\r\n const engine = texture.getEngine();\r\n texture.type = Constants.TEXTURETYPE_FLOAT;\r\n texture.format = Constants.TEXTUREFORMAT_R;\r\n texture._gammaSpace = false;\r\n engine._uploadDataToTextureDirectly(texture, textureData.data);\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -138,8 +138,9 @@ export declare class ThinTexture {
|
|
|
138
138
|
* > _min_: minification filter (far from the viewer)
|
|
139
139
|
* > _mip_: filter used between mip map levels
|
|
140
140
|
*@param samplingMode Define the new sampling mode of the texture
|
|
141
|
+
*@param generateMipMaps Define if the texture should generate mip maps or not. Default is false.
|
|
141
142
|
*/
|
|
142
|
-
updateSamplingMode(samplingMode: number): void;
|
|
143
|
+
updateSamplingMode(samplingMode: number, generateMipMaps?: boolean): void;
|
|
143
144
|
/**
|
|
144
145
|
* Release and destroy the underlying lower level texture aka internalTexture.
|
|
145
146
|
*/
|
|
@@ -234,10 +234,11 @@ export class ThinTexture {
|
|
|
234
234
|
* > _min_: minification filter (far from the viewer)
|
|
235
235
|
* > _mip_: filter used between mip map levels
|
|
236
236
|
*@param samplingMode Define the new sampling mode of the texture
|
|
237
|
+
*@param generateMipMaps Define if the texture should generate mip maps or not. Default is false.
|
|
237
238
|
*/
|
|
238
|
-
updateSamplingMode(samplingMode) {
|
|
239
|
+
updateSamplingMode(samplingMode, generateMipMaps = false) {
|
|
239
240
|
if (this._texture && this._engine) {
|
|
240
|
-
this._engine.updateTextureSamplingMode(samplingMode, this._texture, this._texture.generateMipMaps);
|
|
241
|
+
this._engine.updateTextureSamplingMode(samplingMode, this._texture, this._texture.generateMipMaps && generateMipMaps);
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Text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;;OAuBG;IACI,kBAAkB,CAAC,YAAoB;QAC1C,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAChC,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACvG,CAAC;IACL,CAAC;IAED;;OAEG;IACI,sBAAsB;QACzB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACzB,CAAC;IACL,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACxB,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\n\r\nimport type { ISize } from \"../../Maths/math.size\";\r\nimport { Size } from \"../../Maths/math.size\";\r\n\r\nimport type { AbstractEngine } from \"../../Engines/abstractEngine\";\r\nimport type { RenderTargetWrapper } from \"core/Engines/renderTargetWrapper\";\r\n\r\n/**\r\n * Base class of all the textures in babylon.\r\n * It groups all the common properties required to work with Thin Engine.\r\n */\r\nexport class ThinTexture {\r\n protected _wrapU = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n public get wrapU() {\r\n return this._wrapU;\r\n }\r\n\r\n public set wrapU(value: number) {\r\n this._wrapU = value;\r\n }\r\n\r\n protected _wrapV = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n public get wrapV() {\r\n return this._wrapV;\r\n }\r\n\r\n public set wrapV(value: number) {\r\n this._wrapV = value;\r\n }\r\n\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n public wrapR = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n\r\n /**\r\n * With compliant hardware and browser (supporting anisotropic filtering)\r\n * this defines the level of anisotropic filtering in the texture.\r\n * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.\r\n */\r\n public anisotropicFilteringLevel = 4;\r\n\r\n /**\r\n * Define the current state of the loading sequence when in delayed load mode.\r\n */\r\n public delayLoadState = Constants.DELAYLOADSTATE_NONE;\r\n\r\n /**\r\n * How a texture is mapped.\r\n * Unused in thin texture mode.\r\n */\r\n public get coordinatesMode(): number {\r\n return 0;\r\n }\r\n\r\n /**\r\n * Define if the texture is a cube texture or if false a 2d texture.\r\n */\r\n public get isCube(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.isCube;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n protected set isCube(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.isCube = value;\r\n }\r\n\r\n /**\r\n * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.\r\n */\r\n public get is3D(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.is3D;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n protected set is3D(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.is3D = value;\r\n }\r\n\r\n /**\r\n * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.\r\n */\r\n public get is2DArray(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.is2DArray;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n protected set is2DArray(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.is2DArray = value;\r\n }\r\n\r\n /**\r\n * Get the class name of the texture.\r\n * @returns \"ThinTexture\"\r\n */\r\n public getClassName(): string {\r\n return \"ThinTexture\";\r\n }\r\n\r\n /** @internal */\r\n public _texture: Nullable<InternalTexture> = null;\r\n\r\n protected _engine: Nullable<AbstractEngine> = null;\r\n\r\n private _cachedSize: ISize = Size.Zero();\r\n private _cachedBaseSize: ISize = Size.Zero();\r\n\r\n private static _IsRenderTargetWrapper(texture: Nullable<InternalTexture> | Nullable<RenderTargetWrapper>): texture is RenderTargetWrapper {\r\n return (texture as RenderTargetWrapper)?.shareDepth !== undefined;\r\n }\r\n\r\n /**\r\n * Instantiates a new ThinTexture.\r\n * Base class of all the textures in babylon.\r\n * This can be used as an internal texture wrapper in AbstractEngine to benefit from the cache\r\n * @param internalTexture Define the internalTexture to wrap. You can also pass a RenderTargetWrapper, in which case the texture will be the render target's texture\r\n */\r\n constructor(internalTexture: Nullable<InternalTexture | RenderTargetWrapper>) {\r\n this._texture = ThinTexture._IsRenderTargetWrapper(internalTexture) ? internalTexture.texture : internalTexture;\r\n if (this._texture) {\r\n this._engine = this._texture.getEngine();\r\n\r\n this.wrapU = this._texture._cachedWrapU ?? this.wrapU;\r\n this.wrapV = this._texture._cachedWrapV ?? this.wrapV;\r\n this.wrapR = this._texture._cachedWrapR ?? this.wrapR;\r\n }\r\n }\r\n\r\n /**\r\n * Get if the texture is ready to be used (downloaded, converted, mip mapped...).\r\n * @returns true if fully ready\r\n */\r\n public isReady(): boolean {\r\n if (this.delayLoadState === Constants.DELAYLOADSTATE_NOTLOADED) {\r\n this.delayLoad();\r\n return false;\r\n }\r\n\r\n if (this._texture) {\r\n return this._texture.isReady;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Triggers the load sequence in delayed load mode.\r\n */\r\n public delayLoad(): void {}\r\n\r\n /**\r\n * Get the underlying lower level texture from Babylon.\r\n * @returns the internal texture\r\n */\r\n public getInternalTexture(): Nullable<InternalTexture> {\r\n return this._texture;\r\n }\r\n\r\n /**\r\n * Get the size of the texture.\r\n * @returns the texture size.\r\n */\r\n public getSize(): ISize {\r\n if (this._texture) {\r\n if (this._texture.width) {\r\n this._cachedSize.width = this._texture.width;\r\n this._cachedSize.height = this._texture.height;\r\n return this._cachedSize;\r\n }\r\n\r\n if (this._texture._size) {\r\n this._cachedSize.width = this._texture._size;\r\n this._cachedSize.height = this._texture._size;\r\n return this._cachedSize;\r\n }\r\n }\r\n\r\n return this._cachedSize;\r\n }\r\n\r\n /**\r\n * Get the base size of the texture.\r\n * It can be different from the size if the texture has been resized for POT for instance\r\n * @returns the base size\r\n */\r\n public getBaseSize(): ISize {\r\n if (!this.isReady() || !this._texture) {\r\n this._cachedBaseSize.width = 0;\r\n this._cachedBaseSize.height = 0;\r\n return this._cachedBaseSize;\r\n }\r\n\r\n if (this._texture._size) {\r\n this._cachedBaseSize.width = this._texture._size;\r\n this._cachedBaseSize.height = this._texture._size;\r\n return this._cachedBaseSize;\r\n }\r\n\r\n this._cachedBaseSize.width = this._texture.baseWidth;\r\n this._cachedBaseSize.height = this._texture.baseHeight;\r\n return this._cachedBaseSize;\r\n }\r\n\r\n /** @internal */\r\n protected _initialSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * Get the current sampling mode associated with the texture.\r\n */\r\n public get samplingMode(): number {\r\n if (!this._texture) {\r\n return this._initialSamplingMode;\r\n }\r\n\r\n return this._texture.samplingMode;\r\n }\r\n\r\n /**\r\n * Update the sampling mode of the texture.\r\n * Default is Trilinear mode.\r\n *\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 1 | NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEAR | Nearest is: mag = nearest, min = nearest, mip = linear |\r\n * | 2 | BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEAREST | Bilinear is: mag = linear, min = linear, mip = nearest |\r\n * | 3 | TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEAR | Trilinear is: mag = linear, min = linear, mip = linear |\r\n * | 4 | NEAREST_NEAREST_MIPNEAREST | |\r\n * | 5 | NEAREST_LINEAR_MIPNEAREST | |\r\n * | 6 | NEAREST_LINEAR_MIPLINEAR | |\r\n * | 7 | NEAREST_LINEAR | |\r\n * | 8 | NEAREST_NEAREST | |\r\n * | 9 | LINEAR_NEAREST_MIPNEAREST | |\r\n * | 10 | LINEAR_NEAREST_MIPLINEAR | |\r\n * | 11 | LINEAR_LINEAR | |\r\n * | 12 | LINEAR_NEAREST | |\r\n *\r\n * > _mag_: magnification filter (close to the viewer)\r\n * > _min_: minification filter (far from the viewer)\r\n * > _mip_: filter used between mip map levels\r\n *@param samplingMode Define the new sampling mode of the texture\r\n */\r\n public updateSamplingMode(samplingMode: number): void {\r\n if (this._texture && this._engine) {\r\n this._engine.updateTextureSamplingMode(samplingMode, this._texture, this._texture.generateMipMaps);\r\n }\r\n }\r\n\r\n /**\r\n * Release and destroy the underlying lower level texture aka internalTexture.\r\n */\r\n public releaseInternalTexture(): void {\r\n if (this._texture) {\r\n this._texture.dispose();\r\n this._texture = null;\r\n }\r\n }\r\n\r\n /**\r\n * Dispose the texture and release its associated resources.\r\n */\r\n public dispose(): void {\r\n if (this._texture) {\r\n this.releaseInternalTexture();\r\n this._engine = null;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"thinTexture.js","sourceRoot":"","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ED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACI,kBAAkB,CAAC,YAAoB,EAAE,eAAe,GAAG,KAAK;QACnE,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAChC,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,eAAe,CAAC,CAAC;QAC1H,CAAC;IACL,CAAC;IAED;;OAEG;IACI,sBAAsB;QACzB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACzB,CAAC;IACL,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACxB,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\n\r\nimport type { ISize } from \"../../Maths/math.size\";\r\nimport { Size } from \"../../Maths/math.size\";\r\n\r\nimport type { AbstractEngine } from \"../../Engines/abstractEngine\";\r\nimport type { RenderTargetWrapper } from \"core/Engines/renderTargetWrapper\";\r\n\r\n/**\r\n * Base class of all the textures in babylon.\r\n * It groups all the common properties required to work with Thin Engine.\r\n */\r\nexport class ThinTexture {\r\n protected _wrapU = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n public get wrapU() {\r\n return this._wrapU;\r\n }\r\n\r\n public set wrapU(value: number) {\r\n this._wrapU = value;\r\n }\r\n\r\n protected _wrapV = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n public get wrapV() {\r\n return this._wrapV;\r\n }\r\n\r\n public set wrapV(value: number) {\r\n this._wrapV = value;\r\n }\r\n\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n public wrapR = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n\r\n /**\r\n * With compliant hardware and browser (supporting anisotropic filtering)\r\n * this defines the level of anisotropic filtering in the texture.\r\n * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.\r\n */\r\n public anisotropicFilteringLevel = 4;\r\n\r\n /**\r\n * Define the current state of the loading sequence when in delayed load mode.\r\n */\r\n public delayLoadState = Constants.DELAYLOADSTATE_NONE;\r\n\r\n /**\r\n * How a texture is mapped.\r\n * Unused in thin texture mode.\r\n */\r\n public get coordinatesMode(): number {\r\n return 0;\r\n }\r\n\r\n /**\r\n * Define if the texture is a cube texture or if false a 2d texture.\r\n */\r\n public get isCube(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.isCube;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n protected set isCube(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.isCube = value;\r\n }\r\n\r\n /**\r\n * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.\r\n */\r\n public get is3D(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.is3D;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n protected set is3D(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.is3D = value;\r\n }\r\n\r\n /**\r\n * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.\r\n */\r\n public get is2DArray(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.is2DArray;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n protected set is2DArray(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.is2DArray = value;\r\n }\r\n\r\n /**\r\n * Get the class name of the texture.\r\n * @returns \"ThinTexture\"\r\n */\r\n public getClassName(): string {\r\n return \"ThinTexture\";\r\n }\r\n\r\n /** @internal */\r\n public _texture: Nullable<InternalTexture> = null;\r\n\r\n protected _engine: Nullable<AbstractEngine> = null;\r\n\r\n private _cachedSize: ISize = Size.Zero();\r\n private _cachedBaseSize: ISize = Size.Zero();\r\n\r\n private static _IsRenderTargetWrapper(texture: Nullable<InternalTexture> | Nullable<RenderTargetWrapper>): texture is RenderTargetWrapper {\r\n return (texture as RenderTargetWrapper)?.shareDepth !== undefined;\r\n }\r\n\r\n /**\r\n * Instantiates a new ThinTexture.\r\n * Base class of all the textures in babylon.\r\n * This can be used as an internal texture wrapper in AbstractEngine to benefit from the cache\r\n * @param internalTexture Define the internalTexture to wrap. You can also pass a RenderTargetWrapper, in which case the texture will be the render target's texture\r\n */\r\n constructor(internalTexture: Nullable<InternalTexture | RenderTargetWrapper>) {\r\n this._texture = ThinTexture._IsRenderTargetWrapper(internalTexture) ? internalTexture.texture : internalTexture;\r\n if (this._texture) {\r\n this._engine = this._texture.getEngine();\r\n\r\n this.wrapU = this._texture._cachedWrapU ?? this.wrapU;\r\n this.wrapV = this._texture._cachedWrapV ?? this.wrapV;\r\n this.wrapR = this._texture._cachedWrapR ?? this.wrapR;\r\n }\r\n }\r\n\r\n /**\r\n * Get if the texture is ready to be used (downloaded, converted, mip mapped...).\r\n * @returns true if fully ready\r\n */\r\n public isReady(): boolean {\r\n if (this.delayLoadState === Constants.DELAYLOADSTATE_NOTLOADED) {\r\n this.delayLoad();\r\n return false;\r\n }\r\n\r\n if (this._texture) {\r\n return this._texture.isReady;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Triggers the load sequence in delayed load mode.\r\n */\r\n public delayLoad(): void {}\r\n\r\n /**\r\n * Get the underlying lower level texture from Babylon.\r\n * @returns the internal texture\r\n */\r\n public getInternalTexture(): Nullable<InternalTexture> {\r\n return this._texture;\r\n }\r\n\r\n /**\r\n * Get the size of the texture.\r\n * @returns the texture size.\r\n */\r\n public getSize(): ISize {\r\n if (this._texture) {\r\n if (this._texture.width) {\r\n this._cachedSize.width = this._texture.width;\r\n this._cachedSize.height = this._texture.height;\r\n return this._cachedSize;\r\n }\r\n\r\n if (this._texture._size) {\r\n this._cachedSize.width = this._texture._size;\r\n this._cachedSize.height = this._texture._size;\r\n return this._cachedSize;\r\n }\r\n }\r\n\r\n return this._cachedSize;\r\n }\r\n\r\n /**\r\n * Get the base size of the texture.\r\n * It can be different from the size if the texture has been resized for POT for instance\r\n * @returns the base size\r\n */\r\n public getBaseSize(): ISize {\r\n if (!this.isReady() || !this._texture) {\r\n this._cachedBaseSize.width = 0;\r\n this._cachedBaseSize.height = 0;\r\n return this._cachedBaseSize;\r\n }\r\n\r\n if (this._texture._size) {\r\n this._cachedBaseSize.width = this._texture._size;\r\n this._cachedBaseSize.height = this._texture._size;\r\n return this._cachedBaseSize;\r\n }\r\n\r\n this._cachedBaseSize.width = this._texture.baseWidth;\r\n this._cachedBaseSize.height = this._texture.baseHeight;\r\n return this._cachedBaseSize;\r\n }\r\n\r\n /** @internal */\r\n protected _initialSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * Get the current sampling mode associated with the texture.\r\n */\r\n public get samplingMode(): number {\r\n if (!this._texture) {\r\n return this._initialSamplingMode;\r\n }\r\n\r\n return this._texture.samplingMode;\r\n }\r\n\r\n /**\r\n * Update the sampling mode of the texture.\r\n * Default is Trilinear mode.\r\n *\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 1 | NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEAR | Nearest is: mag = nearest, min = nearest, mip = linear |\r\n * | 2 | BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEAREST | Bilinear is: mag = linear, min = linear, mip = nearest |\r\n * | 3 | TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEAR | Trilinear is: mag = linear, min = linear, mip = linear |\r\n * | 4 | NEAREST_NEAREST_MIPNEAREST | |\r\n * | 5 | NEAREST_LINEAR_MIPNEAREST | |\r\n * | 6 | NEAREST_LINEAR_MIPLINEAR | |\r\n * | 7 | NEAREST_LINEAR | |\r\n * | 8 | NEAREST_NEAREST | |\r\n * | 9 | LINEAR_NEAREST_MIPNEAREST | |\r\n * | 10 | LINEAR_NEAREST_MIPLINEAR | |\r\n * | 11 | LINEAR_LINEAR | |\r\n * | 12 | LINEAR_NEAREST | |\r\n *\r\n * > _mag_: magnification filter (close to the viewer)\r\n * > _min_: minification filter (far from the viewer)\r\n * > _mip_: filter used between mip map levels\r\n *@param samplingMode Define the new sampling mode of the texture\r\n *@param generateMipMaps Define if the texture should generate mip maps or not. Default is false.\r\n */\r\n public updateSamplingMode(samplingMode: number, generateMipMaps = false): void {\r\n if (this._texture && this._engine) {\r\n this._engine.updateTextureSamplingMode(samplingMode, this._texture, this._texture.generateMipMaps && generateMipMaps);\r\n }\r\n }\r\n\r\n /**\r\n * Release and destroy the underlying lower level texture aka internalTexture.\r\n */\r\n public releaseInternalTexture(): void {\r\n if (this._texture) {\r\n this._texture.dispose();\r\n this._texture = null;\r\n }\r\n }\r\n\r\n /**\r\n * Dispose the texture and release its associated resources.\r\n */\r\n public dispose(): void {\r\n if (this._texture) {\r\n this.releaseInternalTexture();\r\n this._engine = null;\r\n }\r\n }\r\n}\r\n"]}
|
package/Meshes/transformNode.js
CHANGED
|
@@ -1015,7 +1015,8 @@ export class TransformNode extends Node {
|
|
|
1015
1015
|
this._worldMatrix.getTranslationToRef(storedTranslation); // Save translation
|
|
1016
1016
|
// Get camera view matrix
|
|
1017
1017
|
TmpVectors.Matrix[1].copyFrom(camera.getViewMatrix());
|
|
1018
|
-
|
|
1018
|
+
const isRH = this.getScene().useRightHandedSystem;
|
|
1019
|
+
if (isRH) {
|
|
1019
1020
|
// This operation is necessary to cancel out the scaling component of the matrix without decomposing it.
|
|
1020
1021
|
// It's a trick to extract only the rotation part.
|
|
1021
1022
|
TmpVectors.Matrix[1].multiplyToRef(TransformNode._TmpRHRestore, TmpVectors.Matrix[1]);
|
|
@@ -1036,6 +1037,9 @@ export class TransformNode extends Node {
|
|
|
1036
1037
|
if ((this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z) {
|
|
1037
1038
|
eulerAngles.z = 0;
|
|
1038
1039
|
}
|
|
1040
|
+
if (isRH) {
|
|
1041
|
+
eulerAngles.y += Math.PI; // Yaw correction
|
|
1042
|
+
}
|
|
1039
1043
|
Matrix.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, TmpVectors.Matrix[0]);
|
|
1040
1044
|
}
|
|
1041
1045
|
this._worldMatrix.setTranslationFromFloats(0, 0, 0);
|