|
@@ -19559,10 +19559,6 @@ var BABYLON;
|
|
|
* Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
|
|
|
*/
|
|
|
_this.isPickable = true;
|
|
|
- /**
|
|
|
- * Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
|
|
|
- */
|
|
|
- _this.showBoundingBox = false;
|
|
|
/** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */
|
|
|
_this.showSubMeshesBoundingBox = false;
|
|
|
/** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
|
|
@@ -73542,6 +73538,11 @@ var BABYLON;
|
|
|
get: function () {
|
|
|
if (!this._gamepadManager) {
|
|
|
this._gamepadManager = new BABYLON.GamepadManager(this);
|
|
|
+ var component = this._getComponent(BABYLON.SceneComponentConstants.NAME_GAMEPAD);
|
|
|
+ if (!component) {
|
|
|
+ component = new GamepadSystemSceneComponent(this);
|
|
|
+ this._addComponent(component);
|
|
|
+ }
|
|
|
}
|
|
|
return this._gamepadManager;
|
|
|
},
|
|
@@ -88192,7 +88193,7 @@ var BABYLON;
|
|
|
var header = new Int32Array(arrayBuffer, 0, headerLengthInt);
|
|
|
var fourCC, width, height, dataLength = 0, dataOffset;
|
|
|
var byteArray, mipmapCount, mip;
|
|
|
- var internalFormat = 0;
|
|
|
+ var internalCompressedFormat = 0;
|
|
|
var blockBytes = 1;
|
|
|
if (header[off_magic] !== DDS_MAGIC) {
|
|
|
BABYLON.Tools.Error("Invalid magic number in DDS header");
|
|
@@ -88214,15 +88215,15 @@ var BABYLON;
|
|
|
switch (fourCC) {
|
|
|
case FOURCC_DXT1:
|
|
|
blockBytes = 8;
|
|
|
- internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
|
|
|
+ internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
|
|
|
break;
|
|
|
case FOURCC_DXT3:
|
|
|
blockBytes = 16;
|
|
|
- internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
|
|
|
+ internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
|
|
|
break;
|
|
|
case FOURCC_DXT5:
|
|
|
blockBytes = 16;
|
|
|
- internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
|
|
|
+ internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
|
|
|
break;
|
|
|
case FOURCC_D3DFMT_R16G16B16A16F:
|
|
|
computeFormats = true;
|
|
@@ -88259,7 +88260,7 @@ var BABYLON;
|
|
|
var bOffset = DDSTools._ExtractLongWordOrder(header[off_BMask]);
|
|
|
var aOffset = DDSTools._ExtractLongWordOrder(header[off_AMask]);
|
|
|
if (computeFormats) {
|
|
|
- internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
|
|
|
+ internalCompressedFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
|
|
|
}
|
|
|
mipmapCount = 1;
|
|
|
if (header[off_flags] & DDSD_MIPMAPCOUNT && loadMipmaps !== false) {
|
|
@@ -88272,8 +88273,8 @@ var BABYLON;
|
|
|
if (lodIndex === -1 || lodIndex === mip) {
|
|
|
// In case of fixed LOD, if the lod has just been uploaded, early exit.
|
|
|
var i = (lodIndex === -1) ? mip : 0;
|
|
|
- texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
|
|
|
if (!info.isCompressed && info.isFourCC) {
|
|
|
+ texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
|
|
|
dataLength = width * height * 4;
|
|
|
var floatArray = null;
|
|
|
if (engine._badOS || engine._badDesktopOS || (!engine.getCaps().textureHalfFloat && !engine.getCaps().textureFloat)) { // Required because iOS has many issues with float and half float generation
|
|
@@ -88289,25 +88290,25 @@ var BABYLON;
|
|
|
sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
|
|
|
}
|
|
|
}
|
|
|
- info.textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
|
|
|
- internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
|
|
|
+ texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
|
|
|
}
|
|
|
else {
|
|
|
if (bpp === 128) {
|
|
|
+ texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
|
|
|
floatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
|
|
|
if (sphericalPolynomialFaces && i == 0) {
|
|
|
sphericalPolynomialFaces.push(floatArray);
|
|
|
}
|
|
|
}
|
|
|
else if (bpp === 64 && !engine.getCaps().textureHalfFloat) {
|
|
|
+ texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
|
|
|
floatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
|
|
|
if (sphericalPolynomialFaces && i == 0) {
|
|
|
sphericalPolynomialFaces.push(floatArray);
|
|
|
}
|
|
|
- info.textureType = BABYLON.Engine.TEXTURETYPE_FLOAT;
|
|
|
- internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
|
|
|
}
|
|
|
else { // 64
|
|
|
+ texture.type = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
|
|
|
floatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
|
|
|
if (sphericalPolynomialFaces && i == 0) {
|
|
|
sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
|
|
@@ -88315,18 +88316,19 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
if (floatArray) {
|
|
|
- texture.type = info.textureType;
|
|
|
engine._uploadDataToTextureDirectly(texture, width, height, floatArray, face, i);
|
|
|
}
|
|
|
}
|
|
|
else if (info.isRGB) {
|
|
|
- texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
|
|
|
+ texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
|
|
|
if (bpp === 24) {
|
|
|
+ texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
|
|
|
dataLength = width * height * 3;
|
|
|
byteArray = DDSTools._GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset);
|
|
|
engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
|
|
|
}
|
|
|
else { // 32
|
|
|
+ texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
|
|
|
dataLength = width * height * 4;
|
|
|
byteArray = DDSTools._GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset, aOffset);
|
|
|
engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
|
|
@@ -88345,7 +88347,8 @@ var BABYLON;
|
|
|
else {
|
|
|
dataLength = Math.max(4, width) / 4 * Math.max(4, height) / 4 * blockBytes;
|
|
|
byteArray = new Uint8Array(arrayBuffer, dataOffset, dataLength);
|
|
|
- engine._uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, byteArray, face, i);
|
|
|
+ texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
|
|
|
+ engine._uploadCompressedDataToTextureDirectly(texture, internalCompressedFormat, width, height, byteArray, face, i);
|
|
|
}
|
|
|
}
|
|
|
dataOffset += bpp ? (width * height * (bpp / 8)) : dataLength;
|
|
@@ -89224,6 +89227,20 @@ var BABYLON;
|
|
|
}
|
|
|
return this._boundingBoxRenderer;
|
|
|
};
|
|
|
+ Object.defineProperty(BABYLON.AbstractMesh.prototype, "showBoundingBox", {
|
|
|
+ get: function () {
|
|
|
+ return this._showBoundingBox || false;
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ this._showBoundingBox = value;
|
|
|
+ // Lazyly creates a BB renderer if needed.
|
|
|
+ if (value) {
|
|
|
+ this.getScene().getBoundingBoxRenderer();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
var BoundingBoxRenderer = /** @class */ (function () {
|
|
|
function BoundingBoxRenderer(scene) {
|
|
|
/**
|