Skip to content

Commit

Permalink
Merge pull request BabylonJS#10810 from sebavan/master
Browse files Browse the repository at this point in the history
Nightly
  • Loading branch information
sebavan authored Aug 4, 2021
2 parents 2e0fe74 + 1c76381 commit 5d7710a
Show file tree
Hide file tree
Showing 65 changed files with 1,693 additions and 1,603 deletions.
12 changes: 10 additions & 2 deletions dist/preview release/babylon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29931,6 +29931,8 @@ declare module BABYLON {
* @see https://doc.babylonjs.com/how_to/how_to_use_morphtargets
*/
export class MorphTargetManager implements IDisposable {
/** Enable storing morph target data into textures when set to true (true by default) */
static EnableTextureStorage: boolean;
private _targets;
private _targetInfluenceChangedObservers;
private _targetDataLayoutChangedObservers;
Expand All @@ -29948,6 +29950,7 @@ declare module BABYLON {
private _uniqueId;
private _tempInfluences;
private _canUseTextureForTargets;
private _blockCounter;
/** @hidden */
_parentContainer: Nullable<AbstractScene>;
/** @hidden */
Expand All @@ -29968,6 +29971,11 @@ declare module BABYLON {
* Gets or sets a boolean indicating if UV must be morphed
*/
enableUVMorphing: boolean;
/**
* Sets a boolean indicating that adding new target will or will not update the underlying data buffers
*/
set areUpdatesFrozen(block: boolean);
get areUpdatesFrozen(): boolean;
/**
* Creates a new MorphTargetManager
* @param scene defines the current scene
Expand Down Expand Up @@ -77021,11 +77029,11 @@ declare module BABYLON {
* This member defines the tile cube side length in world units.
* If no obstacles are needed, leave it undefined or 0.
*/
tileSize: number;
tileSize?: number;
/**
* The size of the non-navigable border around the heightfield.
*/
borderSize: number;
borderSize?: number;
}
}
declare module BABYLON {
Expand Down
2 changes: 1 addition & 1 deletion dist/preview release/babylon.js

Large diffs are not rendered by default.

42 changes: 39 additions & 3 deletions dist/preview release/babylon.max.js
Original file line number Diff line number Diff line change
Expand Up @@ -149749,7 +149749,14 @@ var LinesMesh = /** @class */ (function (_super) {
* @returns a new InstancedLinesMesh
*/
LinesMesh.prototype.createInstance = function (name) {
return new InstancedLinesMesh(name, this);
var instance = new InstancedLinesMesh(name, this);
if (this.instancedBuffers) {
instance.instancedBuffers = {};
for (var key in this.instancedBuffers) {
instance.instancedBuffers[key] = this.instancedBuffers[key];
}
}
return instance;
};
/**
* Serializes this ground mesh
Expand Down Expand Up @@ -152910,6 +152917,7 @@ var Mesh = /** @class */ (function (_super) {
instancesCount: this._thinInstanceDataStorage.instancesCount,
matrixData: _Misc_tools__WEBPACK_IMPORTED_MODULE_2__["Tools"].SliceToArray(this._thinInstanceDataStorage.matrixData),
matrixBufferSize: this._thinInstanceDataStorage.matrixBufferSize,
enablePicking: this.thinInstanceEnablePicking,
};
if (this._userThinInstanceBuffersStorage) {
var userThinInstance = {
Expand Down Expand Up @@ -153260,6 +153268,7 @@ var Mesh = /** @class */ (function (_super) {
// Thin instances
if (parsedMesh.thinInstances) {
var thinInstances = parsedMesh.thinInstances;
mesh.thinInstanceEnablePicking = !!thinInstances.enablePicking;
if (thinInstances.matrixData) {
mesh.thinInstanceSetBuffer("matrix", new Float32Array(thinInstances.matrixData), 16, false);
mesh._thinInstanceDataStorage.matrixBufferSize = thinInstances.matrixBufferSize;
Expand Down Expand Up @@ -175992,6 +176001,7 @@ var MorphTargetManager = /** @class */ (function () {
this._uniqueId = 0;
this._tempInfluences = new Array();
this._canUseTextureForTargets = false;
this._blockCounter = 0;
/** @hidden */
this._parentContainer = null;
/**
Expand Down Expand Up @@ -176022,6 +176032,28 @@ var MorphTargetManager = /** @class */ (function () {
this._canUseTextureForTargets = engineCaps.canUseGLVertexID && engineCaps.textureFloat && engineCaps.maxVertexTextureImageUnits > 0;
}
}
Object.defineProperty(MorphTargetManager.prototype, "areUpdatesFrozen", {
get: function () {
return this._blockCounter > 0;
},
/**
* Sets a boolean indicating that adding new target will or will not update the underlying data buffers
*/
set: function (block) {
if (block) {
this._blockCounter++;
}
else {
this._blockCounter--;
if (this._blockCounter <= 0) {
this._blockCounter = 0;
this._syncActiveTargets(true);
}
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MorphTargetManager.prototype, "uniqueId", {
/**
* Gets the unique ID of this manager
Expand Down Expand Up @@ -176121,7 +176153,7 @@ var MorphTargetManager = /** @class */ (function () {
* Gets a boolean indicating that the targets are stored into a texture (instead of as attributes)
*/
get: function () {
return this.useTextureToStoreTargets && this._canUseTextureForTargets;
return MorphTargetManager.EnableTextureStorage && this.useTextureToStoreTargets && this._canUseTextureForTargets;
},
enumerable: false,
configurable: true
Expand Down Expand Up @@ -176155,7 +176187,9 @@ var MorphTargetManager = /** @class */ (function () {
this._targetDataLayoutChangedObservers.push(target._onDataLayoutChanged.add(function () {
_this._syncActiveTargets(true);
}));
this._syncActiveTargets(true);
if (!this.areUpdatesFrozen) {
this._syncActiveTargets(true);
}
};
/**
* Removes a target from the manager
Expand Down Expand Up @@ -176375,6 +176409,8 @@ var MorphTargetManager = /** @class */ (function () {
}
return result;
};
/** Enable storing morph target data into textures when set to true (true by default) */
MorphTargetManager.EnableTextureStorage = true;
return MorphTargetManager;
}());

Expand Down
2 changes: 1 addition & 1 deletion dist/preview release/babylon.max.js.map

Large diffs are not rendered by default.

24 changes: 20 additions & 4 deletions dist/preview release/babylon.module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31070,6 +31070,8 @@ declare module "babylonjs/Morph/morphTargetManager" {
* @see https://doc.babylonjs.com/how_to/how_to_use_morphtargets
*/
export class MorphTargetManager implements IDisposable {
/** Enable storing morph target data into textures when set to true (true by default) */
static EnableTextureStorage: boolean;
private _targets;
private _targetInfluenceChangedObservers;
private _targetDataLayoutChangedObservers;
Expand All @@ -31087,6 +31089,7 @@ declare module "babylonjs/Morph/morphTargetManager" {
private _uniqueId;
private _tempInfluences;
private _canUseTextureForTargets;
private _blockCounter;
/** @hidden */
_parentContainer: Nullable<AbstractScene>;
/** @hidden */
Expand All @@ -31107,6 +31110,11 @@ declare module "babylonjs/Morph/morphTargetManager" {
* Gets or sets a boolean indicating if UV must be morphed
*/
enableUVMorphing: boolean;
/**
* Sets a boolean indicating that adding new target will or will not update the underlying data buffers
*/
set areUpdatesFrozen(block: boolean);
get areUpdatesFrozen(): boolean;
/**
* Creates a new MorphTargetManager
* @param scene defines the current scene
Expand Down Expand Up @@ -81088,11 +81096,11 @@ declare module "babylonjs/Navigation/INavigationEngine" {
* This member defines the tile cube side length in world units.
* If no obstacles are needed, leave it undefined or 0.
*/
tileSize: number;
tileSize?: number;
/**
* The size of the non-navigable border around the heightfield.
*/
borderSize: number;
borderSize?: number;
}
}
declare module "babylonjs/Navigation/Plugins/recastJSPlugin" {
Expand Down Expand Up @@ -121439,6 +121447,8 @@ declare module BABYLON {
* @see https://doc.babylonjs.com/how_to/how_to_use_morphtargets
*/
export class MorphTargetManager implements IDisposable {
/** Enable storing morph target data into textures when set to true (true by default) */
static EnableTextureStorage: boolean;
private _targets;
private _targetInfluenceChangedObservers;
private _targetDataLayoutChangedObservers;
Expand All @@ -121456,6 +121466,7 @@ declare module BABYLON {
private _uniqueId;
private _tempInfluences;
private _canUseTextureForTargets;
private _blockCounter;
/** @hidden */
_parentContainer: Nullable<AbstractScene>;
/** @hidden */
Expand All @@ -121476,6 +121487,11 @@ declare module BABYLON {
* Gets or sets a boolean indicating if UV must be morphed
*/
enableUVMorphing: boolean;
/**
* Sets a boolean indicating that adding new target will or will not update the underlying data buffers
*/
set areUpdatesFrozen(block: boolean);
get areUpdatesFrozen(): boolean;
/**
* Creates a new MorphTargetManager
* @param scene defines the current scene
Expand Down Expand Up @@ -168529,11 +168545,11 @@ declare module BABYLON {
* This member defines the tile cube side length in world units.
* If no obstacles are needed, leave it undefined or 0.
*/
tileSize: number;
tileSize?: number;
/**
* The size of the non-navigable border around the heightfield.
*/
borderSize: number;
borderSize?: number;
}
}
declare module BABYLON {
Expand Down
12 changes: 10 additions & 2 deletions dist/preview release/documentation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29931,6 +29931,8 @@ declare module BABYLON {
* @see https://doc.babylonjs.com/how_to/how_to_use_morphtargets
*/
export class MorphTargetManager implements IDisposable {
/** Enable storing morph target data into textures when set to true (true by default) */
static EnableTextureStorage: boolean;
private _targets;
private _targetInfluenceChangedObservers;
private _targetDataLayoutChangedObservers;
Expand All @@ -29948,6 +29950,7 @@ declare module BABYLON {
private _uniqueId;
private _tempInfluences;
private _canUseTextureForTargets;
private _blockCounter;
/** @hidden */
_parentContainer: Nullable<AbstractScene>;
/** @hidden */
Expand All @@ -29968,6 +29971,11 @@ declare module BABYLON {
* Gets or sets a boolean indicating if UV must be morphed
*/
enableUVMorphing: boolean;
/**
* Sets a boolean indicating that adding new target will or will not update the underlying data buffers
*/
set areUpdatesFrozen(block: boolean);
get areUpdatesFrozen(): boolean;
/**
* Creates a new MorphTargetManager
* @param scene defines the current scene
Expand Down Expand Up @@ -77021,11 +77029,11 @@ declare module BABYLON {
* This member defines the tile cube side length in world units.
* If no obstacles are needed, leave it undefined or 0.
*/
tileSize: number;
tileSize?: number;
/**
* The size of the non-navigable border around the heightfield.
*/
borderSize: number;
borderSize?: number;
}
}
declare module BABYLON {
Expand Down
Loading

0 comments on commit 5d7710a

Please sign in to comment.