@galacean/engine 2.0.0-alpha.14 → 2.0.0-alpha.15
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/dist/browser.js +1250 -1026
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/bundled.module.js +1249 -1027
- package/dist/bundled.module.js.map +1 -1
- package/dist/bundled.module.min.js +1 -1
- package/dist/bundled.module.min.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/module.js +1 -1
- package/package.json +5 -5
package/dist/bundled.module.js
CHANGED
|
@@ -982,11 +982,15 @@ BoundingBox._tempVec31 = new Vector3();
|
|
|
982
982
|
var normal = plane.normal;
|
|
983
983
|
var zeroTolerance = MathUtil.zeroTolerance;
|
|
984
984
|
var dir = Vector3.dot(normal, ray.direction);
|
|
985
|
+
var position = Vector3.dot(normal, ray.origin);
|
|
985
986
|
// Parallel
|
|
986
987
|
if (Math.abs(dir) < zeroTolerance) {
|
|
988
|
+
// Check if ray origin is on the plane
|
|
989
|
+
if (Math.abs(position + plane.distance) < zeroTolerance) {
|
|
990
|
+
return 0;
|
|
991
|
+
}
|
|
987
992
|
return -1;
|
|
988
993
|
}
|
|
989
|
-
var position = Vector3.dot(normal, ray.origin);
|
|
990
994
|
var distance = (-plane.distance - position) / dir;
|
|
991
995
|
if (distance < 0) {
|
|
992
996
|
if (distance < -zeroTolerance) {
|
|
@@ -27090,279 +27094,978 @@ PrimitiveMesh._sphereSeedCells = new Float32Array([
|
|
|
27090
27094
|
]);
|
|
27091
27095
|
PrimitiveMesh._sphereEdgeIdx = 0;
|
|
27092
27096
|
PrimitiveMesh._spherePoleIdx = 0;
|
|
27093
|
-
|
|
27094
|
-
|
|
27095
|
-
|
|
27096
|
-
|
|
27097
|
-
|
|
27098
|
-
|
|
27099
|
-
|
|
27100
|
-
|
|
27101
|
-
|
|
27102
|
-
}
|
|
27103
|
-
|
|
27104
|
-
|
|
27105
|
-
|
|
27106
|
-
|
|
27107
|
-
|
|
27108
|
-
|
|
27109
|
-
|
|
27110
|
-
|
|
27111
|
-
|
|
27112
|
-
|
|
27113
|
-
|
|
27114
|
-
|
|
27115
|
-
|
|
27116
|
-
|
|
27117
|
-
|
|
27118
|
-
return instance;
|
|
27119
|
-
};
|
|
27120
|
-
}
|
|
27121
|
-
return _construct$1.apply(null, arguments);
|
|
27122
|
-
}
|
|
27123
|
-
var ComponentCloner = /*#__PURE__*/ function() {
|
|
27124
|
-
function ComponentCloner() {}
|
|
27125
|
-
/**
|
|
27126
|
-
* Clone component.
|
|
27127
|
-
* @param source - Clone source
|
|
27128
|
-
* @param target - Clone target
|
|
27129
|
-
*/ ComponentCloner.cloneComponent = function cloneComponent(source, target, srcRoot, targetRoot, deepInstanceMap) {
|
|
27130
|
-
var cloneModes = CloneManager.getCloneMode(source.constructor);
|
|
27131
|
-
for(var k in source){
|
|
27132
|
-
CloneManager.cloneProperty(source, target, k, cloneModes[k], srcRoot, targetRoot, deepInstanceMap);
|
|
27097
|
+
/**
|
|
27098
|
+
* @internal
|
|
27099
|
+
* Utility functions for remapping Entity/Component references during cloning.
|
|
27100
|
+
*/ var CloneUtils = /*#__PURE__*/ function() {
|
|
27101
|
+
function CloneUtils() {}
|
|
27102
|
+
CloneUtils.remapEntity = function remapEntity(srcRoot, targetRoot, entity) {
|
|
27103
|
+
var paths = CloneUtils._tempRemapPath;
|
|
27104
|
+
var success = CloneUtils._getEntityHierarchyPath(srcRoot, entity, paths);
|
|
27105
|
+
return success ? CloneUtils._getEntityByHierarchyPath(targetRoot, paths) : entity;
|
|
27106
|
+
};
|
|
27107
|
+
CloneUtils.remapComponent = function remapComponent(srcRoot, targetRoot, component) {
|
|
27108
|
+
var _CloneUtils__getEntityByHierarchyPath;
|
|
27109
|
+
var paths = CloneUtils._tempRemapPath;
|
|
27110
|
+
var success = CloneUtils._getEntityHierarchyPath(srcRoot, component.entity, paths);
|
|
27111
|
+
return success ? (_CloneUtils__getEntityByHierarchyPath = CloneUtils._getEntityByHierarchyPath(targetRoot, paths)) == null ? void 0 : _CloneUtils__getEntityByHierarchyPath.getComponent(component.constructor) : component;
|
|
27112
|
+
};
|
|
27113
|
+
CloneUtils._getEntityHierarchyPath = function _getEntityHierarchyPath(rootEntity, searchEntity, inversePath) {
|
|
27114
|
+
inversePath.length = 0;
|
|
27115
|
+
while(searchEntity !== rootEntity){
|
|
27116
|
+
var parent = searchEntity.parent;
|
|
27117
|
+
if (!parent) {
|
|
27118
|
+
return false;
|
|
27119
|
+
}
|
|
27120
|
+
inversePath.push(searchEntity.siblingIndex);
|
|
27121
|
+
searchEntity = parent;
|
|
27133
27122
|
}
|
|
27134
|
-
|
|
27135
|
-
|
|
27123
|
+
return true;
|
|
27124
|
+
};
|
|
27125
|
+
CloneUtils._getEntityByHierarchyPath = function _getEntityByHierarchyPath(rootEntity, inversePath) {
|
|
27126
|
+
var entity = rootEntity;
|
|
27127
|
+
for(var i = inversePath.length - 1; i >= 0; i--){
|
|
27128
|
+
entity = entity.children[inversePath[i]];
|
|
27136
27129
|
}
|
|
27130
|
+
return entity;
|
|
27137
27131
|
};
|
|
27138
|
-
return
|
|
27132
|
+
return CloneUtils;
|
|
27139
27133
|
}();
|
|
27134
|
+
CloneUtils._tempRemapPath = [];
|
|
27140
27135
|
/**
|
|
27141
|
-
*
|
|
27142
|
-
*/ var
|
|
27143
|
-
|
|
27144
|
-
|
|
27145
|
-
return EntityModifyFlags;
|
|
27146
|
-
}({});
|
|
27147
|
-
/**
|
|
27148
|
-
* Entity, be used as components container.
|
|
27149
|
-
*/ var Entity = /*#__PURE__*/ function(EngineObject) {
|
|
27150
|
-
_inherits$2(Entity, EngineObject);
|
|
27151
|
-
function Entity(engine, name) {
|
|
27152
|
-
for(var _len = arguments.length, components = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
27153
|
-
components[_key - 2] = arguments[_key];
|
|
27154
|
-
}
|
|
27136
|
+
* Skin used for skinned mesh renderer.
|
|
27137
|
+
*/ var Skin = /*#__PURE__*/ function(EngineObject) {
|
|
27138
|
+
_inherits$2(Skin, EngineObject);
|
|
27139
|
+
function Skin(name) {
|
|
27155
27140
|
var _this;
|
|
27156
|
-
_this = EngineObject.call(this,
|
|
27157
|
-
_this.name = name != null ? name : "Entity";
|
|
27158
|
-
for(var i = 0, n = components.length; i < n; i++){
|
|
27159
|
-
_this.addComponent(components[i]);
|
|
27160
|
-
}
|
|
27161
|
-
!_this._transform && _this.addComponent(Transform);
|
|
27162
|
-
_this._inverseWorldMatFlag = _this.registerWorldChangeFlag();
|
|
27141
|
+
_this = EngineObject.call(this, null) || this, _this.name = name, _this.inverseBindMatrices = new Array(), _this._updatedManager = new UpdateFlagManager(), _this._bones = new Array(), _this._updateMark = -1, _this.joints = [];
|
|
27163
27142
|
return _this;
|
|
27164
27143
|
}
|
|
27165
|
-
var _proto =
|
|
27144
|
+
var _proto = Skin.prototype;
|
|
27166
27145
|
/**
|
|
27167
|
-
*
|
|
27168
|
-
|
|
27169
|
-
|
|
27170
|
-
|
|
27171
|
-
*/ _proto.addComponent = function addComponent(type) {
|
|
27172
|
-
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
27173
|
-
args[_key - 1] = arguments[_key];
|
|
27146
|
+
* @internal
|
|
27147
|
+
*/ _proto._updateSkinMatrices = function _updateSkinMatrices(renderer) {
|
|
27148
|
+
if (this._updateMark === renderer.engine.time.frameCount) {
|
|
27149
|
+
return;
|
|
27174
27150
|
}
|
|
27175
|
-
|
|
27176
|
-
var
|
|
27177
|
-
|
|
27178
|
-
|
|
27179
|
-
|
|
27180
|
-
|
|
27181
|
-
|
|
27182
|
-
|
|
27183
|
-
|
|
27184
|
-
|
|
27185
|
-
/**
|
|
27186
|
-
* Get component which match the type.
|
|
27187
|
-
* @param type - The type of the component
|
|
27188
|
-
* @returns The first component which match type
|
|
27189
|
-
*/ _proto.getComponent = function getComponent(type) {
|
|
27190
|
-
var components = this._components;
|
|
27191
|
-
for(var i = 0, n = components.length; i < n; i++){
|
|
27192
|
-
var component = components[i];
|
|
27193
|
-
if (_instanceof1$2(component, type)) {
|
|
27194
|
-
return component;
|
|
27151
|
+
var _this = this, bones = _this.bones, bindMatrices = _this.inverseBindMatrices, skinMatrices = _this._skinMatrices;
|
|
27152
|
+
var _this_rootBone;
|
|
27153
|
+
var worldToLocal = ((_this_rootBone = this.rootBone) != null ? _this_rootBone : renderer.entity).getInvModelMatrix();
|
|
27154
|
+
for(var i = bones.length - 1; i >= 0; i--){
|
|
27155
|
+
var bone = bones[i];
|
|
27156
|
+
var offset = i * 16;
|
|
27157
|
+
if (bone) {
|
|
27158
|
+
Utils._floatMatrixMultiply(bone.transform.worldMatrix, bindMatrices[i].elements, 0, skinMatrices, offset);
|
|
27159
|
+
} else {
|
|
27160
|
+
skinMatrices.set(bindMatrices[i].elements, offset);
|
|
27195
27161
|
}
|
|
27162
|
+
Utils._floatMatrixMultiply(worldToLocal, skinMatrices, offset, skinMatrices, offset);
|
|
27196
27163
|
}
|
|
27197
|
-
|
|
27164
|
+
this._updateMark = renderer.engine.time.frameCount;
|
|
27198
27165
|
};
|
|
27199
27166
|
/**
|
|
27200
|
-
*
|
|
27201
|
-
|
|
27202
|
-
|
|
27203
|
-
|
|
27204
|
-
|
|
27205
|
-
|
|
27206
|
-
|
|
27207
|
-
|
|
27208
|
-
|
|
27209
|
-
|
|
27210
|
-
|
|
27167
|
+
* @internal
|
|
27168
|
+
*/ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
|
|
27169
|
+
// Clone rootBone
|
|
27170
|
+
var rootBone = this.rootBone;
|
|
27171
|
+
if (rootBone) {
|
|
27172
|
+
target.rootBone = CloneUtils.remapEntity(srcRoot, targetRoot, rootBone);
|
|
27173
|
+
}
|
|
27174
|
+
// Clone bones
|
|
27175
|
+
var bones = this.bones;
|
|
27176
|
+
if (bones.length > 0) {
|
|
27177
|
+
var boneCount = bones.length;
|
|
27178
|
+
var destBones = new Array(boneCount);
|
|
27179
|
+
for(var i = 0; i < boneCount; i++){
|
|
27180
|
+
destBones[i] = CloneUtils.remapEntity(srcRoot, targetRoot, bones[i]);
|
|
27211
27181
|
}
|
|
27182
|
+
target.bones = destBones;
|
|
27212
27183
|
}
|
|
27213
|
-
return results;
|
|
27214
|
-
};
|
|
27215
|
-
/**
|
|
27216
|
-
* Get the components which match the type of the entity and it's children.
|
|
27217
|
-
* @param type - The component type
|
|
27218
|
-
* @param results - The components collection
|
|
27219
|
-
* @returns The components collection which match the type
|
|
27220
|
-
*/ _proto.getComponentsIncludeChildren = function getComponentsIncludeChildren(type, results) {
|
|
27221
|
-
results.length = 0;
|
|
27222
|
-
this._getComponentsInChildren(type, results);
|
|
27223
|
-
return results;
|
|
27224
27184
|
};
|
|
27225
|
-
|
|
27226
|
-
|
|
27227
|
-
|
|
27228
|
-
|
|
27229
|
-
|
|
27230
|
-
|
|
27231
|
-
|
|
27185
|
+
_create_class$2(Skin, [
|
|
27186
|
+
{
|
|
27187
|
+
key: "rootBone",
|
|
27188
|
+
get: /**
|
|
27189
|
+
* Root bone.
|
|
27190
|
+
*/ function get() {
|
|
27191
|
+
return this._rootBone;
|
|
27192
|
+
},
|
|
27193
|
+
set: function set(value) {
|
|
27194
|
+
if (this._rootBone !== value) {
|
|
27195
|
+
this._updatedManager.dispatch(1, value);
|
|
27196
|
+
this._rootBone = value;
|
|
27197
|
+
}
|
|
27198
|
+
}
|
|
27199
|
+
},
|
|
27200
|
+
{
|
|
27201
|
+
key: "bones",
|
|
27202
|
+
get: /**
|
|
27203
|
+
* Bones of the skin.
|
|
27204
|
+
*/ function get() {
|
|
27205
|
+
return this._bones;
|
|
27206
|
+
},
|
|
27207
|
+
set: function set(value) {
|
|
27208
|
+
var bones = this._bones;
|
|
27209
|
+
var _value_length;
|
|
27210
|
+
var boneCount = (_value_length = value == null ? void 0 : value.length) != null ? _value_length : 0;
|
|
27211
|
+
var lastBoneCount = bones.length;
|
|
27212
|
+
bones.length = boneCount;
|
|
27213
|
+
for(var i = 0; i < boneCount; i++){
|
|
27214
|
+
bones[i] = value[i];
|
|
27215
|
+
}
|
|
27216
|
+
if (lastBoneCount !== boneCount) {
|
|
27217
|
+
this._skinMatrices = new Float32Array(boneCount * 16);
|
|
27218
|
+
this._updatedManager.dispatch(0, boneCount);
|
|
27219
|
+
}
|
|
27220
|
+
}
|
|
27221
|
+
},
|
|
27222
|
+
{
|
|
27223
|
+
key: "skeleton",
|
|
27224
|
+
get: /** @deprecated Please use `rootBone` instead. */ function get() {
|
|
27225
|
+
var _this_rootBone;
|
|
27226
|
+
return (_this_rootBone = this.rootBone) == null ? void 0 : _this_rootBone.name;
|
|
27227
|
+
},
|
|
27228
|
+
set: function set(value) {
|
|
27229
|
+
var rootBone = this._rootBone;
|
|
27230
|
+
if (rootBone) {
|
|
27231
|
+
rootBone.name = value;
|
|
27232
|
+
}
|
|
27233
|
+
}
|
|
27232
27234
|
}
|
|
27233
|
-
|
|
27234
|
-
|
|
27235
|
+
]);
|
|
27236
|
+
return Skin;
|
|
27237
|
+
}(EngineObject);
|
|
27238
|
+
__decorate$1([
|
|
27239
|
+
deepClone
|
|
27240
|
+
], Skin.prototype, "inverseBindMatrices", void 0);
|
|
27241
|
+
__decorate$1([
|
|
27242
|
+
ignoreClone
|
|
27243
|
+
], Skin.prototype, "_skinMatrices", void 0);
|
|
27244
|
+
__decorate$1([
|
|
27245
|
+
ignoreClone
|
|
27246
|
+
], Skin.prototype, "_updatedManager", void 0);
|
|
27247
|
+
__decorate$1([
|
|
27248
|
+
ignoreClone
|
|
27249
|
+
], Skin.prototype, "_rootBone", void 0);
|
|
27250
|
+
__decorate$1([
|
|
27251
|
+
ignoreClone
|
|
27252
|
+
], Skin.prototype, "_bones", void 0);
|
|
27253
|
+
__decorate$1([
|
|
27254
|
+
ignoreClone
|
|
27255
|
+
], Skin.prototype, "_updateMark", void 0);
|
|
27256
|
+
var SkinUpdateFlag = /*#__PURE__*/ function(SkinUpdateFlag) {
|
|
27257
|
+
SkinUpdateFlag[SkinUpdateFlag["BoneCountChanged"] = 0] = "BoneCountChanged";
|
|
27258
|
+
SkinUpdateFlag[SkinUpdateFlag["RootBoneChanged"] = 1] = "RootBoneChanged";
|
|
27259
|
+
return SkinUpdateFlag;
|
|
27260
|
+
}({});
|
|
27261
|
+
/**
|
|
27262
|
+
* SkinnedMeshRenderer.
|
|
27263
|
+
*/ var SkinnedMeshRenderer = /*#__PURE__*/ function(MeshRenderer) {
|
|
27264
|
+
_inherits$2(SkinnedMeshRenderer, MeshRenderer);
|
|
27265
|
+
function SkinnedMeshRenderer(entity) {
|
|
27266
|
+
var _this;
|
|
27267
|
+
_this = MeshRenderer.call(this, entity) || this, _this._localBounds = new BoundingBox(), _this._jointDataCreateCache = new Vector2(-1, -1);
|
|
27268
|
+
_this._skin = null;
|
|
27269
|
+
var rhi = _this.entity.engine._hardwareRenderer;
|
|
27270
|
+
var maxVertexUniformVectors = rhi.renderStates.getParameter(rhi.gl.MAX_VERTEX_UNIFORM_VECTORS);
|
|
27271
|
+
// Limit size to 256 to avoid some problem:
|
|
27272
|
+
// For renderer is "Apple GPU", when uniform is large than 256 the skeleton matrix array access in shader very slow in Safari or WKWebview. This may be a apple bug, Chrome and Firefox is OK!
|
|
27273
|
+
// For renderer is "ANGLE (AMD, AMD Radeon(TM) Graphics Direct3011 vs_5_0 ps_5_0, D3011)", compile shader si very slow because of max uniform is 4096.
|
|
27274
|
+
maxVertexUniformVectors = Math.min(maxVertexUniformVectors, rhi._options._maxAllowSkinUniformVectorCount);
|
|
27275
|
+
_this._maxVertexUniformVectors = maxVertexUniformVectors;
|
|
27276
|
+
_this._onLocalBoundsChanged = _this._onLocalBoundsChanged.bind(_this);
|
|
27277
|
+
_this._onSkinUpdated = _this._onSkinUpdated.bind(_this);
|
|
27278
|
+
var localBounds = _this._localBounds;
|
|
27279
|
+
// @ts-ignore
|
|
27280
|
+
localBounds.min._onValueChanged = _this._onLocalBoundsChanged;
|
|
27281
|
+
// @ts-ignore
|
|
27282
|
+
localBounds.max._onValueChanged = _this._onLocalBoundsChanged;
|
|
27283
|
+
return _this;
|
|
27284
|
+
}
|
|
27285
|
+
var _proto = SkinnedMeshRenderer.prototype;
|
|
27235
27286
|
/**
|
|
27236
|
-
*
|
|
27237
|
-
|
|
27238
|
-
|
|
27239
|
-
|
|
27240
|
-
|
|
27287
|
+
* @internal
|
|
27288
|
+
*/ _proto._onDestroy = function _onDestroy() {
|
|
27289
|
+
var _this__jointTexture;
|
|
27290
|
+
MeshRenderer.prototype._onDestroy.call(this);
|
|
27291
|
+
this._jointDataCreateCache = null;
|
|
27292
|
+
this._skin = null;
|
|
27293
|
+
this._blendShapeWeights = null;
|
|
27294
|
+
this._localBounds = null;
|
|
27295
|
+
(_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
|
|
27296
|
+
this._jointTexture = null;
|
|
27241
27297
|
};
|
|
27242
27298
|
/**
|
|
27243
|
-
* @
|
|
27244
|
-
|
|
27245
|
-
|
|
27246
|
-
|
|
27247
|
-
|
|
27248
|
-
|
|
27299
|
+
* @internal
|
|
27300
|
+
*/ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
|
|
27301
|
+
MeshRenderer.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
|
|
27302
|
+
if (this.skin) {
|
|
27303
|
+
target._applySkin(null, target.skin);
|
|
27304
|
+
}
|
|
27305
|
+
this._blendShapeWeights && (target._blendShapeWeights = this._blendShapeWeights.slice());
|
|
27249
27306
|
};
|
|
27250
|
-
|
|
27251
|
-
|
|
27252
|
-
|
|
27253
|
-
|
|
27254
|
-
*/ _proto.findByName = function findByName(name) {
|
|
27255
|
-
if (name === this.name) {
|
|
27256
|
-
return this;
|
|
27307
|
+
_proto._update = function _update(context) {
|
|
27308
|
+
var skin = this.skin;
|
|
27309
|
+
if ((skin == null ? void 0 : skin.bones.length) > 0) {
|
|
27310
|
+
skin._updateSkinMatrices(this);
|
|
27257
27311
|
}
|
|
27258
|
-
var
|
|
27259
|
-
|
|
27260
|
-
|
|
27261
|
-
|
|
27262
|
-
|
|
27312
|
+
var shaderData = this.shaderData;
|
|
27313
|
+
var mesh = this.mesh;
|
|
27314
|
+
var blendShapeManager = mesh._blendShapeManager;
|
|
27315
|
+
blendShapeManager._updateShaderData(shaderData, this);
|
|
27316
|
+
var bones = skin == null ? void 0 : skin.bones;
|
|
27317
|
+
if (bones) {
|
|
27318
|
+
var bsUniformOccupiesCount = blendShapeManager._uniformOccupiesCount;
|
|
27319
|
+
var boneCount = bones.length;
|
|
27320
|
+
var boneDataCreateCache = this._jointDataCreateCache;
|
|
27321
|
+
var boneCountChange = boneCount !== boneDataCreateCache.x;
|
|
27322
|
+
if (boneCountChange || bsUniformOccupiesCount !== boneDataCreateCache.y) {
|
|
27323
|
+
// directly use max joint count to avoid shader recompile
|
|
27324
|
+
var remainUniformJointCount = Math.ceil((this._maxVertexUniformVectors - (SkinnedMeshRenderer._baseVertexUniformVectorCount + bsUniformOccupiesCount)) / 4);
|
|
27325
|
+
if (boneCount > remainUniformJointCount) {
|
|
27326
|
+
var engine = this.engine;
|
|
27327
|
+
if (engine._hardwareRenderer.canIUseMoreJoints) {
|
|
27328
|
+
if (boneCountChange) {
|
|
27329
|
+
var _this__jointTexture;
|
|
27330
|
+
(_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
|
|
27331
|
+
this._jointTexture = new Texture2D(engine, 4, boneCount, TextureFormat.R32G32B32A32, false, false);
|
|
27332
|
+
this._jointTexture.filterMode = TextureFilterMode.Point;
|
|
27333
|
+
this._jointTexture.isGCIgnored = true;
|
|
27334
|
+
}
|
|
27335
|
+
shaderData.disableMacro("RENDERER_JOINTS_NUM");
|
|
27336
|
+
shaderData.enableMacro("RENDERER_USE_JOINT_TEXTURE");
|
|
27337
|
+
shaderData.setTexture(SkinnedMeshRenderer._jointSamplerProperty, this._jointTexture);
|
|
27338
|
+
} else {
|
|
27339
|
+
Logger.error("component's joints count(" + boneCount + ") greater than device's MAX_VERTEX_UNIFORM_VECTORS number " + this._maxVertexUniformVectors + ", and don't support jointTexture in this device. suggest joint count less than " + remainUniformJointCount + ".", this);
|
|
27340
|
+
}
|
|
27341
|
+
} else {
|
|
27342
|
+
var _this__jointTexture1;
|
|
27343
|
+
(_this__jointTexture1 = this._jointTexture) == null ? void 0 : _this__jointTexture1.destroy();
|
|
27344
|
+
shaderData.disableMacro("RENDERER_USE_JOINT_TEXTURE");
|
|
27345
|
+
shaderData.enableMacro("RENDERER_JOINTS_NUM", remainUniformJointCount.toString());
|
|
27346
|
+
shaderData.setFloatArray(SkinnedMeshRenderer._jointMatrixProperty, skin._skinMatrices);
|
|
27347
|
+
}
|
|
27348
|
+
boneDataCreateCache.set(boneCount, bsUniformOccupiesCount);
|
|
27349
|
+
}
|
|
27350
|
+
if (this._jointTexture) {
|
|
27351
|
+
this._jointTexture.setPixelBuffer(skin._skinMatrices);
|
|
27263
27352
|
}
|
|
27264
27353
|
}
|
|
27265
|
-
|
|
27354
|
+
MeshRenderer.prototype._update.call(this, context);
|
|
27266
27355
|
};
|
|
27267
27356
|
/**
|
|
27268
|
-
*
|
|
27269
|
-
|
|
27270
|
-
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
|
|
27274
|
-
|
|
27357
|
+
* @internal
|
|
27358
|
+
*/ _proto._updateBounds = function _updateBounds(worldBounds) {
|
|
27359
|
+
var _this_skin;
|
|
27360
|
+
var rootBone = (_this_skin = this.skin) == null ? void 0 : _this_skin.rootBone;
|
|
27361
|
+
if (rootBone) {
|
|
27362
|
+
BoundingBox.transform(this._localBounds, this._transformEntity.transform.worldMatrix, worldBounds);
|
|
27363
|
+
} else {
|
|
27364
|
+
MeshRenderer.prototype._updateBounds.call(this, worldBounds);
|
|
27275
27365
|
}
|
|
27276
|
-
return Entity._findChildByName(this, 0, splits, 0);
|
|
27277
|
-
};
|
|
27278
|
-
/**
|
|
27279
|
-
* Create child entity.
|
|
27280
|
-
* @param name - The child entity's name
|
|
27281
|
-
* @returns The child entity
|
|
27282
|
-
*/ _proto.createChild = function createChild(name) {
|
|
27283
|
-
var transform = this._transform;
|
|
27284
|
-
var child = transform ? new Entity(this.engine, name, transform.constructor) : new Entity(this.engine, name);
|
|
27285
|
-
child.layer = this.layer;
|
|
27286
|
-
child.parent = this;
|
|
27287
|
-
return child;
|
|
27288
27366
|
};
|
|
27289
|
-
|
|
27290
|
-
|
|
27291
|
-
|
|
27292
|
-
var
|
|
27293
|
-
|
|
27294
|
-
var
|
|
27295
|
-
|
|
27296
|
-
|
|
27297
|
-
|
|
27298
|
-
|
|
27299
|
-
|
|
27300
|
-
|
|
27367
|
+
_proto._checkBlendShapeWeightLength = function _checkBlendShapeWeightLength() {
|
|
27368
|
+
var mesh = this._mesh;
|
|
27369
|
+
var newBlendShapeCount = mesh ? mesh.blendShapeCount : 0;
|
|
27370
|
+
var lastBlendShapeWeights = this._blendShapeWeights;
|
|
27371
|
+
if (lastBlendShapeWeights) {
|
|
27372
|
+
var lastBlendShapeWeightsCount = lastBlendShapeWeights.length;
|
|
27373
|
+
if (lastBlendShapeWeightsCount !== newBlendShapeCount) {
|
|
27374
|
+
var newBlendShapeWeights = new Float32Array(newBlendShapeCount);
|
|
27375
|
+
if (newBlendShapeCount > lastBlendShapeWeightsCount) {
|
|
27376
|
+
newBlendShapeWeights.set(lastBlendShapeWeights);
|
|
27377
|
+
} else {
|
|
27378
|
+
for(var i = 0; i < newBlendShapeCount; i++){
|
|
27379
|
+
newBlendShapeWeights[i] = lastBlendShapeWeights[i];
|
|
27380
|
+
}
|
|
27381
|
+
}
|
|
27382
|
+
this._blendShapeWeights = newBlendShapeWeights;
|
|
27383
|
+
}
|
|
27384
|
+
} else {
|
|
27385
|
+
this._blendShapeWeights = new Float32Array(newBlendShapeCount);
|
|
27301
27386
|
}
|
|
27302
|
-
children.length = 0;
|
|
27303
|
-
};
|
|
27304
|
-
/**
|
|
27305
|
-
* Clone this entity include children and components.
|
|
27306
|
-
* @returns Cloned entity
|
|
27307
|
-
*/ _proto.clone = function clone() {
|
|
27308
|
-
var cloneEntity = this._createCloneEntity();
|
|
27309
|
-
this._parseCloneEntity(this, cloneEntity, this, cloneEntity, new Map());
|
|
27310
|
-
return cloneEntity;
|
|
27311
|
-
};
|
|
27312
|
-
/**
|
|
27313
|
-
* Listen for changes in the world pose of this `Entity`.
|
|
27314
|
-
* @returns Change flag
|
|
27315
|
-
*/ _proto.registerWorldChangeFlag = function registerWorldChangeFlag() {
|
|
27316
|
-
return this._updateFlagManager.createFlag(BoolUpdateFlag);
|
|
27317
27387
|
};
|
|
27318
|
-
|
|
27319
|
-
|
|
27320
|
-
*/ _proto._markAsTemplate = function _markAsTemplate(templateResource) {
|
|
27321
|
-
this._isTemplate = true;
|
|
27322
|
-
this._templateResource = templateResource;
|
|
27388
|
+
_proto._onLocalBoundsChanged = function _onLocalBoundsChanged() {
|
|
27389
|
+
this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
|
|
27323
27390
|
};
|
|
27324
|
-
_proto.
|
|
27325
|
-
|
|
27326
|
-
|
|
27327
|
-
|
|
27328
|
-
|
|
27329
|
-
|
|
27330
|
-
|
|
27331
|
-
|
|
27332
|
-
|
|
27333
|
-
|
|
27334
|
-
|
|
27335
|
-
|
|
27336
|
-
|
|
27337
|
-
|
|
27338
|
-
|
|
27339
|
-
}
|
|
27340
|
-
cloneEntity.layer = this.layer;
|
|
27341
|
-
cloneEntity._isActive = this._isActive;
|
|
27342
|
-
var srcChildren = this._children;
|
|
27343
|
-
for(var i1 = 0, n1 = srcChildren.length; i1 < n1; i1++){
|
|
27344
|
-
cloneEntity.addChild(srcChildren[i1]._createCloneEntity());
|
|
27391
|
+
_proto._onSkinUpdated = function _onSkinUpdated(type, value) {
|
|
27392
|
+
switch(type){
|
|
27393
|
+
case SkinUpdateFlag.BoneCountChanged:
|
|
27394
|
+
var shaderData = this.shaderData;
|
|
27395
|
+
if (value > 0) {
|
|
27396
|
+
shaderData.enableMacro("RENDERER_HAS_SKIN");
|
|
27397
|
+
shaderData.setInt(SkinnedMeshRenderer._jointCountProperty, value);
|
|
27398
|
+
} else {
|
|
27399
|
+
shaderData.disableMacro("RENDERER_HAS_SKIN");
|
|
27400
|
+
}
|
|
27401
|
+
break;
|
|
27402
|
+
case SkinUpdateFlag.RootBoneChanged:
|
|
27403
|
+
this._setTransformEntity(value);
|
|
27404
|
+
this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
|
|
27405
|
+
break;
|
|
27345
27406
|
}
|
|
27346
|
-
return cloneEntity;
|
|
27347
27407
|
};
|
|
27348
|
-
_proto.
|
|
27349
|
-
var
|
|
27350
|
-
var
|
|
27351
|
-
|
|
27352
|
-
|
|
27408
|
+
_proto._applySkin = function _applySkin(lastSkin, value) {
|
|
27409
|
+
var _lastSkin_bones, _value_bones;
|
|
27410
|
+
var _lastSkin_bones_length;
|
|
27411
|
+
var lastSkinBoneCount = (_lastSkin_bones_length = lastSkin == null ? void 0 : (_lastSkin_bones = lastSkin.bones) == null ? void 0 : _lastSkin_bones.length) != null ? _lastSkin_bones_length : 0;
|
|
27412
|
+
var _lastSkin_rootBone;
|
|
27413
|
+
var lastRootBone = (_lastSkin_rootBone = lastSkin == null ? void 0 : lastSkin.rootBone) != null ? _lastSkin_rootBone : this.entity;
|
|
27414
|
+
lastSkin == null ? void 0 : lastSkin._updatedManager.removeListener(this._onSkinUpdated);
|
|
27415
|
+
var _value_bones_length;
|
|
27416
|
+
var skinBoneCount = (_value_bones_length = value == null ? void 0 : (_value_bones = value.bones) == null ? void 0 : _value_bones.length) != null ? _value_bones_length : 0;
|
|
27417
|
+
var _value_rootBone;
|
|
27418
|
+
var rootBone = (_value_rootBone = value == null ? void 0 : value.rootBone) != null ? _value_rootBone : this.entity;
|
|
27419
|
+
value == null ? void 0 : value._updatedManager.addListener(this._onSkinUpdated);
|
|
27420
|
+
if (lastSkinBoneCount !== skinBoneCount) {
|
|
27421
|
+
this._onSkinUpdated(SkinUpdateFlag.BoneCountChanged, skinBoneCount);
|
|
27353
27422
|
}
|
|
27354
|
-
|
|
27355
|
-
|
|
27356
|
-
ComponentCloner.cloneComponent(components[i1], target._components[i1], srcRoot, targetRoot, deepInstanceMap);
|
|
27423
|
+
if (lastRootBone !== rootBone) {
|
|
27424
|
+
this._onSkinUpdated(SkinUpdateFlag.RootBoneChanged, rootBone);
|
|
27357
27425
|
}
|
|
27358
27426
|
};
|
|
27359
|
-
|
|
27360
|
-
|
|
27361
|
-
|
|
27362
|
-
|
|
27363
|
-
|
|
27364
|
-
|
|
27365
|
-
|
|
27427
|
+
_create_class$2(SkinnedMeshRenderer, [
|
|
27428
|
+
{
|
|
27429
|
+
key: "skin",
|
|
27430
|
+
get: /**
|
|
27431
|
+
* Skin of the SkinnedMeshRenderer.
|
|
27432
|
+
*/ function get() {
|
|
27433
|
+
return this._skin;
|
|
27434
|
+
},
|
|
27435
|
+
set: function set(value) {
|
|
27436
|
+
var lastSkin = this._skin;
|
|
27437
|
+
if (lastSkin !== value) {
|
|
27438
|
+
this._applySkin(lastSkin, value);
|
|
27439
|
+
this._skin = value;
|
|
27440
|
+
}
|
|
27441
|
+
}
|
|
27442
|
+
},
|
|
27443
|
+
{
|
|
27444
|
+
key: "blendShapeWeights",
|
|
27445
|
+
get: /**
|
|
27446
|
+
* The weights of the BlendShapes.
|
|
27447
|
+
* @remarks Array index is BlendShape index.
|
|
27448
|
+
*/ function get() {
|
|
27449
|
+
this._checkBlendShapeWeightLength();
|
|
27450
|
+
return this._blendShapeWeights;
|
|
27451
|
+
},
|
|
27452
|
+
set: function set(value) {
|
|
27453
|
+
this._checkBlendShapeWeightLength();
|
|
27454
|
+
var blendShapeWeights = this._blendShapeWeights;
|
|
27455
|
+
if (value.length <= blendShapeWeights.length) {
|
|
27456
|
+
blendShapeWeights.set(value);
|
|
27457
|
+
} else {
|
|
27458
|
+
for(var i = 0, n = blendShapeWeights.length; i < n; i++){
|
|
27459
|
+
blendShapeWeights[i] = value[i];
|
|
27460
|
+
}
|
|
27461
|
+
}
|
|
27462
|
+
}
|
|
27463
|
+
},
|
|
27464
|
+
{
|
|
27465
|
+
key: "localBounds",
|
|
27466
|
+
get: /**
|
|
27467
|
+
* Local bounds.
|
|
27468
|
+
*/ function get() {
|
|
27469
|
+
return this._localBounds;
|
|
27470
|
+
},
|
|
27471
|
+
set: function set(value) {
|
|
27472
|
+
if (this._localBounds !== value) {
|
|
27473
|
+
this._localBounds.copyFrom(value);
|
|
27474
|
+
}
|
|
27475
|
+
}
|
|
27476
|
+
},
|
|
27477
|
+
{
|
|
27478
|
+
key: "rootBone",
|
|
27479
|
+
get: /**
|
|
27480
|
+
* @deprecated use {@link SkinnedMeshRenderer.skin.rootBone} instead.
|
|
27481
|
+
*/ function get() {
|
|
27482
|
+
return this.skin.rootBone;
|
|
27483
|
+
},
|
|
27484
|
+
set: function set(value) {
|
|
27485
|
+
this.skin.rootBone = value;
|
|
27486
|
+
}
|
|
27487
|
+
},
|
|
27488
|
+
{
|
|
27489
|
+
key: "bones",
|
|
27490
|
+
get: /**
|
|
27491
|
+
* @deprecated use {@link SkinnedMeshRenderer.skin.bones} instead.
|
|
27492
|
+
*/ function get() {
|
|
27493
|
+
return this.skin.bones;
|
|
27494
|
+
},
|
|
27495
|
+
set: function set(value) {
|
|
27496
|
+
this.skin.bones = value;
|
|
27497
|
+
}
|
|
27498
|
+
}
|
|
27499
|
+
]);
|
|
27500
|
+
return SkinnedMeshRenderer;
|
|
27501
|
+
}(MeshRenderer);
|
|
27502
|
+
// @TODO: different shader type should use different count, not always 48
|
|
27503
|
+
/** @internal */ SkinnedMeshRenderer._baseVertexUniformVectorCount = 48;
|
|
27504
|
+
SkinnedMeshRenderer._jointCountProperty = ShaderProperty.getByName("renderer_JointCount");
|
|
27505
|
+
SkinnedMeshRenderer._jointSamplerProperty = ShaderProperty.getByName("renderer_JointSampler");
|
|
27506
|
+
SkinnedMeshRenderer._jointMatrixProperty = ShaderProperty.getByName("renderer_JointMatrix");
|
|
27507
|
+
__decorate$1([
|
|
27508
|
+
ignoreClone
|
|
27509
|
+
], SkinnedMeshRenderer.prototype, "_condensedBlendShapeWeights", void 0);
|
|
27510
|
+
__decorate$1([
|
|
27511
|
+
deepClone
|
|
27512
|
+
], SkinnedMeshRenderer.prototype, "_localBounds", void 0);
|
|
27513
|
+
__decorate$1([
|
|
27514
|
+
ignoreClone
|
|
27515
|
+
], SkinnedMeshRenderer.prototype, "_jointDataCreateCache", void 0);
|
|
27516
|
+
__decorate$1([
|
|
27517
|
+
ignoreClone
|
|
27518
|
+
], SkinnedMeshRenderer.prototype, "_blendShapeWeights", void 0);
|
|
27519
|
+
__decorate$1([
|
|
27520
|
+
ignoreClone
|
|
27521
|
+
], SkinnedMeshRenderer.prototype, "_maxVertexUniformVectors", void 0);
|
|
27522
|
+
__decorate$1([
|
|
27523
|
+
ignoreClone
|
|
27524
|
+
], SkinnedMeshRenderer.prototype, "_jointTexture", void 0);
|
|
27525
|
+
__decorate$1([
|
|
27526
|
+
deepClone
|
|
27527
|
+
], SkinnedMeshRenderer.prototype, "_skin", void 0);
|
|
27528
|
+
__decorate$1([
|
|
27529
|
+
ignoreClone
|
|
27530
|
+
], SkinnedMeshRenderer.prototype, "_onLocalBoundsChanged", null);
|
|
27531
|
+
__decorate$1([
|
|
27532
|
+
ignoreClone
|
|
27533
|
+
], SkinnedMeshRenderer.prototype, "_onSkinUpdated", null);
|
|
27534
|
+
/**
|
|
27535
|
+
* @internal
|
|
27536
|
+
*/ var BasicResources = /*#__PURE__*/ function() {
|
|
27537
|
+
function BasicResources(engine) {
|
|
27538
|
+
this.engine = engine;
|
|
27539
|
+
// prettier-ignore
|
|
27540
|
+
var vertices = new Float32Array([
|
|
27541
|
+
-1,
|
|
27542
|
+
-1,
|
|
27543
|
+
0,
|
|
27544
|
+
1,
|
|
27545
|
+
3,
|
|
27546
|
+
-1,
|
|
27547
|
+
2,
|
|
27548
|
+
1,
|
|
27549
|
+
-1,
|
|
27550
|
+
3,
|
|
27551
|
+
0,
|
|
27552
|
+
-1
|
|
27553
|
+
]); // left-top
|
|
27554
|
+
// prettier-ignore
|
|
27555
|
+
var flipYVertices = new Float32Array([
|
|
27556
|
+
3,
|
|
27557
|
+
-1,
|
|
27558
|
+
2,
|
|
27559
|
+
0,
|
|
27560
|
+
-1,
|
|
27561
|
+
-1,
|
|
27562
|
+
0,
|
|
27563
|
+
0,
|
|
27564
|
+
-1,
|
|
27565
|
+
3,
|
|
27566
|
+
0,
|
|
27567
|
+
2
|
|
27568
|
+
]); // left-top
|
|
27569
|
+
var blitMaterial = new Material(engine, Shader.find("blit"));
|
|
27570
|
+
blitMaterial._addReferCount(1);
|
|
27571
|
+
blitMaterial.renderState.depthState.enabled = false;
|
|
27572
|
+
blitMaterial.renderState.depthState.writeEnabled = false;
|
|
27573
|
+
var blitScreenMaterial = new Material(engine, Shader.find("blit-screen"));
|
|
27574
|
+
blitScreenMaterial._addReferCount(1);
|
|
27575
|
+
blitScreenMaterial.renderState.depthState.enabled = false;
|
|
27576
|
+
blitScreenMaterial.renderState.depthState.writeEnabled = false;
|
|
27577
|
+
this.blitMaterial = blitMaterial;
|
|
27578
|
+
this.blitScreenMaterial = blitScreenMaterial;
|
|
27579
|
+
this.blitMesh = this._createBlitMesh(engine, vertices);
|
|
27580
|
+
this.flipYBlitMesh = this._createBlitMesh(engine, flipYVertices);
|
|
27581
|
+
// Create white and magenta textures
|
|
27582
|
+
var whitePixel = new Uint8Array([
|
|
27583
|
+
255,
|
|
27584
|
+
255,
|
|
27585
|
+
255,
|
|
27586
|
+
255
|
|
27587
|
+
]);
|
|
27588
|
+
this.whiteTexture2D = this._create1x1Texture(engine, 0, TextureFormat.R8G8B8A8, whitePixel, true);
|
|
27589
|
+
this.whiteTextureCube = this._create1x1Texture(engine, 1, TextureFormat.R8G8B8A8, whitePixel, true);
|
|
27590
|
+
var isWebGL2 = engine._hardwareRenderer.isWebGL2;
|
|
27591
|
+
if (isWebGL2) {
|
|
27592
|
+
this.whiteTexture2DArray = this._create1x1Texture(engine, 2, TextureFormat.R8G8B8A8, whitePixel, true);
|
|
27593
|
+
var whitePixel32 = new Uint32Array([
|
|
27594
|
+
255,
|
|
27595
|
+
255,
|
|
27596
|
+
255,
|
|
27597
|
+
255
|
|
27598
|
+
]);
|
|
27599
|
+
this.uintWhiteTexture2D = this._create1x1Texture(engine, 0, TextureFormat.R32G32B32A32_UInt, whitePixel32, false);
|
|
27600
|
+
}
|
|
27601
|
+
this.spriteDefaultMaterial = this._create2DMaterial(engine, Shader.find("Sprite"));
|
|
27602
|
+
this.textDefaultMaterial = this._create2DMaterial(engine, Shader.find("Text"));
|
|
27603
|
+
this.spriteMaskDefaultMaterial = this._createSpriteMaskMaterial(engine);
|
|
27604
|
+
this.meshMagentaMaterial = this._createMagentaMaterial(engine, "unlit");
|
|
27605
|
+
this.particleMagentaMaterial = this._createMagentaMaterial(engine, "particle-shader");
|
|
27606
|
+
}
|
|
27607
|
+
var _proto = BasicResources.prototype;
|
|
27608
|
+
/**
|
|
27609
|
+
* @internal
|
|
27610
|
+
*/ _proto._getBlinnPhongMaterial = function _getBlinnPhongMaterial() {
|
|
27611
|
+
return this._blinnPhongMaterial || (this._blinnPhongMaterial = new BlinnPhongMaterial(this.engine));
|
|
27612
|
+
};
|
|
27613
|
+
/**
|
|
27614
|
+
* @internal
|
|
27615
|
+
*/ _proto._initialize = function _initialize() {
|
|
27616
|
+
var _this = this;
|
|
27617
|
+
return new Promise(function(resolve, reject) {
|
|
27618
|
+
PrefilteredDFG.create(_this.engine).then(function(texture) {
|
|
27619
|
+
_this._prefilteredDFGTexture = texture;
|
|
27620
|
+
resolve(_this);
|
|
27621
|
+
}).catch(reject);
|
|
27622
|
+
});
|
|
27623
|
+
};
|
|
27624
|
+
_proto._createBlitMesh = function _createBlitMesh(engine, vertices) {
|
|
27625
|
+
var mesh = new ModelMesh(engine);
|
|
27626
|
+
mesh._addReferCount(1);
|
|
27627
|
+
mesh.setVertexElements([
|
|
27628
|
+
new VertexElement("POSITION_UV", 0, VertexElementFormat.Vector4, 0)
|
|
27629
|
+
]);
|
|
27630
|
+
var buffer = new Buffer(engine, BufferBindFlag.VertexBuffer, vertices, BufferUsage.Static, true);
|
|
27631
|
+
mesh.setVertexBufferBinding(buffer, 16);
|
|
27632
|
+
mesh.addSubMesh(0, 3, MeshTopology.Triangles);
|
|
27633
|
+
engine.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
|
|
27634
|
+
_inherits$2(_class, ContentRestorer);
|
|
27635
|
+
function _class() {
|
|
27636
|
+
return ContentRestorer.call(this, mesh) || this;
|
|
27637
|
+
}
|
|
27638
|
+
var _proto = _class.prototype;
|
|
27639
|
+
_proto.restoreContent = function restoreContent() {
|
|
27640
|
+
buffer.setData(buffer.data);
|
|
27641
|
+
};
|
|
27642
|
+
return _class;
|
|
27643
|
+
}(ContentRestorer))());
|
|
27644
|
+
return mesh;
|
|
27645
|
+
};
|
|
27646
|
+
_proto._create1x1Texture = function _create1x1Texture(engine, type, format, pixel, isSRGBColorSpace) {
|
|
27647
|
+
var texture;
|
|
27648
|
+
switch(type){
|
|
27649
|
+
case 0:
|
|
27650
|
+
var texture2D = new Texture2D(engine, 1, 1, format, false, isSRGBColorSpace);
|
|
27651
|
+
texture2D.setPixelBuffer(pixel);
|
|
27652
|
+
texture = texture2D;
|
|
27653
|
+
break;
|
|
27654
|
+
case 2:
|
|
27655
|
+
var texture2DArray = new Texture2DArray(engine, 1, 1, 1, format, false, isSRGBColorSpace);
|
|
27656
|
+
texture2DArray.setPixelBuffer(0, pixel);
|
|
27657
|
+
texture = texture2DArray;
|
|
27658
|
+
break;
|
|
27659
|
+
case 1:
|
|
27660
|
+
var textureCube = new TextureCube(engine, 1, format, false, isSRGBColorSpace);
|
|
27661
|
+
for(var i = 0; i < 6; i++){
|
|
27662
|
+
textureCube.setPixelBuffer(TextureCubeFace.PositiveX + i, pixel);
|
|
27663
|
+
}
|
|
27664
|
+
texture = textureCube;
|
|
27665
|
+
break;
|
|
27666
|
+
default:
|
|
27667
|
+
throw "Invalid texture type";
|
|
27668
|
+
}
|
|
27669
|
+
texture.isGCIgnored = true;
|
|
27670
|
+
engine.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
|
|
27671
|
+
_inherits$2(_class, ContentRestorer);
|
|
27672
|
+
function _class() {
|
|
27673
|
+
return ContentRestorer.call(this, texture) || this;
|
|
27674
|
+
}
|
|
27675
|
+
var _proto = _class.prototype;
|
|
27676
|
+
_proto.restoreContent = function restoreContent() {
|
|
27677
|
+
switch(type){
|
|
27678
|
+
case 0:
|
|
27679
|
+
this.resource.setPixelBuffer(pixel);
|
|
27680
|
+
break;
|
|
27681
|
+
case 2:
|
|
27682
|
+
this.resource.setPixelBuffer(0, pixel);
|
|
27683
|
+
break;
|
|
27684
|
+
case 1:
|
|
27685
|
+
for(var i = 0; i < 6; i++){
|
|
27686
|
+
this.resource.setPixelBuffer(TextureCubeFace.PositiveX + i, pixel);
|
|
27687
|
+
}
|
|
27688
|
+
break;
|
|
27689
|
+
}
|
|
27690
|
+
};
|
|
27691
|
+
return _class;
|
|
27692
|
+
}(ContentRestorer))());
|
|
27693
|
+
return texture;
|
|
27694
|
+
};
|
|
27695
|
+
_proto._create2DMaterial = function _create2DMaterial(engine, shader) {
|
|
27696
|
+
var material = new Material(engine, shader);
|
|
27697
|
+
var renderState = material.renderState;
|
|
27698
|
+
var target = renderState.blendState.targetBlendState;
|
|
27699
|
+
target.enabled = true;
|
|
27700
|
+
target.sourceColorBlendFactor = BlendFactor.SourceAlpha;
|
|
27701
|
+
target.destinationColorBlendFactor = BlendFactor.OneMinusSourceAlpha;
|
|
27702
|
+
target.sourceAlphaBlendFactor = BlendFactor.One;
|
|
27703
|
+
target.destinationAlphaBlendFactor = BlendFactor.OneMinusSourceAlpha;
|
|
27704
|
+
target.colorBlendOperation = target.alphaBlendOperation = BlendOperation.Add;
|
|
27705
|
+
renderState.depthState.writeEnabled = false;
|
|
27706
|
+
renderState.rasterState.cullMode = CullMode.Off;
|
|
27707
|
+
renderState.renderQueueType = RenderQueueType.Transparent;
|
|
27708
|
+
material.isGCIgnored = true;
|
|
27709
|
+
return material;
|
|
27710
|
+
};
|
|
27711
|
+
_proto._createMagentaMaterial = function _createMagentaMaterial(engine, shaderName) {
|
|
27712
|
+
var material = new Material(engine, Shader.find(shaderName));
|
|
27713
|
+
material.isGCIgnored = true;
|
|
27714
|
+
material.shaderData.setColor("material_BaseColor", new Color(1.0, 0.0, 1.01, 1.0));
|
|
27715
|
+
return material;
|
|
27716
|
+
};
|
|
27717
|
+
_proto._createSpriteMaskMaterial = function _createSpriteMaskMaterial(engine) {
|
|
27718
|
+
var material = new Material(engine, Shader.find("SpriteMask"));
|
|
27719
|
+
material.isGCIgnored = true;
|
|
27720
|
+
return material;
|
|
27721
|
+
};
|
|
27722
|
+
BasicResources.getMaskInteractionRenderStates = function getMaskInteractionRenderStates(maskInteraction) {
|
|
27723
|
+
var visibleInsideMask = maskInteraction === SpriteMaskInteraction.VisibleInsideMask;
|
|
27724
|
+
var renderStates;
|
|
27725
|
+
var compareFunction;
|
|
27726
|
+
if (visibleInsideMask) {
|
|
27727
|
+
renderStates = BasicResources._maskReadInsideRenderStates;
|
|
27728
|
+
if (renderStates) {
|
|
27729
|
+
return renderStates;
|
|
27730
|
+
}
|
|
27731
|
+
BasicResources._maskReadInsideRenderStates = renderStates = {};
|
|
27732
|
+
compareFunction = CompareFunction.LessEqual;
|
|
27733
|
+
} else {
|
|
27734
|
+
renderStates = BasicResources._maskReadOutsideRenderStates;
|
|
27735
|
+
if (renderStates) {
|
|
27736
|
+
return renderStates;
|
|
27737
|
+
}
|
|
27738
|
+
BasicResources._maskReadOutsideRenderStates = renderStates = {};
|
|
27739
|
+
compareFunction = CompareFunction.Greater;
|
|
27740
|
+
}
|
|
27741
|
+
renderStates[RenderStateElementKey.StencilStateEnabled] = true;
|
|
27742
|
+
renderStates[RenderStateElementKey.StencilStateWriteMask] = 0x00;
|
|
27743
|
+
renderStates[RenderStateElementKey.StencilStateReferenceValue] = 1;
|
|
27744
|
+
renderStates[RenderStateElementKey.StencilStateCompareFunctionFront] = compareFunction;
|
|
27745
|
+
renderStates[RenderStateElementKey.StencilStateCompareFunctionBack] = compareFunction;
|
|
27746
|
+
return renderStates;
|
|
27747
|
+
};
|
|
27748
|
+
BasicResources.getMaskTypeRenderStates = function getMaskTypeRenderStates(maskType) {
|
|
27749
|
+
var isIncrement = maskType === RenderQueueMaskType.Increment;
|
|
27750
|
+
var renderStates;
|
|
27751
|
+
var passOperation;
|
|
27752
|
+
if (isIncrement) {
|
|
27753
|
+
renderStates = BasicResources._maskWriteIncrementRenderStates;
|
|
27754
|
+
if (renderStates) {
|
|
27755
|
+
return renderStates;
|
|
27756
|
+
}
|
|
27757
|
+
BasicResources._maskWriteIncrementRenderStates = renderStates = {};
|
|
27758
|
+
passOperation = StencilOperation.IncrementSaturate;
|
|
27759
|
+
} else {
|
|
27760
|
+
renderStates = BasicResources._maskWriteDecrementRenderStates;
|
|
27761
|
+
if (renderStates) {
|
|
27762
|
+
return renderStates;
|
|
27763
|
+
}
|
|
27764
|
+
BasicResources._maskWriteDecrementRenderStates = renderStates = {};
|
|
27765
|
+
passOperation = StencilOperation.DecrementSaturate;
|
|
27766
|
+
}
|
|
27767
|
+
renderStates[RenderStateElementKey.StencilStateEnabled] = true;
|
|
27768
|
+
renderStates[RenderStateElementKey.StencilStatePassOperationFront] = passOperation;
|
|
27769
|
+
renderStates[RenderStateElementKey.StencilStatePassOperationBack] = passOperation;
|
|
27770
|
+
renderStates[RenderStateElementKey.StencilStateCompareFunctionFront] = CompareFunction.Always;
|
|
27771
|
+
renderStates[RenderStateElementKey.StencilStateCompareFunctionBack] = CompareFunction.Always;
|
|
27772
|
+
var failStencilOperation = StencilOperation.Keep;
|
|
27773
|
+
renderStates[RenderStateElementKey.StencilStateFailOperationFront] = failStencilOperation;
|
|
27774
|
+
renderStates[RenderStateElementKey.StencilStateFailOperationBack] = failStencilOperation;
|
|
27775
|
+
renderStates[RenderStateElementKey.StencilStateZFailOperationFront] = failStencilOperation;
|
|
27776
|
+
renderStates[RenderStateElementKey.StencilStateZFailOperationBack] = failStencilOperation;
|
|
27777
|
+
renderStates[RenderStateElementKey.BlendStateColorWriteMask0] = ColorWriteMask.None;
|
|
27778
|
+
renderStates[RenderStateElementKey.DepthStateEnabled] = false;
|
|
27779
|
+
renderStates[RenderStateElementKey.RasterStateCullMode] = CullMode.Off;
|
|
27780
|
+
return renderStates;
|
|
27781
|
+
};
|
|
27782
|
+
_create_class$2(BasicResources, [
|
|
27783
|
+
{
|
|
27784
|
+
key: "prefilteredDFGTexture",
|
|
27785
|
+
get: function get() {
|
|
27786
|
+
return this._prefilteredDFGTexture;
|
|
27787
|
+
}
|
|
27788
|
+
}
|
|
27789
|
+
]);
|
|
27790
|
+
return BasicResources;
|
|
27791
|
+
}();
|
|
27792
|
+
BasicResources._maskReadInsideRenderStates = null;
|
|
27793
|
+
BasicResources._maskReadOutsideRenderStates = null;
|
|
27794
|
+
BasicResources._maskWriteIncrementRenderStates = null;
|
|
27795
|
+
BasicResources._maskWriteDecrementRenderStates = null;
|
|
27796
|
+
function _is_native_reflect_construct$1() {
|
|
27797
|
+
// Since Reflect.construct can't be properly polyfilled, some
|
|
27798
|
+
// implementations (e.g. core-js@2) don't set the correct internal slots.
|
|
27799
|
+
// Those polyfills don't allow us to subclass built-ins, so we need to
|
|
27800
|
+
// use our fallback implementation.
|
|
27801
|
+
try {
|
|
27802
|
+
// If the internal slots aren't set, this throws an error similar to
|
|
27803
|
+
// TypeError: this is not a Boolean object.
|
|
27804
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
27805
|
+
} catch (_) {}
|
|
27806
|
+
return (_is_native_reflect_construct$1 = function _is_native_reflect_construct() {
|
|
27807
|
+
return !!result;
|
|
27808
|
+
})();
|
|
27809
|
+
}
|
|
27810
|
+
function _construct$1(Parent, args, Class) {
|
|
27811
|
+
if (_is_native_reflect_construct$1()) _construct$1 = Reflect.construct;
|
|
27812
|
+
else {
|
|
27813
|
+
_construct$1 = function construct(Parent, args, Class) {
|
|
27814
|
+
var a = [
|
|
27815
|
+
null
|
|
27816
|
+
];
|
|
27817
|
+
a.push.apply(a, args);
|
|
27818
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
27819
|
+
var instance = new Constructor();
|
|
27820
|
+
if (Class) _set_prototype_of$2(instance, Class.prototype);
|
|
27821
|
+
return instance;
|
|
27822
|
+
};
|
|
27823
|
+
}
|
|
27824
|
+
return _construct$1.apply(null, arguments);
|
|
27825
|
+
}
|
|
27826
|
+
var ComponentCloner = /*#__PURE__*/ function() {
|
|
27827
|
+
function ComponentCloner() {}
|
|
27828
|
+
/**
|
|
27829
|
+
* Clone component.
|
|
27830
|
+
* @param source - Clone source
|
|
27831
|
+
* @param target - Clone target
|
|
27832
|
+
*/ ComponentCloner.cloneComponent = function cloneComponent(source, target, srcRoot, targetRoot, deepInstanceMap) {
|
|
27833
|
+
var cloneModes = CloneManager.getCloneMode(source.constructor);
|
|
27834
|
+
for(var k in source){
|
|
27835
|
+
CloneManager.cloneProperty(source, target, k, cloneModes[k], srcRoot, targetRoot, deepInstanceMap);
|
|
27836
|
+
}
|
|
27837
|
+
if (source._cloneTo) {
|
|
27838
|
+
source._cloneTo(target, srcRoot, targetRoot);
|
|
27839
|
+
}
|
|
27840
|
+
};
|
|
27841
|
+
return ComponentCloner;
|
|
27842
|
+
}();
|
|
27843
|
+
/**
|
|
27844
|
+
* The entity modify flags.
|
|
27845
|
+
*/ var EntityModifyFlags = /*#__PURE__*/ function(EntityModifyFlags) {
|
|
27846
|
+
/** The parent changes. */ EntityModifyFlags[EntityModifyFlags["Parent"] = 1] = "Parent";
|
|
27847
|
+
/** The child changes. */ EntityModifyFlags[EntityModifyFlags["Child"] = 2] = "Child";
|
|
27848
|
+
return EntityModifyFlags;
|
|
27849
|
+
}({});
|
|
27850
|
+
/**
|
|
27851
|
+
* Entity, be used as components container.
|
|
27852
|
+
*/ var Entity = /*#__PURE__*/ function(EngineObject) {
|
|
27853
|
+
_inherits$2(Entity, EngineObject);
|
|
27854
|
+
function Entity(engine, name) {
|
|
27855
|
+
for(var _len = arguments.length, components = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
27856
|
+
components[_key - 2] = arguments[_key];
|
|
27857
|
+
}
|
|
27858
|
+
var _this;
|
|
27859
|
+
_this = EngineObject.call(this, engine) || this, /** The layer the entity belongs to. */ _this.layer = Layer.Layer0, /** @internal */ _this._isActiveInHierarchy = false, /** @internal */ _this._isActiveInScene = false, /** @internal */ _this._components = [], /** @internal */ _this._scripts = new DisorderedArray(), /** @internal */ _this._children = [], /** @internal */ _this._isRoot = false, /** @internal */ _this._isActive = true, /** @internal */ _this._siblingIndex = -1, /** @internal */ _this._isTemplate = false, /** @internal */ _this._updateFlagManager = new UpdateFlagManager(), _this._parent = null, _this._invModelMatrix = new Matrix();
|
|
27860
|
+
_this.name = name != null ? name : "Entity";
|
|
27861
|
+
for(var i = 0, n = components.length; i < n; i++){
|
|
27862
|
+
_this.addComponent(components[i]);
|
|
27863
|
+
}
|
|
27864
|
+
!_this._transform && _this.addComponent(Transform);
|
|
27865
|
+
_this._inverseWorldMatFlag = _this.registerWorldChangeFlag();
|
|
27866
|
+
return _this;
|
|
27867
|
+
}
|
|
27868
|
+
var _proto = Entity.prototype;
|
|
27869
|
+
/**
|
|
27870
|
+
* Add component based on the component type.
|
|
27871
|
+
* @param type - The type of the component
|
|
27872
|
+
* @param args - The arguments of the component
|
|
27873
|
+
* @returns The component which has been added
|
|
27874
|
+
*/ _proto.addComponent = function addComponent(type) {
|
|
27875
|
+
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
27876
|
+
args[_key - 1] = arguments[_key];
|
|
27877
|
+
}
|
|
27878
|
+
ComponentsDependencies._addCheck(this, type);
|
|
27879
|
+
var component = _construct$1(type, [].concat([
|
|
27880
|
+
this
|
|
27881
|
+
], args));
|
|
27882
|
+
this._components.push(component);
|
|
27883
|
+
// @todo: temporary solution
|
|
27884
|
+
if (_instanceof1$2(component, Transform)) this._setTransform(component);
|
|
27885
|
+
component._setActive(true, ActiveChangeFlag.All);
|
|
27886
|
+
return component;
|
|
27887
|
+
};
|
|
27888
|
+
/**
|
|
27889
|
+
* Get component which match the type.
|
|
27890
|
+
* @param type - The type of the component
|
|
27891
|
+
* @returns The first component which match type
|
|
27892
|
+
*/ _proto.getComponent = function getComponent(type) {
|
|
27893
|
+
var components = this._components;
|
|
27894
|
+
for(var i = 0, n = components.length; i < n; i++){
|
|
27895
|
+
var component = components[i];
|
|
27896
|
+
if (_instanceof1$2(component, type)) {
|
|
27897
|
+
return component;
|
|
27898
|
+
}
|
|
27899
|
+
}
|
|
27900
|
+
return null;
|
|
27901
|
+
};
|
|
27902
|
+
/**
|
|
27903
|
+
* Get components which match the type.
|
|
27904
|
+
* @param type - The type of the component
|
|
27905
|
+
* @param results - The components which match type
|
|
27906
|
+
* @returns The components which match type
|
|
27907
|
+
*/ _proto.getComponents = function getComponents(type, results) {
|
|
27908
|
+
results.length = 0;
|
|
27909
|
+
var components = this._components;
|
|
27910
|
+
for(var i = 0, n = components.length; i < n; i++){
|
|
27911
|
+
var component = components[i];
|
|
27912
|
+
if (_instanceof1$2(component, type)) {
|
|
27913
|
+
results.push(component);
|
|
27914
|
+
}
|
|
27915
|
+
}
|
|
27916
|
+
return results;
|
|
27917
|
+
};
|
|
27918
|
+
/**
|
|
27919
|
+
* Get the components which match the type of the entity and it's children.
|
|
27920
|
+
* @param type - The component type
|
|
27921
|
+
* @param results - The components collection
|
|
27922
|
+
* @returns The components collection which match the type
|
|
27923
|
+
*/ _proto.getComponentsIncludeChildren = function getComponentsIncludeChildren(type, results) {
|
|
27924
|
+
results.length = 0;
|
|
27925
|
+
this._getComponentsInChildren(type, results);
|
|
27926
|
+
return results;
|
|
27927
|
+
};
|
|
27928
|
+
_proto.addChild = function addChild(indexOrChild, child) {
|
|
27929
|
+
var index;
|
|
27930
|
+
if (typeof indexOrChild === "number") {
|
|
27931
|
+
index = indexOrChild;
|
|
27932
|
+
} else {
|
|
27933
|
+
index = undefined;
|
|
27934
|
+
child = indexOrChild;
|
|
27935
|
+
}
|
|
27936
|
+
child._setParent(this, index);
|
|
27937
|
+
};
|
|
27938
|
+
/**
|
|
27939
|
+
* Remove child entity.
|
|
27940
|
+
* @param child - The child entity which want to be removed
|
|
27941
|
+
*/ _proto.removeChild = function removeChild(child) {
|
|
27942
|
+
if (child._parent !== this) return;
|
|
27943
|
+
child._setParent(null);
|
|
27944
|
+
};
|
|
27945
|
+
/**
|
|
27946
|
+
* @deprecated Please use `children` property instead.
|
|
27947
|
+
* Find child entity by index.
|
|
27948
|
+
* @param index - The index of the child entity
|
|
27949
|
+
* @returns The component which be found
|
|
27950
|
+
*/ _proto.getChild = function getChild(index) {
|
|
27951
|
+
return this._children[index];
|
|
27952
|
+
};
|
|
27953
|
+
/**
|
|
27954
|
+
* Find entity by name.
|
|
27955
|
+
* @param name - The name of the entity which want to be found
|
|
27956
|
+
* @returns The component which be found
|
|
27957
|
+
*/ _proto.findByName = function findByName(name) {
|
|
27958
|
+
if (name === this.name) {
|
|
27959
|
+
return this;
|
|
27960
|
+
}
|
|
27961
|
+
var children = this._children;
|
|
27962
|
+
for(var i = 0, n = children.length; i < n; i++){
|
|
27963
|
+
var target = children[i].findByName(name);
|
|
27964
|
+
if (target) {
|
|
27965
|
+
return target;
|
|
27966
|
+
}
|
|
27967
|
+
}
|
|
27968
|
+
return null;
|
|
27969
|
+
};
|
|
27970
|
+
/**
|
|
27971
|
+
* Find the entity by path.
|
|
27972
|
+
* @param path - The path of the entity eg: /entity
|
|
27973
|
+
* @returns The component which be found
|
|
27974
|
+
*/ _proto.findByPath = function findByPath(path) {
|
|
27975
|
+
var splits = path.split("/").filter(Boolean);
|
|
27976
|
+
if (!splits.length) {
|
|
27977
|
+
return this;
|
|
27978
|
+
}
|
|
27979
|
+
return Entity._findChildByName(this, 0, splits, 0);
|
|
27980
|
+
};
|
|
27981
|
+
/**
|
|
27982
|
+
* Create child entity.
|
|
27983
|
+
* @param name - The child entity's name
|
|
27984
|
+
* @returns The child entity
|
|
27985
|
+
*/ _proto.createChild = function createChild(name) {
|
|
27986
|
+
var transform = this._transform;
|
|
27987
|
+
var child = transform ? new Entity(this.engine, name, transform.constructor) : new Entity(this.engine, name);
|
|
27988
|
+
child.layer = this.layer;
|
|
27989
|
+
child.parent = this;
|
|
27990
|
+
return child;
|
|
27991
|
+
};
|
|
27992
|
+
/**
|
|
27993
|
+
* Clear children entities.
|
|
27994
|
+
*/ _proto.clearChildren = function clearChildren() {
|
|
27995
|
+
var children = this._children;
|
|
27996
|
+
for(var i = children.length - 1; i >= 0; i--){
|
|
27997
|
+
var child = children[i];
|
|
27998
|
+
child._parent = null;
|
|
27999
|
+
var activeChangeFlag = ActiveChangeFlag.None;
|
|
28000
|
+
child._isActiveInHierarchy && (activeChangeFlag |= ActiveChangeFlag.Hierarchy);
|
|
28001
|
+
child._isActiveInScene && (activeChangeFlag |= ActiveChangeFlag.Scene);
|
|
28002
|
+
activeChangeFlag && child._processInActive(activeChangeFlag);
|
|
28003
|
+
Entity._traverseSetOwnerScene(child, null); // Must after child._processInActive().
|
|
28004
|
+
}
|
|
28005
|
+
children.length = 0;
|
|
28006
|
+
};
|
|
28007
|
+
/**
|
|
28008
|
+
* Clone this entity include children and components.
|
|
28009
|
+
* @returns Cloned entity
|
|
28010
|
+
*/ _proto.clone = function clone() {
|
|
28011
|
+
var cloneEntity = this._createCloneEntity();
|
|
28012
|
+
this._parseCloneEntity(this, cloneEntity, this, cloneEntity, new Map());
|
|
28013
|
+
return cloneEntity;
|
|
28014
|
+
};
|
|
28015
|
+
/**
|
|
28016
|
+
* Listen for changes in the world pose of this `Entity`.
|
|
28017
|
+
* @returns Change flag
|
|
28018
|
+
*/ _proto.registerWorldChangeFlag = function registerWorldChangeFlag() {
|
|
28019
|
+
return this._updateFlagManager.createFlag(BoolUpdateFlag);
|
|
28020
|
+
};
|
|
28021
|
+
/**
|
|
28022
|
+
* @internal
|
|
28023
|
+
*/ _proto._markAsTemplate = function _markAsTemplate(templateResource) {
|
|
28024
|
+
this._isTemplate = true;
|
|
28025
|
+
this._templateResource = templateResource;
|
|
28026
|
+
};
|
|
28027
|
+
_proto._createCloneEntity = function _createCloneEntity() {
|
|
28028
|
+
var componentConstructors = Entity._tempComponentConstructors;
|
|
28029
|
+
var components = this._components;
|
|
28030
|
+
for(var i = 0, n = components.length; i < n; i++){
|
|
28031
|
+
componentConstructors[i] = components[i].constructor;
|
|
28032
|
+
}
|
|
28033
|
+
var cloneEntity = _construct$1(Entity, [].concat([
|
|
28034
|
+
this.engine,
|
|
28035
|
+
this.name
|
|
28036
|
+
], componentConstructors));
|
|
28037
|
+
componentConstructors.length = 0;
|
|
28038
|
+
var templateResource = this._templateResource;
|
|
28039
|
+
if (templateResource) {
|
|
28040
|
+
cloneEntity._templateResource = templateResource;
|
|
28041
|
+
templateResource._addReferCount(1);
|
|
28042
|
+
}
|
|
28043
|
+
cloneEntity.layer = this.layer;
|
|
28044
|
+
cloneEntity._isActive = this._isActive;
|
|
28045
|
+
var srcChildren = this._children;
|
|
28046
|
+
for(var i1 = 0, n1 = srcChildren.length; i1 < n1; i1++){
|
|
28047
|
+
cloneEntity.addChild(srcChildren[i1]._createCloneEntity());
|
|
28048
|
+
}
|
|
28049
|
+
return cloneEntity;
|
|
28050
|
+
};
|
|
28051
|
+
_proto._parseCloneEntity = function _parseCloneEntity(src, target, srcRoot, targetRoot, deepInstanceMap) {
|
|
28052
|
+
var srcChildren = src._children;
|
|
28053
|
+
var targetChildren = target._children;
|
|
28054
|
+
for(var i = 0, n = srcChildren.length; i < n; i++){
|
|
28055
|
+
this._parseCloneEntity(srcChildren[i], targetChildren[i], srcRoot, targetRoot, deepInstanceMap);
|
|
28056
|
+
}
|
|
28057
|
+
var components = src._components;
|
|
28058
|
+
for(var i1 = 0, n1 = components.length; i1 < n1; i1++){
|
|
28059
|
+
ComponentCloner.cloneComponent(components[i1], target._components[i1], srcRoot, targetRoot, deepInstanceMap);
|
|
28060
|
+
}
|
|
28061
|
+
};
|
|
28062
|
+
/**
|
|
28063
|
+
* Destroy self.
|
|
28064
|
+
*/ _proto.destroy = function destroy() {
|
|
28065
|
+
EngineObject.prototype.destroy.call(this);
|
|
28066
|
+
if (!this._destroyed) {
|
|
28067
|
+
return;
|
|
28068
|
+
}
|
|
27366
28069
|
if (this._templateResource) {
|
|
27367
28070
|
this._isTemplate || this._templateResource._addReferCount(-1);
|
|
27368
28071
|
this._templateResource = null;
|
|
@@ -27626,833 +28329,145 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
27626
28329
|
this._traverseSetOwnerScene(children[i], scene);
|
|
27627
28330
|
}
|
|
27628
28331
|
};
|
|
27629
|
-
/**
|
|
27630
|
-
* @internal
|
|
27631
|
-
*/ Entity.
|
|
27632
|
-
|
|
27633
|
-
|
|
27634
|
-
var
|
|
27635
|
-
|
|
27636
|
-
|
|
27637
|
-
}
|
|
27638
|
-
inversePath.push(searchEntity.siblingIndex);
|
|
27639
|
-
searchEntity = parent;
|
|
27640
|
-
}
|
|
27641
|
-
return true;
|
|
27642
|
-
};
|
|
27643
|
-
/**
|
|
27644
|
-
* @internal
|
|
27645
|
-
*/ Entity._getEntityByHierarchyPath = function _getEntityByHierarchyPath(rootEntity, inversePath) {
|
|
27646
|
-
var entity = rootEntity;
|
|
27647
|
-
for(var i = inversePath.length - 1; i >= 0; i--){
|
|
27648
|
-
entity = entity.children[inversePath[i]];
|
|
27649
|
-
}
|
|
27650
|
-
return entity;
|
|
27651
|
-
};
|
|
27652
|
-
/**
|
|
27653
|
-
* @internal
|
|
27654
|
-
*/ Entity._removeFromChildren = function _removeFromChildren(children, entity) {
|
|
27655
|
-
var count = children.length - 1;
|
|
27656
|
-
for(var i = entity._siblingIndex; i < count; i++){
|
|
27657
|
-
var child = children[i + 1];
|
|
27658
|
-
children[i] = child;
|
|
27659
|
-
child._siblingIndex = i;
|
|
27660
|
-
}
|
|
27661
|
-
children.length = count;
|
|
27662
|
-
entity._siblingIndex = -1;
|
|
27663
|
-
};
|
|
27664
|
-
/**
|
|
27665
|
-
* @internal
|
|
27666
|
-
*/ Entity._addToChildren = function _addToChildren(children, entity, index) {
|
|
27667
|
-
var childCount = children.length;
|
|
27668
|
-
children.length = childCount + 1;
|
|
27669
|
-
if (index === undefined) {
|
|
27670
|
-
children[childCount] = entity;
|
|
27671
|
-
entity._siblingIndex = childCount;
|
|
27672
|
-
} else {
|
|
27673
|
-
if (index < 0 || index > childCount) {
|
|
27674
|
-
throw "The index " + index + " is out of child list bounds " + childCount;
|
|
27675
|
-
}
|
|
27676
|
-
for(var i = childCount; i > index; i--){
|
|
27677
|
-
var swapChild = children[i - 1];
|
|
27678
|
-
swapChild._siblingIndex = i;
|
|
27679
|
-
children[i] = swapChild;
|
|
27680
|
-
}
|
|
27681
|
-
entity._siblingIndex = index;
|
|
27682
|
-
children[index] = entity;
|
|
27683
|
-
}
|
|
27684
|
-
};
|
|
27685
|
-
_create_class$2(Entity, [
|
|
27686
|
-
{
|
|
27687
|
-
key: "transform",
|
|
27688
|
-
get: /**
|
|
27689
|
-
* The transform of this entity.
|
|
27690
|
-
*/ function get() {
|
|
27691
|
-
return this._transform;
|
|
27692
|
-
}
|
|
27693
|
-
},
|
|
27694
|
-
{
|
|
27695
|
-
key: "isActive",
|
|
27696
|
-
get: /**
|
|
27697
|
-
* Whether to activate locally.
|
|
27698
|
-
*/ function get() {
|
|
27699
|
-
return this._isActive;
|
|
27700
|
-
},
|
|
27701
|
-
set: function set(value) {
|
|
27702
|
-
if (value !== this._isActive) {
|
|
27703
|
-
this._isActive = value;
|
|
27704
|
-
if (value) {
|
|
27705
|
-
var parent = this._parent;
|
|
27706
|
-
var activeChangeFlag = ActiveChangeFlag.None;
|
|
27707
|
-
if (this._isRoot && this._scene._isActiveInEngine) {
|
|
27708
|
-
activeChangeFlag |= ActiveChangeFlag.All;
|
|
27709
|
-
} else {
|
|
27710
|
-
(parent == null ? void 0 : parent._isActiveInHierarchy) && (activeChangeFlag |= ActiveChangeFlag.Hierarchy);
|
|
27711
|
-
(parent == null ? void 0 : parent._isActiveInScene) && (activeChangeFlag |= ActiveChangeFlag.Scene);
|
|
27712
|
-
}
|
|
27713
|
-
activeChangeFlag && this._processActive(activeChangeFlag);
|
|
27714
|
-
} else {
|
|
27715
|
-
var activeChangeFlag1 = ActiveChangeFlag.None;
|
|
27716
|
-
this._isActiveInHierarchy && (activeChangeFlag1 |= ActiveChangeFlag.Hierarchy);
|
|
27717
|
-
this._isActiveInScene && (activeChangeFlag1 |= ActiveChangeFlag.Scene);
|
|
27718
|
-
activeChangeFlag1 && this._processInActive(activeChangeFlag1);
|
|
27719
|
-
}
|
|
27720
|
-
}
|
|
27721
|
-
}
|
|
27722
|
-
},
|
|
27723
|
-
{
|
|
27724
|
-
key: "isActiveInHierarchy",
|
|
27725
|
-
get: /**
|
|
27726
|
-
* Whether it is active in the hierarchy.
|
|
27727
|
-
*/ function get() {
|
|
27728
|
-
return this._isActiveInHierarchy;
|
|
27729
|
-
}
|
|
27730
|
-
},
|
|
27731
|
-
{
|
|
27732
|
-
key: "parent",
|
|
27733
|
-
get: /**
|
|
27734
|
-
* The parent entity.
|
|
27735
|
-
*/ function get() {
|
|
27736
|
-
return this._parent;
|
|
27737
|
-
},
|
|
27738
|
-
set: function set(value) {
|
|
27739
|
-
this._setParent(value);
|
|
27740
|
-
}
|
|
27741
|
-
},
|
|
27742
|
-
{
|
|
27743
|
-
key: "children",
|
|
27744
|
-
get: /**
|
|
27745
|
-
* The children entities
|
|
27746
|
-
*/ function get() {
|
|
27747
|
-
return this._children;
|
|
27748
|
-
}
|
|
27749
|
-
},
|
|
27750
|
-
{
|
|
27751
|
-
key: "childCount",
|
|
27752
|
-
get: /**
|
|
27753
|
-
* @deprecated Please use `children.length` property instead.
|
|
27754
|
-
* Number of the children entities
|
|
27755
|
-
*/ function get() {
|
|
27756
|
-
return this._children.length;
|
|
27757
|
-
}
|
|
27758
|
-
},
|
|
27759
|
-
{
|
|
27760
|
-
key: "scene",
|
|
27761
|
-
get: /**
|
|
27762
|
-
* The scene the entity belongs to.
|
|
27763
|
-
*/ function get() {
|
|
27764
|
-
return this._scene;
|
|
27765
|
-
}
|
|
27766
|
-
},
|
|
27767
|
-
{
|
|
27768
|
-
key: "siblingIndex",
|
|
27769
|
-
get: /**
|
|
27770
|
-
* The sibling index.
|
|
27771
|
-
*/ function get() {
|
|
27772
|
-
return this._siblingIndex;
|
|
27773
|
-
},
|
|
27774
|
-
set: function set(value) {
|
|
27775
|
-
if (this._siblingIndex === -1) {
|
|
27776
|
-
throw "The entity " + this.name + " is not in the hierarchy";
|
|
27777
|
-
}
|
|
27778
|
-
if (this._isRoot) {
|
|
27779
|
-
this._setSiblingIndex(this._scene._rootEntities, value);
|
|
27780
|
-
} else {
|
|
27781
|
-
var parent = this._parent;
|
|
27782
|
-
this._setSiblingIndex(parent._children, value);
|
|
27783
|
-
parent._dispatchModify(EntityModifyFlags.Child, parent);
|
|
27784
|
-
}
|
|
27785
|
-
}
|
|
27786
|
-
}
|
|
27787
|
-
]);
|
|
27788
|
-
return Entity;
|
|
27789
|
-
}(EngineObject);
|
|
27790
|
-
/** @internal */ Entity._tempComponentConstructors = [];
|
|
27791
|
-
/**
|
|
27792
|
-
* Skin used for skinned mesh renderer.
|
|
27793
|
-
*/ var Skin = /*#__PURE__*/ function(EngineObject) {
|
|
27794
|
-
_inherits$2(Skin, EngineObject);
|
|
27795
|
-
function Skin(name) {
|
|
27796
|
-
var _this;
|
|
27797
|
-
_this = EngineObject.call(this, null) || this, _this.name = name, _this.inverseBindMatrices = new Array(), _this._updatedManager = new UpdateFlagManager(), _this._bones = new Array(), _this._updateMark = -1, _this.joints = [];
|
|
27798
|
-
return _this;
|
|
27799
|
-
}
|
|
27800
|
-
var _proto = Skin.prototype;
|
|
27801
|
-
/**
|
|
27802
|
-
* @internal
|
|
27803
|
-
*/ _proto._updateSkinMatrices = function _updateSkinMatrices(renderer) {
|
|
27804
|
-
if (this._updateMark === renderer.engine.time.frameCount) {
|
|
27805
|
-
return;
|
|
27806
|
-
}
|
|
27807
|
-
var _this = this, bones = _this.bones, bindMatrices = _this.inverseBindMatrices, skinMatrices = _this._skinMatrices;
|
|
27808
|
-
var _this_rootBone;
|
|
27809
|
-
var worldToLocal = ((_this_rootBone = this.rootBone) != null ? _this_rootBone : renderer.entity).getInvModelMatrix();
|
|
27810
|
-
for(var i = bones.length - 1; i >= 0; i--){
|
|
27811
|
-
var bone = bones[i];
|
|
27812
|
-
var offset = i * 16;
|
|
27813
|
-
if (bone) {
|
|
27814
|
-
Utils._floatMatrixMultiply(bone.transform.worldMatrix, bindMatrices[i].elements, 0, skinMatrices, offset);
|
|
27815
|
-
} else {
|
|
27816
|
-
skinMatrices.set(bindMatrices[i].elements, offset);
|
|
27817
|
-
}
|
|
27818
|
-
Utils._floatMatrixMultiply(worldToLocal, skinMatrices, offset, skinMatrices, offset);
|
|
27819
|
-
}
|
|
27820
|
-
this._updateMark = renderer.engine.time.frameCount;
|
|
27821
|
-
};
|
|
27822
|
-
/**
|
|
27823
|
-
* @internal
|
|
27824
|
-
*/ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
|
|
27825
|
-
var paths = new Array();
|
|
27826
|
-
// Clone rootBone
|
|
27827
|
-
var rootBone = this.rootBone;
|
|
27828
|
-
if (rootBone) {
|
|
27829
|
-
var success = Entity._getEntityHierarchyPath(srcRoot, rootBone, paths);
|
|
27830
|
-
target.rootBone = success ? Entity._getEntityByHierarchyPath(targetRoot, paths) : rootBone;
|
|
27831
|
-
}
|
|
27832
|
-
// Clone bones
|
|
27833
|
-
var bones = this.bones;
|
|
27834
|
-
if (bones.length > 0) {
|
|
27835
|
-
var boneCount = bones.length;
|
|
27836
|
-
var destBones = new Array(boneCount);
|
|
27837
|
-
for(var i = 0; i < boneCount; i++){
|
|
27838
|
-
var bone = bones[i];
|
|
27839
|
-
var success1 = Entity._getEntityHierarchyPath(srcRoot, bone, paths);
|
|
27840
|
-
destBones[i] = success1 ? Entity._getEntityByHierarchyPath(targetRoot, paths) : bone;
|
|
27841
|
-
}
|
|
27842
|
-
target.bones = destBones;
|
|
27843
|
-
}
|
|
27844
|
-
};
|
|
27845
|
-
_create_class$2(Skin, [
|
|
27846
|
-
{
|
|
27847
|
-
key: "rootBone",
|
|
27848
|
-
get: /**
|
|
27849
|
-
* Root bone.
|
|
27850
|
-
*/ function get() {
|
|
27851
|
-
return this._rootBone;
|
|
27852
|
-
},
|
|
27853
|
-
set: function set(value) {
|
|
27854
|
-
if (this._rootBone !== value) {
|
|
27855
|
-
this._updatedManager.dispatch(1, value);
|
|
27856
|
-
this._rootBone = value;
|
|
27857
|
-
}
|
|
27858
|
-
}
|
|
27859
|
-
},
|
|
27860
|
-
{
|
|
27861
|
-
key: "bones",
|
|
27862
|
-
get: /**
|
|
27863
|
-
* Bones of the skin.
|
|
27864
|
-
*/ function get() {
|
|
27865
|
-
return this._bones;
|
|
27866
|
-
},
|
|
27867
|
-
set: function set(value) {
|
|
27868
|
-
var bones = this._bones;
|
|
27869
|
-
var _value_length;
|
|
27870
|
-
var boneCount = (_value_length = value == null ? void 0 : value.length) != null ? _value_length : 0;
|
|
27871
|
-
var lastBoneCount = bones.length;
|
|
27872
|
-
bones.length = boneCount;
|
|
27873
|
-
for(var i = 0; i < boneCount; i++){
|
|
27874
|
-
bones[i] = value[i];
|
|
27875
|
-
}
|
|
27876
|
-
if (lastBoneCount !== boneCount) {
|
|
27877
|
-
this._skinMatrices = new Float32Array(boneCount * 16);
|
|
27878
|
-
this._updatedManager.dispatch(0, boneCount);
|
|
27879
|
-
}
|
|
27880
|
-
}
|
|
27881
|
-
},
|
|
27882
|
-
{
|
|
27883
|
-
key: "skeleton",
|
|
27884
|
-
get: /** @deprecated Please use `rootBone` instead. */ function get() {
|
|
27885
|
-
var _this_rootBone;
|
|
27886
|
-
return (_this_rootBone = this.rootBone) == null ? void 0 : _this_rootBone.name;
|
|
27887
|
-
},
|
|
27888
|
-
set: function set(value) {
|
|
27889
|
-
var rootBone = this._rootBone;
|
|
27890
|
-
if (rootBone) {
|
|
27891
|
-
rootBone.name = value;
|
|
27892
|
-
}
|
|
27893
|
-
}
|
|
27894
|
-
}
|
|
27895
|
-
]);
|
|
27896
|
-
return Skin;
|
|
27897
|
-
}(EngineObject);
|
|
27898
|
-
__decorate$1([
|
|
27899
|
-
deepClone
|
|
27900
|
-
], Skin.prototype, "inverseBindMatrices", void 0);
|
|
27901
|
-
__decorate$1([
|
|
27902
|
-
ignoreClone
|
|
27903
|
-
], Skin.prototype, "_skinMatrices", void 0);
|
|
27904
|
-
__decorate$1([
|
|
27905
|
-
ignoreClone
|
|
27906
|
-
], Skin.prototype, "_updatedManager", void 0);
|
|
27907
|
-
__decorate$1([
|
|
27908
|
-
ignoreClone
|
|
27909
|
-
], Skin.prototype, "_rootBone", void 0);
|
|
27910
|
-
__decorate$1([
|
|
27911
|
-
ignoreClone
|
|
27912
|
-
], Skin.prototype, "_bones", void 0);
|
|
27913
|
-
__decorate$1([
|
|
27914
|
-
ignoreClone
|
|
27915
|
-
], Skin.prototype, "_updateMark", void 0);
|
|
27916
|
-
var SkinUpdateFlag = /*#__PURE__*/ function(SkinUpdateFlag) {
|
|
27917
|
-
SkinUpdateFlag[SkinUpdateFlag["BoneCountChanged"] = 0] = "BoneCountChanged";
|
|
27918
|
-
SkinUpdateFlag[SkinUpdateFlag["RootBoneChanged"] = 1] = "RootBoneChanged";
|
|
27919
|
-
return SkinUpdateFlag;
|
|
27920
|
-
}({});
|
|
27921
|
-
/**
|
|
27922
|
-
* SkinnedMeshRenderer.
|
|
27923
|
-
*/ var SkinnedMeshRenderer = /*#__PURE__*/ function(MeshRenderer) {
|
|
27924
|
-
_inherits$2(SkinnedMeshRenderer, MeshRenderer);
|
|
27925
|
-
function SkinnedMeshRenderer(entity) {
|
|
27926
|
-
var _this;
|
|
27927
|
-
_this = MeshRenderer.call(this, entity) || this, _this._localBounds = new BoundingBox(), _this._jointDataCreateCache = new Vector2(-1, -1);
|
|
27928
|
-
_this._skin = null;
|
|
27929
|
-
var rhi = _this.entity.engine._hardwareRenderer;
|
|
27930
|
-
var maxVertexUniformVectors = rhi.renderStates.getParameter(rhi.gl.MAX_VERTEX_UNIFORM_VECTORS);
|
|
27931
|
-
// Limit size to 256 to avoid some problem:
|
|
27932
|
-
// For renderer is "Apple GPU", when uniform is large than 256 the skeleton matrix array access in shader very slow in Safari or WKWebview. This may be a apple bug, Chrome and Firefox is OK!
|
|
27933
|
-
// For renderer is "ANGLE (AMD, AMD Radeon(TM) Graphics Direct3011 vs_5_0 ps_5_0, D3011)", compile shader si very slow because of max uniform is 4096.
|
|
27934
|
-
maxVertexUniformVectors = Math.min(maxVertexUniformVectors, rhi._options._maxAllowSkinUniformVectorCount);
|
|
27935
|
-
_this._maxVertexUniformVectors = maxVertexUniformVectors;
|
|
27936
|
-
_this._onLocalBoundsChanged = _this._onLocalBoundsChanged.bind(_this);
|
|
27937
|
-
_this._onSkinUpdated = _this._onSkinUpdated.bind(_this);
|
|
27938
|
-
var localBounds = _this._localBounds;
|
|
27939
|
-
// @ts-ignore
|
|
27940
|
-
localBounds.min._onValueChanged = _this._onLocalBoundsChanged;
|
|
27941
|
-
// @ts-ignore
|
|
27942
|
-
localBounds.max._onValueChanged = _this._onLocalBoundsChanged;
|
|
27943
|
-
return _this;
|
|
27944
|
-
}
|
|
27945
|
-
var _proto = SkinnedMeshRenderer.prototype;
|
|
27946
|
-
/**
|
|
27947
|
-
* @internal
|
|
27948
|
-
*/ _proto._onDestroy = function _onDestroy() {
|
|
27949
|
-
var _this__jointTexture;
|
|
27950
|
-
MeshRenderer.prototype._onDestroy.call(this);
|
|
27951
|
-
this._jointDataCreateCache = null;
|
|
27952
|
-
this._skin = null;
|
|
27953
|
-
this._blendShapeWeights = null;
|
|
27954
|
-
this._localBounds = null;
|
|
27955
|
-
(_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
|
|
27956
|
-
this._jointTexture = null;
|
|
27957
|
-
};
|
|
27958
|
-
/**
|
|
27959
|
-
* @internal
|
|
27960
|
-
*/ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
|
|
27961
|
-
MeshRenderer.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
|
|
27962
|
-
if (this.skin) {
|
|
27963
|
-
target._applySkin(null, target.skin);
|
|
27964
|
-
}
|
|
27965
|
-
this._blendShapeWeights && (target._blendShapeWeights = this._blendShapeWeights.slice());
|
|
27966
|
-
};
|
|
27967
|
-
_proto._update = function _update(context) {
|
|
27968
|
-
var skin = this.skin;
|
|
27969
|
-
if ((skin == null ? void 0 : skin.bones.length) > 0) {
|
|
27970
|
-
skin._updateSkinMatrices(this);
|
|
27971
|
-
}
|
|
27972
|
-
var shaderData = this.shaderData;
|
|
27973
|
-
var mesh = this.mesh;
|
|
27974
|
-
var blendShapeManager = mesh._blendShapeManager;
|
|
27975
|
-
blendShapeManager._updateShaderData(shaderData, this);
|
|
27976
|
-
var bones = skin == null ? void 0 : skin.bones;
|
|
27977
|
-
if (bones) {
|
|
27978
|
-
var bsUniformOccupiesCount = blendShapeManager._uniformOccupiesCount;
|
|
27979
|
-
var boneCount = bones.length;
|
|
27980
|
-
var boneDataCreateCache = this._jointDataCreateCache;
|
|
27981
|
-
var boneCountChange = boneCount !== boneDataCreateCache.x;
|
|
27982
|
-
if (boneCountChange || bsUniformOccupiesCount !== boneDataCreateCache.y) {
|
|
27983
|
-
// directly use max joint count to avoid shader recompile
|
|
27984
|
-
var remainUniformJointCount = Math.ceil((this._maxVertexUniformVectors - (SkinnedMeshRenderer._baseVertexUniformVectorCount + bsUniformOccupiesCount)) / 4);
|
|
27985
|
-
if (boneCount > remainUniformJointCount) {
|
|
27986
|
-
var engine = this.engine;
|
|
27987
|
-
if (engine._hardwareRenderer.canIUseMoreJoints) {
|
|
27988
|
-
if (boneCountChange) {
|
|
27989
|
-
var _this__jointTexture;
|
|
27990
|
-
(_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
|
|
27991
|
-
this._jointTexture = new Texture2D(engine, 4, boneCount, TextureFormat.R32G32B32A32, false, false);
|
|
27992
|
-
this._jointTexture.filterMode = TextureFilterMode.Point;
|
|
27993
|
-
this._jointTexture.isGCIgnored = true;
|
|
27994
|
-
}
|
|
27995
|
-
shaderData.disableMacro("RENDERER_JOINTS_NUM");
|
|
27996
|
-
shaderData.enableMacro("RENDERER_USE_JOINT_TEXTURE");
|
|
27997
|
-
shaderData.setTexture(SkinnedMeshRenderer._jointSamplerProperty, this._jointTexture);
|
|
27998
|
-
} else {
|
|
27999
|
-
Logger.error("component's joints count(" + boneCount + ") greater than device's MAX_VERTEX_UNIFORM_VECTORS number " + this._maxVertexUniformVectors + ", and don't support jointTexture in this device. suggest joint count less than " + remainUniformJointCount + ".", this);
|
|
28000
|
-
}
|
|
28001
|
-
} else {
|
|
28002
|
-
var _this__jointTexture1;
|
|
28003
|
-
(_this__jointTexture1 = this._jointTexture) == null ? void 0 : _this__jointTexture1.destroy();
|
|
28004
|
-
shaderData.disableMacro("RENDERER_USE_JOINT_TEXTURE");
|
|
28005
|
-
shaderData.enableMacro("RENDERER_JOINTS_NUM", remainUniformJointCount.toString());
|
|
28006
|
-
shaderData.setFloatArray(SkinnedMeshRenderer._jointMatrixProperty, skin._skinMatrices);
|
|
28007
|
-
}
|
|
28008
|
-
boneDataCreateCache.set(boneCount, bsUniformOccupiesCount);
|
|
28009
|
-
}
|
|
28010
|
-
if (this._jointTexture) {
|
|
28011
|
-
this._jointTexture.setPixelBuffer(skin._skinMatrices);
|
|
28012
|
-
}
|
|
28013
|
-
}
|
|
28014
|
-
MeshRenderer.prototype._update.call(this, context);
|
|
28015
|
-
};
|
|
28016
|
-
/**
|
|
28017
|
-
* @internal
|
|
28018
|
-
*/ _proto._updateBounds = function _updateBounds(worldBounds) {
|
|
28019
|
-
var _this_skin;
|
|
28020
|
-
var rootBone = (_this_skin = this.skin) == null ? void 0 : _this_skin.rootBone;
|
|
28021
|
-
if (rootBone) {
|
|
28022
|
-
BoundingBox.transform(this._localBounds, this._transformEntity.transform.worldMatrix, worldBounds);
|
|
28023
|
-
} else {
|
|
28024
|
-
MeshRenderer.prototype._updateBounds.call(this, worldBounds);
|
|
28025
|
-
}
|
|
28026
|
-
};
|
|
28027
|
-
_proto._checkBlendShapeWeightLength = function _checkBlendShapeWeightLength() {
|
|
28028
|
-
var mesh = this._mesh;
|
|
28029
|
-
var newBlendShapeCount = mesh ? mesh.blendShapeCount : 0;
|
|
28030
|
-
var lastBlendShapeWeights = this._blendShapeWeights;
|
|
28031
|
-
if (lastBlendShapeWeights) {
|
|
28032
|
-
var lastBlendShapeWeightsCount = lastBlendShapeWeights.length;
|
|
28033
|
-
if (lastBlendShapeWeightsCount !== newBlendShapeCount) {
|
|
28034
|
-
var newBlendShapeWeights = new Float32Array(newBlendShapeCount);
|
|
28035
|
-
if (newBlendShapeCount > lastBlendShapeWeightsCount) {
|
|
28036
|
-
newBlendShapeWeights.set(lastBlendShapeWeights);
|
|
28037
|
-
} else {
|
|
28038
|
-
for(var i = 0; i < newBlendShapeCount; i++){
|
|
28039
|
-
newBlendShapeWeights[i] = lastBlendShapeWeights[i];
|
|
28040
|
-
}
|
|
28041
|
-
}
|
|
28042
|
-
this._blendShapeWeights = newBlendShapeWeights;
|
|
28043
|
-
}
|
|
28044
|
-
} else {
|
|
28045
|
-
this._blendShapeWeights = new Float32Array(newBlendShapeCount);
|
|
28046
|
-
}
|
|
28047
|
-
};
|
|
28048
|
-
_proto._onLocalBoundsChanged = function _onLocalBoundsChanged() {
|
|
28049
|
-
this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
|
|
28050
|
-
};
|
|
28051
|
-
_proto._onSkinUpdated = function _onSkinUpdated(type, value) {
|
|
28052
|
-
switch(type){
|
|
28053
|
-
case SkinUpdateFlag.BoneCountChanged:
|
|
28054
|
-
var shaderData = this.shaderData;
|
|
28055
|
-
if (value > 0) {
|
|
28056
|
-
shaderData.enableMacro("RENDERER_HAS_SKIN");
|
|
28057
|
-
shaderData.setInt(SkinnedMeshRenderer._jointCountProperty, value);
|
|
28058
|
-
} else {
|
|
28059
|
-
shaderData.disableMacro("RENDERER_HAS_SKIN");
|
|
28060
|
-
}
|
|
28061
|
-
break;
|
|
28062
|
-
case SkinUpdateFlag.RootBoneChanged:
|
|
28063
|
-
this._setTransformEntity(value);
|
|
28064
|
-
this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
|
|
28065
|
-
break;
|
|
28066
|
-
}
|
|
28067
|
-
};
|
|
28068
|
-
_proto._applySkin = function _applySkin(lastSkin, value) {
|
|
28069
|
-
var _lastSkin_bones, _value_bones;
|
|
28070
|
-
var _lastSkin_bones_length;
|
|
28071
|
-
var lastSkinBoneCount = (_lastSkin_bones_length = lastSkin == null ? void 0 : (_lastSkin_bones = lastSkin.bones) == null ? void 0 : _lastSkin_bones.length) != null ? _lastSkin_bones_length : 0;
|
|
28072
|
-
var _lastSkin_rootBone;
|
|
28073
|
-
var lastRootBone = (_lastSkin_rootBone = lastSkin == null ? void 0 : lastSkin.rootBone) != null ? _lastSkin_rootBone : this.entity;
|
|
28074
|
-
lastSkin == null ? void 0 : lastSkin._updatedManager.removeListener(this._onSkinUpdated);
|
|
28075
|
-
var _value_bones_length;
|
|
28076
|
-
var skinBoneCount = (_value_bones_length = value == null ? void 0 : (_value_bones = value.bones) == null ? void 0 : _value_bones.length) != null ? _value_bones_length : 0;
|
|
28077
|
-
var _value_rootBone;
|
|
28078
|
-
var rootBone = (_value_rootBone = value == null ? void 0 : value.rootBone) != null ? _value_rootBone : this.entity;
|
|
28079
|
-
value == null ? void 0 : value._updatedManager.addListener(this._onSkinUpdated);
|
|
28080
|
-
if (lastSkinBoneCount !== skinBoneCount) {
|
|
28081
|
-
this._onSkinUpdated(SkinUpdateFlag.BoneCountChanged, skinBoneCount);
|
|
28332
|
+
/**
|
|
28333
|
+
* @internal
|
|
28334
|
+
*/ Entity._removeFromChildren = function _removeFromChildren(children, entity) {
|
|
28335
|
+
var count = children.length - 1;
|
|
28336
|
+
for(var i = entity._siblingIndex; i < count; i++){
|
|
28337
|
+
var child = children[i + 1];
|
|
28338
|
+
children[i] = child;
|
|
28339
|
+
child._siblingIndex = i;
|
|
28082
28340
|
}
|
|
28083
|
-
|
|
28084
|
-
|
|
28341
|
+
children.length = count;
|
|
28342
|
+
entity._siblingIndex = -1;
|
|
28343
|
+
};
|
|
28344
|
+
/**
|
|
28345
|
+
* @internal
|
|
28346
|
+
*/ Entity._addToChildren = function _addToChildren(children, entity, index) {
|
|
28347
|
+
var childCount = children.length;
|
|
28348
|
+
children.length = childCount + 1;
|
|
28349
|
+
if (index === undefined) {
|
|
28350
|
+
children[childCount] = entity;
|
|
28351
|
+
entity._siblingIndex = childCount;
|
|
28352
|
+
} else {
|
|
28353
|
+
if (index < 0 || index > childCount) {
|
|
28354
|
+
throw "The index " + index + " is out of child list bounds " + childCount;
|
|
28355
|
+
}
|
|
28356
|
+
for(var i = childCount; i > index; i--){
|
|
28357
|
+
var swapChild = children[i - 1];
|
|
28358
|
+
swapChild._siblingIndex = i;
|
|
28359
|
+
children[i] = swapChild;
|
|
28360
|
+
}
|
|
28361
|
+
entity._siblingIndex = index;
|
|
28362
|
+
children[index] = entity;
|
|
28085
28363
|
}
|
|
28086
28364
|
};
|
|
28087
|
-
_create_class$2(
|
|
28365
|
+
_create_class$2(Entity, [
|
|
28088
28366
|
{
|
|
28089
|
-
key: "
|
|
28367
|
+
key: "transform",
|
|
28090
28368
|
get: /**
|
|
28091
|
-
*
|
|
28369
|
+
* The transform of this entity.
|
|
28092
28370
|
*/ function get() {
|
|
28093
|
-
return this.
|
|
28094
|
-
},
|
|
28095
|
-
set: function set(value) {
|
|
28096
|
-
var lastSkin = this._skin;
|
|
28097
|
-
if (lastSkin !== value) {
|
|
28098
|
-
this._applySkin(lastSkin, value);
|
|
28099
|
-
this._skin = value;
|
|
28100
|
-
}
|
|
28371
|
+
return this._transform;
|
|
28101
28372
|
}
|
|
28102
28373
|
},
|
|
28103
28374
|
{
|
|
28104
|
-
key: "
|
|
28375
|
+
key: "isActive",
|
|
28105
28376
|
get: /**
|
|
28106
|
-
*
|
|
28107
|
-
* @remarks Array index is BlendShape index.
|
|
28377
|
+
* Whether to activate locally.
|
|
28108
28378
|
*/ function get() {
|
|
28109
|
-
this.
|
|
28110
|
-
return this._blendShapeWeights;
|
|
28379
|
+
return this._isActive;
|
|
28111
28380
|
},
|
|
28112
28381
|
set: function set(value) {
|
|
28113
|
-
this.
|
|
28114
|
-
|
|
28115
|
-
|
|
28116
|
-
|
|
28117
|
-
|
|
28118
|
-
|
|
28119
|
-
|
|
28382
|
+
if (value !== this._isActive) {
|
|
28383
|
+
this._isActive = value;
|
|
28384
|
+
if (value) {
|
|
28385
|
+
var parent = this._parent;
|
|
28386
|
+
var activeChangeFlag = ActiveChangeFlag.None;
|
|
28387
|
+
if (this._isRoot && this._scene._isActiveInEngine) {
|
|
28388
|
+
activeChangeFlag |= ActiveChangeFlag.All;
|
|
28389
|
+
} else {
|
|
28390
|
+
(parent == null ? void 0 : parent._isActiveInHierarchy) && (activeChangeFlag |= ActiveChangeFlag.Hierarchy);
|
|
28391
|
+
(parent == null ? void 0 : parent._isActiveInScene) && (activeChangeFlag |= ActiveChangeFlag.Scene);
|
|
28392
|
+
}
|
|
28393
|
+
activeChangeFlag && this._processActive(activeChangeFlag);
|
|
28394
|
+
} else {
|
|
28395
|
+
var activeChangeFlag1 = ActiveChangeFlag.None;
|
|
28396
|
+
this._isActiveInHierarchy && (activeChangeFlag1 |= ActiveChangeFlag.Hierarchy);
|
|
28397
|
+
this._isActiveInScene && (activeChangeFlag1 |= ActiveChangeFlag.Scene);
|
|
28398
|
+
activeChangeFlag1 && this._processInActive(activeChangeFlag1);
|
|
28120
28399
|
}
|
|
28121
28400
|
}
|
|
28122
28401
|
}
|
|
28123
28402
|
},
|
|
28124
28403
|
{
|
|
28125
|
-
key: "
|
|
28404
|
+
key: "isActiveInHierarchy",
|
|
28126
28405
|
get: /**
|
|
28127
|
-
*
|
|
28406
|
+
* Whether it is active in the hierarchy.
|
|
28128
28407
|
*/ function get() {
|
|
28129
|
-
return this.
|
|
28130
|
-
},
|
|
28131
|
-
set: function set(value) {
|
|
28132
|
-
if (this._localBounds !== value) {
|
|
28133
|
-
this._localBounds.copyFrom(value);
|
|
28134
|
-
}
|
|
28408
|
+
return this._isActiveInHierarchy;
|
|
28135
28409
|
}
|
|
28136
28410
|
},
|
|
28137
28411
|
{
|
|
28138
|
-
key: "
|
|
28412
|
+
key: "parent",
|
|
28139
28413
|
get: /**
|
|
28140
|
-
*
|
|
28414
|
+
* The parent entity.
|
|
28141
28415
|
*/ function get() {
|
|
28142
|
-
return this.
|
|
28416
|
+
return this._parent;
|
|
28143
28417
|
},
|
|
28144
28418
|
set: function set(value) {
|
|
28145
|
-
this.
|
|
28419
|
+
this._setParent(value);
|
|
28146
28420
|
}
|
|
28147
28421
|
},
|
|
28148
28422
|
{
|
|
28149
|
-
key: "
|
|
28423
|
+
key: "children",
|
|
28150
28424
|
get: /**
|
|
28151
|
-
*
|
|
28425
|
+
* The children entities
|
|
28152
28426
|
*/ function get() {
|
|
28153
|
-
return this.
|
|
28154
|
-
},
|
|
28155
|
-
set: function set(value) {
|
|
28156
|
-
this.skin.bones = value;
|
|
28157
|
-
}
|
|
28158
|
-
}
|
|
28159
|
-
]);
|
|
28160
|
-
return SkinnedMeshRenderer;
|
|
28161
|
-
}(MeshRenderer);
|
|
28162
|
-
// @TODO: different shader type should use different count, not always 48
|
|
28163
|
-
/** @internal */ SkinnedMeshRenderer._baseVertexUniformVectorCount = 48;
|
|
28164
|
-
SkinnedMeshRenderer._jointCountProperty = ShaderProperty.getByName("renderer_JointCount");
|
|
28165
|
-
SkinnedMeshRenderer._jointSamplerProperty = ShaderProperty.getByName("renderer_JointSampler");
|
|
28166
|
-
SkinnedMeshRenderer._jointMatrixProperty = ShaderProperty.getByName("renderer_JointMatrix");
|
|
28167
|
-
__decorate$1([
|
|
28168
|
-
ignoreClone
|
|
28169
|
-
], SkinnedMeshRenderer.prototype, "_condensedBlendShapeWeights", void 0);
|
|
28170
|
-
__decorate$1([
|
|
28171
|
-
deepClone
|
|
28172
|
-
], SkinnedMeshRenderer.prototype, "_localBounds", void 0);
|
|
28173
|
-
__decorate$1([
|
|
28174
|
-
ignoreClone
|
|
28175
|
-
], SkinnedMeshRenderer.prototype, "_jointDataCreateCache", void 0);
|
|
28176
|
-
__decorate$1([
|
|
28177
|
-
ignoreClone
|
|
28178
|
-
], SkinnedMeshRenderer.prototype, "_blendShapeWeights", void 0);
|
|
28179
|
-
__decorate$1([
|
|
28180
|
-
ignoreClone
|
|
28181
|
-
], SkinnedMeshRenderer.prototype, "_maxVertexUniformVectors", void 0);
|
|
28182
|
-
__decorate$1([
|
|
28183
|
-
ignoreClone
|
|
28184
|
-
], SkinnedMeshRenderer.prototype, "_jointTexture", void 0);
|
|
28185
|
-
__decorate$1([
|
|
28186
|
-
deepClone
|
|
28187
|
-
], SkinnedMeshRenderer.prototype, "_skin", void 0);
|
|
28188
|
-
__decorate$1([
|
|
28189
|
-
ignoreClone
|
|
28190
|
-
], SkinnedMeshRenderer.prototype, "_onLocalBoundsChanged", null);
|
|
28191
|
-
__decorate$1([
|
|
28192
|
-
ignoreClone
|
|
28193
|
-
], SkinnedMeshRenderer.prototype, "_onSkinUpdated", null);
|
|
28194
|
-
/**
|
|
28195
|
-
* @internal
|
|
28196
|
-
*/ var BasicResources = /*#__PURE__*/ function() {
|
|
28197
|
-
function BasicResources(engine) {
|
|
28198
|
-
this.engine = engine;
|
|
28199
|
-
// prettier-ignore
|
|
28200
|
-
var vertices = new Float32Array([
|
|
28201
|
-
-1,
|
|
28202
|
-
-1,
|
|
28203
|
-
0,
|
|
28204
|
-
1,
|
|
28205
|
-
3,
|
|
28206
|
-
-1,
|
|
28207
|
-
2,
|
|
28208
|
-
1,
|
|
28209
|
-
-1,
|
|
28210
|
-
3,
|
|
28211
|
-
0,
|
|
28212
|
-
-1
|
|
28213
|
-
]); // left-top
|
|
28214
|
-
// prettier-ignore
|
|
28215
|
-
var flipYVertices = new Float32Array([
|
|
28216
|
-
3,
|
|
28217
|
-
-1,
|
|
28218
|
-
2,
|
|
28219
|
-
0,
|
|
28220
|
-
-1,
|
|
28221
|
-
-1,
|
|
28222
|
-
0,
|
|
28223
|
-
0,
|
|
28224
|
-
-1,
|
|
28225
|
-
3,
|
|
28226
|
-
0,
|
|
28227
|
-
2
|
|
28228
|
-
]); // left-top
|
|
28229
|
-
var blitMaterial = new Material(engine, Shader.find("blit"));
|
|
28230
|
-
blitMaterial._addReferCount(1);
|
|
28231
|
-
blitMaterial.renderState.depthState.enabled = false;
|
|
28232
|
-
blitMaterial.renderState.depthState.writeEnabled = false;
|
|
28233
|
-
var blitScreenMaterial = new Material(engine, Shader.find("blit-screen"));
|
|
28234
|
-
blitScreenMaterial._addReferCount(1);
|
|
28235
|
-
blitScreenMaterial.renderState.depthState.enabled = false;
|
|
28236
|
-
blitScreenMaterial.renderState.depthState.writeEnabled = false;
|
|
28237
|
-
this.blitMaterial = blitMaterial;
|
|
28238
|
-
this.blitScreenMaterial = blitScreenMaterial;
|
|
28239
|
-
this.blitMesh = this._createBlitMesh(engine, vertices);
|
|
28240
|
-
this.flipYBlitMesh = this._createBlitMesh(engine, flipYVertices);
|
|
28241
|
-
// Create white and magenta textures
|
|
28242
|
-
var whitePixel = new Uint8Array([
|
|
28243
|
-
255,
|
|
28244
|
-
255,
|
|
28245
|
-
255,
|
|
28246
|
-
255
|
|
28247
|
-
]);
|
|
28248
|
-
this.whiteTexture2D = this._create1x1Texture(engine, 0, TextureFormat.R8G8B8A8, whitePixel, true);
|
|
28249
|
-
this.whiteTextureCube = this._create1x1Texture(engine, 1, TextureFormat.R8G8B8A8, whitePixel, true);
|
|
28250
|
-
var isWebGL2 = engine._hardwareRenderer.isWebGL2;
|
|
28251
|
-
if (isWebGL2) {
|
|
28252
|
-
this.whiteTexture2DArray = this._create1x1Texture(engine, 2, TextureFormat.R8G8B8A8, whitePixel, true);
|
|
28253
|
-
var whitePixel32 = new Uint32Array([
|
|
28254
|
-
255,
|
|
28255
|
-
255,
|
|
28256
|
-
255,
|
|
28257
|
-
255
|
|
28258
|
-
]);
|
|
28259
|
-
this.uintWhiteTexture2D = this._create1x1Texture(engine, 0, TextureFormat.R32G32B32A32_UInt, whitePixel32, false);
|
|
28260
|
-
}
|
|
28261
|
-
this.spriteDefaultMaterial = this._create2DMaterial(engine, Shader.find("Sprite"));
|
|
28262
|
-
this.textDefaultMaterial = this._create2DMaterial(engine, Shader.find("Text"));
|
|
28263
|
-
this.spriteMaskDefaultMaterial = this._createSpriteMaskMaterial(engine);
|
|
28264
|
-
this.meshMagentaMaterial = this._createMagentaMaterial(engine, "unlit");
|
|
28265
|
-
this.particleMagentaMaterial = this._createMagentaMaterial(engine, "particle-shader");
|
|
28266
|
-
}
|
|
28267
|
-
var _proto = BasicResources.prototype;
|
|
28268
|
-
/**
|
|
28269
|
-
* @internal
|
|
28270
|
-
*/ _proto._getBlinnPhongMaterial = function _getBlinnPhongMaterial() {
|
|
28271
|
-
return this._blinnPhongMaterial || (this._blinnPhongMaterial = new BlinnPhongMaterial(this.engine));
|
|
28272
|
-
};
|
|
28273
|
-
/**
|
|
28274
|
-
* @internal
|
|
28275
|
-
*/ _proto._initialize = function _initialize() {
|
|
28276
|
-
var _this = this;
|
|
28277
|
-
return new Promise(function(resolve, reject) {
|
|
28278
|
-
PrefilteredDFG.create(_this.engine).then(function(texture) {
|
|
28279
|
-
_this._prefilteredDFGTexture = texture;
|
|
28280
|
-
resolve(_this);
|
|
28281
|
-
}).catch(reject);
|
|
28282
|
-
});
|
|
28283
|
-
};
|
|
28284
|
-
_proto._createBlitMesh = function _createBlitMesh(engine, vertices) {
|
|
28285
|
-
var mesh = new ModelMesh(engine);
|
|
28286
|
-
mesh._addReferCount(1);
|
|
28287
|
-
mesh.setVertexElements([
|
|
28288
|
-
new VertexElement("POSITION_UV", 0, VertexElementFormat.Vector4, 0)
|
|
28289
|
-
]);
|
|
28290
|
-
var buffer = new Buffer(engine, BufferBindFlag.VertexBuffer, vertices, BufferUsage.Static, true);
|
|
28291
|
-
mesh.setVertexBufferBinding(buffer, 16);
|
|
28292
|
-
mesh.addSubMesh(0, 3, MeshTopology.Triangles);
|
|
28293
|
-
engine.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
|
|
28294
|
-
_inherits$2(_class, ContentRestorer);
|
|
28295
|
-
function _class() {
|
|
28296
|
-
return ContentRestorer.call(this, mesh) || this;
|
|
28297
|
-
}
|
|
28298
|
-
var _proto = _class.prototype;
|
|
28299
|
-
_proto.restoreContent = function restoreContent() {
|
|
28300
|
-
buffer.setData(buffer.data);
|
|
28301
|
-
};
|
|
28302
|
-
return _class;
|
|
28303
|
-
}(ContentRestorer))());
|
|
28304
|
-
return mesh;
|
|
28305
|
-
};
|
|
28306
|
-
_proto._create1x1Texture = function _create1x1Texture(engine, type, format, pixel, isSRGBColorSpace) {
|
|
28307
|
-
var texture;
|
|
28308
|
-
switch(type){
|
|
28309
|
-
case 0:
|
|
28310
|
-
var texture2D = new Texture2D(engine, 1, 1, format, false, isSRGBColorSpace);
|
|
28311
|
-
texture2D.setPixelBuffer(pixel);
|
|
28312
|
-
texture = texture2D;
|
|
28313
|
-
break;
|
|
28314
|
-
case 2:
|
|
28315
|
-
var texture2DArray = new Texture2DArray(engine, 1, 1, 1, format, false, isSRGBColorSpace);
|
|
28316
|
-
texture2DArray.setPixelBuffer(0, pixel);
|
|
28317
|
-
texture = texture2DArray;
|
|
28318
|
-
break;
|
|
28319
|
-
case 1:
|
|
28320
|
-
var textureCube = new TextureCube(engine, 1, format, false, isSRGBColorSpace);
|
|
28321
|
-
for(var i = 0; i < 6; i++){
|
|
28322
|
-
textureCube.setPixelBuffer(TextureCubeFace.PositiveX + i, pixel);
|
|
28323
|
-
}
|
|
28324
|
-
texture = textureCube;
|
|
28325
|
-
break;
|
|
28326
|
-
default:
|
|
28327
|
-
throw "Invalid texture type";
|
|
28328
|
-
}
|
|
28329
|
-
texture.isGCIgnored = true;
|
|
28330
|
-
engine.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
|
|
28331
|
-
_inherits$2(_class, ContentRestorer);
|
|
28332
|
-
function _class() {
|
|
28333
|
-
return ContentRestorer.call(this, texture) || this;
|
|
28334
|
-
}
|
|
28335
|
-
var _proto = _class.prototype;
|
|
28336
|
-
_proto.restoreContent = function restoreContent() {
|
|
28337
|
-
switch(type){
|
|
28338
|
-
case 0:
|
|
28339
|
-
this.resource.setPixelBuffer(pixel);
|
|
28340
|
-
break;
|
|
28341
|
-
case 2:
|
|
28342
|
-
this.resource.setPixelBuffer(0, pixel);
|
|
28343
|
-
break;
|
|
28344
|
-
case 1:
|
|
28345
|
-
for(var i = 0; i < 6; i++){
|
|
28346
|
-
this.resource.setPixelBuffer(TextureCubeFace.PositiveX + i, pixel);
|
|
28347
|
-
}
|
|
28348
|
-
break;
|
|
28349
|
-
}
|
|
28350
|
-
};
|
|
28351
|
-
return _class;
|
|
28352
|
-
}(ContentRestorer))());
|
|
28353
|
-
return texture;
|
|
28354
|
-
};
|
|
28355
|
-
_proto._create2DMaterial = function _create2DMaterial(engine, shader) {
|
|
28356
|
-
var material = new Material(engine, shader);
|
|
28357
|
-
var renderState = material.renderState;
|
|
28358
|
-
var target = renderState.blendState.targetBlendState;
|
|
28359
|
-
target.enabled = true;
|
|
28360
|
-
target.sourceColorBlendFactor = BlendFactor.SourceAlpha;
|
|
28361
|
-
target.destinationColorBlendFactor = BlendFactor.OneMinusSourceAlpha;
|
|
28362
|
-
target.sourceAlphaBlendFactor = BlendFactor.One;
|
|
28363
|
-
target.destinationAlphaBlendFactor = BlendFactor.OneMinusSourceAlpha;
|
|
28364
|
-
target.colorBlendOperation = target.alphaBlendOperation = BlendOperation.Add;
|
|
28365
|
-
renderState.depthState.writeEnabled = false;
|
|
28366
|
-
renderState.rasterState.cullMode = CullMode.Off;
|
|
28367
|
-
renderState.renderQueueType = RenderQueueType.Transparent;
|
|
28368
|
-
material.isGCIgnored = true;
|
|
28369
|
-
return material;
|
|
28370
|
-
};
|
|
28371
|
-
_proto._createMagentaMaterial = function _createMagentaMaterial(engine, shaderName) {
|
|
28372
|
-
var material = new Material(engine, Shader.find(shaderName));
|
|
28373
|
-
material.isGCIgnored = true;
|
|
28374
|
-
material.shaderData.setColor("material_BaseColor", new Color(1.0, 0.0, 1.01, 1.0));
|
|
28375
|
-
return material;
|
|
28376
|
-
};
|
|
28377
|
-
_proto._createSpriteMaskMaterial = function _createSpriteMaskMaterial(engine) {
|
|
28378
|
-
var material = new Material(engine, Shader.find("SpriteMask"));
|
|
28379
|
-
material.isGCIgnored = true;
|
|
28380
|
-
return material;
|
|
28381
|
-
};
|
|
28382
|
-
BasicResources.getMaskInteractionRenderStates = function getMaskInteractionRenderStates(maskInteraction) {
|
|
28383
|
-
var visibleInsideMask = maskInteraction === SpriteMaskInteraction.VisibleInsideMask;
|
|
28384
|
-
var renderStates;
|
|
28385
|
-
var compareFunction;
|
|
28386
|
-
if (visibleInsideMask) {
|
|
28387
|
-
renderStates = BasicResources._maskReadInsideRenderStates;
|
|
28388
|
-
if (renderStates) {
|
|
28389
|
-
return renderStates;
|
|
28390
|
-
}
|
|
28391
|
-
BasicResources._maskReadInsideRenderStates = renderStates = {};
|
|
28392
|
-
compareFunction = CompareFunction.LessEqual;
|
|
28393
|
-
} else {
|
|
28394
|
-
renderStates = BasicResources._maskReadOutsideRenderStates;
|
|
28395
|
-
if (renderStates) {
|
|
28396
|
-
return renderStates;
|
|
28427
|
+
return this._children;
|
|
28397
28428
|
}
|
|
28398
|
-
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
|
|
28403
|
-
|
|
28404
|
-
|
|
28405
|
-
|
|
28406
|
-
return renderStates;
|
|
28407
|
-
};
|
|
28408
|
-
BasicResources.getMaskTypeRenderStates = function getMaskTypeRenderStates(maskType) {
|
|
28409
|
-
var isIncrement = maskType === RenderQueueMaskType.Increment;
|
|
28410
|
-
var renderStates;
|
|
28411
|
-
var passOperation;
|
|
28412
|
-
if (isIncrement) {
|
|
28413
|
-
renderStates = BasicResources._maskWriteIncrementRenderStates;
|
|
28414
|
-
if (renderStates) {
|
|
28415
|
-
return renderStates;
|
|
28429
|
+
},
|
|
28430
|
+
{
|
|
28431
|
+
key: "childCount",
|
|
28432
|
+
get: /**
|
|
28433
|
+
* @deprecated Please use `children.length` property instead.
|
|
28434
|
+
* Number of the children entities
|
|
28435
|
+
*/ function get() {
|
|
28436
|
+
return this._children.length;
|
|
28416
28437
|
}
|
|
28417
|
-
|
|
28418
|
-
|
|
28419
|
-
|
|
28420
|
-
|
|
28421
|
-
|
|
28422
|
-
|
|
28438
|
+
},
|
|
28439
|
+
{
|
|
28440
|
+
key: "scene",
|
|
28441
|
+
get: /**
|
|
28442
|
+
* The scene the entity belongs to.
|
|
28443
|
+
*/ function get() {
|
|
28444
|
+
return this._scene;
|
|
28423
28445
|
}
|
|
28424
|
-
|
|
28425
|
-
passOperation = StencilOperation.DecrementSaturate;
|
|
28426
|
-
}
|
|
28427
|
-
renderStates[RenderStateElementKey.StencilStateEnabled] = true;
|
|
28428
|
-
renderStates[RenderStateElementKey.StencilStatePassOperationFront] = passOperation;
|
|
28429
|
-
renderStates[RenderStateElementKey.StencilStatePassOperationBack] = passOperation;
|
|
28430
|
-
renderStates[RenderStateElementKey.StencilStateCompareFunctionFront] = CompareFunction.Always;
|
|
28431
|
-
renderStates[RenderStateElementKey.StencilStateCompareFunctionBack] = CompareFunction.Always;
|
|
28432
|
-
var failStencilOperation = StencilOperation.Keep;
|
|
28433
|
-
renderStates[RenderStateElementKey.StencilStateFailOperationFront] = failStencilOperation;
|
|
28434
|
-
renderStates[RenderStateElementKey.StencilStateFailOperationBack] = failStencilOperation;
|
|
28435
|
-
renderStates[RenderStateElementKey.StencilStateZFailOperationFront] = failStencilOperation;
|
|
28436
|
-
renderStates[RenderStateElementKey.StencilStateZFailOperationBack] = failStencilOperation;
|
|
28437
|
-
renderStates[RenderStateElementKey.BlendStateColorWriteMask0] = ColorWriteMask.None;
|
|
28438
|
-
renderStates[RenderStateElementKey.DepthStateEnabled] = false;
|
|
28439
|
-
renderStates[RenderStateElementKey.RasterStateCullMode] = CullMode.Off;
|
|
28440
|
-
return renderStates;
|
|
28441
|
-
};
|
|
28442
|
-
_create_class$2(BasicResources, [
|
|
28446
|
+
},
|
|
28443
28447
|
{
|
|
28444
|
-
key: "
|
|
28445
|
-
get:
|
|
28446
|
-
|
|
28448
|
+
key: "siblingIndex",
|
|
28449
|
+
get: /**
|
|
28450
|
+
* The sibling index.
|
|
28451
|
+
*/ function get() {
|
|
28452
|
+
return this._siblingIndex;
|
|
28453
|
+
},
|
|
28454
|
+
set: function set(value) {
|
|
28455
|
+
if (this._siblingIndex === -1) {
|
|
28456
|
+
throw "The entity " + this.name + " is not in the hierarchy";
|
|
28457
|
+
}
|
|
28458
|
+
if (this._isRoot) {
|
|
28459
|
+
this._setSiblingIndex(this._scene._rootEntities, value);
|
|
28460
|
+
} else {
|
|
28461
|
+
var parent = this._parent;
|
|
28462
|
+
this._setSiblingIndex(parent._children, value);
|
|
28463
|
+
parent._dispatchModify(EntityModifyFlags.Child, parent);
|
|
28464
|
+
}
|
|
28447
28465
|
}
|
|
28448
28466
|
}
|
|
28449
28467
|
]);
|
|
28450
|
-
return
|
|
28451
|
-
}();
|
|
28452
|
-
|
|
28453
|
-
BasicResources._maskReadOutsideRenderStates = null;
|
|
28454
|
-
BasicResources._maskWriteIncrementRenderStates = null;
|
|
28455
|
-
BasicResources._maskWriteDecrementRenderStates = null;
|
|
28468
|
+
return Entity;
|
|
28469
|
+
}(EngineObject);
|
|
28470
|
+
/** @internal */ Entity._tempComponentConstructors = [];
|
|
28456
28471
|
var ObjectPool = /*#__PURE__*/ function() {
|
|
28457
28472
|
function ObjectPool(type) {
|
|
28458
28473
|
this._type = type;
|
|
@@ -33729,6 +33744,183 @@ var PointerMethods = /*#__PURE__*/ function(PointerMethods) {
|
|
|
33729
33744
|
PointerMethods["onPointerDrop"] = "onPointerDrop";
|
|
33730
33745
|
return PointerMethods;
|
|
33731
33746
|
}({});
|
|
33747
|
+
/**
|
|
33748
|
+
* Signal is a typed event mechanism for Galacean Engine.
|
|
33749
|
+
* @typeParam T - Tuple type of the signal arguments
|
|
33750
|
+
*/ var Signal = /*#__PURE__*/ function() {
|
|
33751
|
+
function Signal() {
|
|
33752
|
+
this._listeners = new SafeLoopArray();
|
|
33753
|
+
}
|
|
33754
|
+
var _proto = Signal.prototype;
|
|
33755
|
+
_proto.on = function on(fnOrTarget, targetOrMethodName) {
|
|
33756
|
+
for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
33757
|
+
args[_key - 2] = arguments[_key];
|
|
33758
|
+
}
|
|
33759
|
+
this._addListener.apply(this, [].concat([
|
|
33760
|
+
fnOrTarget,
|
|
33761
|
+
targetOrMethodName,
|
|
33762
|
+
false
|
|
33763
|
+
], args));
|
|
33764
|
+
};
|
|
33765
|
+
_proto.once = function once(fnOrTarget, targetOrMethodName) {
|
|
33766
|
+
for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
33767
|
+
args[_key - 2] = arguments[_key];
|
|
33768
|
+
}
|
|
33769
|
+
this._addListener.apply(this, [].concat([
|
|
33770
|
+
fnOrTarget,
|
|
33771
|
+
targetOrMethodName,
|
|
33772
|
+
true
|
|
33773
|
+
], args));
|
|
33774
|
+
};
|
|
33775
|
+
_proto.off = function off(fnOrTarget, targetOrMethodName) {
|
|
33776
|
+
if (typeof fnOrTarget === "function") {
|
|
33777
|
+
var target = targetOrMethodName != null ? targetOrMethodName : null;
|
|
33778
|
+
this._listeners.findAndRemove(function(listener) {
|
|
33779
|
+
if (listener.fn === fnOrTarget && listener.target === target) {
|
|
33780
|
+
listener.destroyed = true;
|
|
33781
|
+
return true;
|
|
33782
|
+
}
|
|
33783
|
+
return false;
|
|
33784
|
+
});
|
|
33785
|
+
} else {
|
|
33786
|
+
var target1 = fnOrTarget;
|
|
33787
|
+
var methodName = targetOrMethodName;
|
|
33788
|
+
this._listeners.findAndRemove(function(listener) {
|
|
33789
|
+
if (listener.target === target1 && listener.methodName === methodName) {
|
|
33790
|
+
listener.destroyed = true;
|
|
33791
|
+
return true;
|
|
33792
|
+
}
|
|
33793
|
+
return false;
|
|
33794
|
+
});
|
|
33795
|
+
}
|
|
33796
|
+
};
|
|
33797
|
+
/**
|
|
33798
|
+
* Remove all listeners, or all listeners for a specific target.
|
|
33799
|
+
* @param target - If provided, only remove listeners bound to this target
|
|
33800
|
+
*/ _proto.removeAll = function removeAll(target) {
|
|
33801
|
+
if (target !== undefined) {
|
|
33802
|
+
this._listeners.findAndRemove(function(listener) {
|
|
33803
|
+
if (listener.target === target) {
|
|
33804
|
+
return listener.destroyed = true;
|
|
33805
|
+
}
|
|
33806
|
+
return false;
|
|
33807
|
+
});
|
|
33808
|
+
} else {
|
|
33809
|
+
this._listeners.findAndRemove(function(listener) {
|
|
33810
|
+
return listener.destroyed = true;
|
|
33811
|
+
});
|
|
33812
|
+
}
|
|
33813
|
+
};
|
|
33814
|
+
/**
|
|
33815
|
+
* Invoke the signal, calling all listeners in order.
|
|
33816
|
+
* @param args - Arguments to pass to each listener
|
|
33817
|
+
*/ _proto.invoke = function invoke() {
|
|
33818
|
+
var _this, _loop = function _loop(i, n) {
|
|
33819
|
+
var listener = listeners[i];
|
|
33820
|
+
if (listener.destroyed) return "continue";
|
|
33821
|
+
if (listener.methodName && listener.target.destroyed) {
|
|
33822
|
+
listener.destroyed = true;
|
|
33823
|
+
_this._listeners.findAndRemove(function(l) {
|
|
33824
|
+
return l === listener;
|
|
33825
|
+
});
|
|
33826
|
+
return "continue";
|
|
33827
|
+
}
|
|
33828
|
+
listener.fn.apply(listener.target, args);
|
|
33829
|
+
if (listener.once) {
|
|
33830
|
+
listener.destroyed = true;
|
|
33831
|
+
_this._listeners.findAndRemove(function(l) {
|
|
33832
|
+
return l === listener;
|
|
33833
|
+
});
|
|
33834
|
+
}
|
|
33835
|
+
};
|
|
33836
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
33837
|
+
args[_key] = arguments[_key];
|
|
33838
|
+
}
|
|
33839
|
+
var listeners = this._listeners.getLoopArray();
|
|
33840
|
+
for(var i = 0, n = listeners.length; i < n; i++)_this = this, _loop(i);
|
|
33841
|
+
};
|
|
33842
|
+
/**
|
|
33843
|
+
* @internal
|
|
33844
|
+
* Clone listeners to target signal, remapping entity/component references.
|
|
33845
|
+
*/ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
|
|
33846
|
+
var listeners = this._listeners.getLoopArray();
|
|
33847
|
+
for(var i = 0, n = listeners.length; i < n; i++){
|
|
33848
|
+
var listener = listeners[i];
|
|
33849
|
+
if (listener.destroyed || !listener.methodName) continue;
|
|
33850
|
+
var clonedTarget = CloneUtils.remapComponent(srcRoot, targetRoot, listener.target);
|
|
33851
|
+
if (clonedTarget) {
|
|
33852
|
+
var clonedArgs = this._cloneArguments(listener.arguments, srcRoot, targetRoot);
|
|
33853
|
+
if (listener.once) {
|
|
33854
|
+
var _target;
|
|
33855
|
+
(_target = target).once.apply(_target, [].concat([
|
|
33856
|
+
clonedTarget,
|
|
33857
|
+
listener.methodName
|
|
33858
|
+
], clonedArgs));
|
|
33859
|
+
} else {
|
|
33860
|
+
var _target1;
|
|
33861
|
+
(_target1 = target).on.apply(_target1, [].concat([
|
|
33862
|
+
clonedTarget,
|
|
33863
|
+
listener.methodName
|
|
33864
|
+
], clonedArgs));
|
|
33865
|
+
}
|
|
33866
|
+
}
|
|
33867
|
+
}
|
|
33868
|
+
};
|
|
33869
|
+
_proto._cloneArguments = function _cloneArguments(args, srcRoot, targetRoot) {
|
|
33870
|
+
if (!args || args.length === 0) return [];
|
|
33871
|
+
var len = args.length;
|
|
33872
|
+
var clonedArgs = new Array(len);
|
|
33873
|
+
for(var i = 0; i < len; i++){
|
|
33874
|
+
var arg = args[i];
|
|
33875
|
+
if (_instanceof1$2(arg, Entity)) {
|
|
33876
|
+
clonedArgs[i] = CloneUtils.remapEntity(srcRoot, targetRoot, arg);
|
|
33877
|
+
} else if (_instanceof1$2(arg, Component)) {
|
|
33878
|
+
clonedArgs[i] = CloneUtils.remapComponent(srcRoot, targetRoot, arg);
|
|
33879
|
+
} else {
|
|
33880
|
+
clonedArgs[i] = arg;
|
|
33881
|
+
}
|
|
33882
|
+
}
|
|
33883
|
+
return clonedArgs;
|
|
33884
|
+
};
|
|
33885
|
+
_proto._addListener = function _addListener(fnOrTarget, targetOrMethodName, once) {
|
|
33886
|
+
for(var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++){
|
|
33887
|
+
args[_key - 3] = arguments[_key];
|
|
33888
|
+
}
|
|
33889
|
+
if (typeof fnOrTarget === "function") {
|
|
33890
|
+
this._listeners.push({
|
|
33891
|
+
fn: fnOrTarget,
|
|
33892
|
+
target: targetOrMethodName != null ? targetOrMethodName : null,
|
|
33893
|
+
once: once
|
|
33894
|
+
});
|
|
33895
|
+
} else {
|
|
33896
|
+
var _target, _target1;
|
|
33897
|
+
var target = fnOrTarget;
|
|
33898
|
+
var methodName = targetOrMethodName;
|
|
33899
|
+
var fn = args.length > 0 ? function fn() {
|
|
33900
|
+
for(var _len = arguments.length, signalArgs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
33901
|
+
signalArgs[_key] = arguments[_key];
|
|
33902
|
+
}
|
|
33903
|
+
return (_target = target)[methodName].apply(_target, [].concat(args, signalArgs));
|
|
33904
|
+
} : function() {
|
|
33905
|
+
for(var _len = arguments.length, signalArgs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
33906
|
+
signalArgs[_key] = arguments[_key];
|
|
33907
|
+
}
|
|
33908
|
+
return (_target1 = target)[methodName].apply(_target1, [].concat(signalArgs));
|
|
33909
|
+
};
|
|
33910
|
+
this._listeners.push({
|
|
33911
|
+
fn: fn,
|
|
33912
|
+
target: target,
|
|
33913
|
+
once: once,
|
|
33914
|
+
methodName: methodName,
|
|
33915
|
+
arguments: args
|
|
33916
|
+
});
|
|
33917
|
+
}
|
|
33918
|
+
};
|
|
33919
|
+
return Signal;
|
|
33920
|
+
}();
|
|
33921
|
+
__decorate$1([
|
|
33922
|
+
ignoreClone
|
|
33923
|
+
], Signal.prototype, "_listeners", void 0);
|
|
33732
33924
|
/**
|
|
33733
33925
|
* Loader abstract class.
|
|
33734
33926
|
*/ var Loader = /*#__PURE__*/ function() {
|
|
@@ -43003,6 +43195,7 @@ var CoreObjects = /*#__PURE__*/Object.freeze({
|
|
|
43003
43195
|
CircleShape: CircleShape,
|
|
43004
43196
|
ClearableObjectPool: ClearableObjectPool,
|
|
43005
43197
|
CloneManager: CloneManager,
|
|
43198
|
+
CloneUtils: CloneUtils,
|
|
43006
43199
|
get Collider () { return Collider; },
|
|
43007
43200
|
ColliderShape: ColliderShape,
|
|
43008
43201
|
ColliderShapeUpAxis: ColliderShapeUpAxis,
|
|
@@ -43159,6 +43352,7 @@ var CoreObjects = /*#__PURE__*/Object.freeze({
|
|
|
43159
43352
|
ShadowCascadesMode: ShadowCascadesMode,
|
|
43160
43353
|
ShadowResolution: ShadowResolution,
|
|
43161
43354
|
ShadowType: ShadowType,
|
|
43355
|
+
Signal: Signal,
|
|
43162
43356
|
get SimpleSpriteAssembler () { return SimpleSpriteAssembler; },
|
|
43163
43357
|
SizeOverLifetimeModule: SizeOverLifetimeModule,
|
|
43164
43358
|
Skin: Skin,
|
|
@@ -46260,6 +46454,29 @@ var ReflectionParser = /*#__PURE__*/ function() {
|
|
|
46260
46454
|
}
|
|
46261
46455
|
});
|
|
46262
46456
|
};
|
|
46457
|
+
_proto.parseSignal = function parseSignal(signalRef) {
|
|
46458
|
+
var _this = this;
|
|
46459
|
+
var signal = new Signal();
|
|
46460
|
+
return Promise.all(signalRef.listeners.map(function(listener) {
|
|
46461
|
+
return Promise.all([
|
|
46462
|
+
_this.parseBasicType(listener.target),
|
|
46463
|
+
listener.arguments ? Promise.all(listener.arguments.map(function(a) {
|
|
46464
|
+
return _this.parseBasicType(a);
|
|
46465
|
+
})) : Promise.resolve([])
|
|
46466
|
+
]).then(function(param) {
|
|
46467
|
+
var target = param[0], resolvedArgs = param[1];
|
|
46468
|
+
if (target) {
|
|
46469
|
+
var _signal;
|
|
46470
|
+
(_signal = signal).on.apply(_signal, [].concat([
|
|
46471
|
+
target,
|
|
46472
|
+
listener.methodName
|
|
46473
|
+
], resolvedArgs));
|
|
46474
|
+
}
|
|
46475
|
+
});
|
|
46476
|
+
})).then(function() {
|
|
46477
|
+
return signal;
|
|
46478
|
+
});
|
|
46479
|
+
};
|
|
46263
46480
|
_proto.parseBasicType = function parseBasicType(value, originValue) {
|
|
46264
46481
|
var _this = this;
|
|
46265
46482
|
if (Array.isArray(value)) {
|
|
@@ -46289,6 +46506,8 @@ var ReflectionParser = /*#__PURE__*/ function() {
|
|
|
46289
46506
|
} else if (ReflectionParser._isEntityRef(value)) {
|
|
46290
46507
|
// entity reference
|
|
46291
46508
|
return Promise.resolve(this._context.entityMap.get(value.entityId));
|
|
46509
|
+
} else if (ReflectionParser._isSignalRef(value)) {
|
|
46510
|
+
return this.parseSignal(value);
|
|
46292
46511
|
} else if (originValue) {
|
|
46293
46512
|
var _this2, _loop = function _loop(key) {
|
|
46294
46513
|
if (key === "methods") {
|
|
@@ -46359,6 +46578,9 @@ var ReflectionParser = /*#__PURE__*/ function() {
|
|
|
46359
46578
|
ReflectionParser._isComponentRef = function _isComponentRef(value) {
|
|
46360
46579
|
return value["ownerId"] !== undefined && value["componentId"] !== undefined;
|
|
46361
46580
|
};
|
|
46581
|
+
ReflectionParser._isSignalRef = function _isSignalRef(value) {
|
|
46582
|
+
return value["listeners"] !== undefined;
|
|
46583
|
+
};
|
|
46362
46584
|
ReflectionParser._isMethodObject = function _isMethodObject(value) {
|
|
46363
46585
|
return Array.isArray(value == null ? void 0 : value.params);
|
|
46364
46586
|
};
|
|
@@ -52698,11 +52920,11 @@ EXT_texture_webp = __decorate([
|
|
|
52698
52920
|
], EXT_texture_webp);
|
|
52699
52921
|
|
|
52700
52922
|
//@ts-ignore
|
|
52701
|
-
var version = "2.0.0-alpha.
|
|
52923
|
+
var version = "2.0.0-alpha.15";
|
|
52702
52924
|
console.log("Galacean Engine Version: " + version);
|
|
52703
52925
|
for(var key in CoreObjects){
|
|
52704
52926
|
Loader.registerClass(key, CoreObjects[key]);
|
|
52705
52927
|
}
|
|
52706
52928
|
|
|
52707
|
-
export { AccessorType, AmbientLight, AmbientOcclusion, AmbientOcclusionQuality, AnimationArrayCurve, AnimationBoolCurve, AnimationClip, AnimationClipCurveBinding, AnimationClipDecoder, AnimationColorCurve, AnimationCurve, AnimationEvent, AnimationFloatArrayCurve, AnimationFloatCurve, AnimationQuaternionCurve, AnimationRectCurve, AnimationRefCurve, AnimationStringCurve, AnimationVector2Curve, AnimationVector3Curve, AnimationVector4Curve, Animator, AnimatorCondition, AnimatorConditionMode, AnimatorController, AnimatorControllerLayer, AnimatorControllerParameter, AnimatorCullingMode, AnimatorLayerBlendingMode, AnimatorLayerMask, AnimatorState, AnimatorStateMachine, AnimatorStateTransition, AntiAliasing, AssetPromise, AssetType, AudioClip, AudioManager, AudioSource, Background, BackgroundMode, BackgroundTextureFillMode, BaseMaterial, BasicRenderPipeline, BatchUtils, BlendFactor, BlendMode, BlendOperation, BlendShape, BlendShapeFrame, BlendState, BlinnPhongMaterial, Blitter, BloomDownScaleMode, BloomEffect, BoolUpdateFlag, BoundingBox, BoundingFrustum, BoundingSphere, BoxColliderShape, BoxShape, Buffer, BufferAsset, BufferBindFlag, BufferInfo, BufferMesh, BufferReader, BufferUsage, BufferUtil, Burst, Camera, CameraClearFlags, CameraModifyFlags, CameraType$1 as CameraType, Canvas, CapsuleColliderShape, CharRenderInfo, CharacterController, CircleShape, ClearableObjectPool, CloneManager, Collider, ColliderShape, ColliderShapeUpAxis, Collision, CollisionDetectionMode, CollisionUtil, Color, ColorOverLifetimeModule, ColorWriteMask, CompareFunction, Component, ConeEmitType, ConeShape, ContactPoint, ContainmentType, ContentRestorer, ControllerCollisionFlag, ControllerNonWalkableMode, CubeProbe, CullMode, CurveKey, DataType, DependentMode, DepthState, DepthTextureMode, DiffuseMode, DirectLight, DisorderedArray, Downsampling, DynamicCollider, DynamicColliderConstraints, EmissionModule, Engine, EngineObject, Entity, EntityModifyFlags, EventDispatcher, FileHeader, FinalPass, FixedJoint, FogMode, Font, FontStyle, FrustumFace, GLCapabilityType, GLCompressedTextureInternalFormat, GLTFAnimationParser, GLTFAnimatorControllerParser, GLTFBufferParser, GLTFBufferViewParser, GLTFEntityParser, GLTFExtensionMode, GLTFExtensionParser, GLTFLoader, GLTFMaterialParser, GLTFMeshParser, GLTFParser, GLTFParserContext, GLTFParserType, GLTFResource, GLTFSceneParser, GLTFSchemaParser, GLTFSkinParser, GLTFTextureParser, GLTFUtils, GLTFValidator, GradientAlphaKey, GradientColorKey, HDRDecoder, HemisphereShape, HierarchyParser, HingeJoint, HitResult, IndexBufferBinding, IndexFormat, InputManager, InterpolableValueType, InterpolationType, JSONAsset, Joint, JointLimits, JointMotor, KTX2Loader, KTX2TargetFormat, Keyframe, Keys, Layer, LayerPathMask, Light, Loader, Logger, MSAASamples, MainModule, Material, MaterialLoaderType, MathUtil, Matrix, Matrix3x3, Mesh, MeshColliderShape, MeshColliderShapeCookingFlag, MeshDecoder, MeshRenderer, MeshShape, MeshTopology, ModelMesh, OverflowMode, PBRMaterial, ParserContext, ParserType, ParticleCompositeCurve, ParticleCompositeGradient, ParticleCurve, ParticleCurveMode, ParticleGenerator, ParticleGradient, ParticleGradientMode, ParticleMaterial, ParticleRenderMode, ParticleRenderer, ParticleScaleMode, ParticleShapeArcMode, ParticleShapeType, ParticleSimulationSpace, ParticleStopMode, PhysicsMaterial, PhysicsMaterialCombineMode, PhysicsScene, PipelineStage, Plane, PlaneColliderShape, PlaneIntersectionType, Platform, PointLight, Pointer, PointerButton, PointerEventData, PointerEventEmitter, PointerPhase, PostProcess, PostProcessEffect, PostProcessEffectBoolParameter, PostProcessEffectColorParameter, PostProcessEffectEnumParameter, PostProcessEffectFloatParameter, PostProcessEffectParameter, PostProcessEffectTextureParameter, PostProcessEffectVector2Parameter, PostProcessEffectVector3Parameter, PostProcessEffectVector4Parameter, PostProcessManager, PostProcessPass, PostProcessPassEvent, PostProcessUberPass, PrefabResource, Primitive, PrimitiveMesh, Probe, Quaternion, Rand, RasterState, Ray, Rect, ReferResource, ReflectionParser, RefractionMode, RenderBufferDepthFormat, RenderFace, RenderQueue, RenderQueueFlags, RenderQueueType, RenderState, RenderStateElementKey, RenderTarget, RenderTargetBlendState, Renderer, RendererUpdateFlags, RenderingStatistics, ReplacementFailureStrategy, ResourceManager, ReturnableObjectPool, RotationOverLifetimeModule, SafeLoopArray, Scene, SceneManager, SceneParser, Script, SetDataOptions, Shader, ShaderData, ShaderDataGroup, ShaderFactory, ShaderLanguage, ShaderLib, ShaderMacro, ShaderMacroCollection, ShaderPass, ShaderProperty, ShaderPropertyType, ShaderTagKey, ShadowCascadesMode, ShadowResolution, ShadowType, SimpleSpriteAssembler, SizeOverLifetimeModule, Skin, SkinnedMeshRenderer, Sky, SkyBoxMaterial, SkyProceduralMaterial, SlicedSpriteAssembler, SpecularMode, SphereColliderShape, SphereShape, SphericalHarmonics3, SpotLight, SpringJoint, Sprite, SpriteAtlas, SpriteDrawMode, SpriteMask, SpriteMaskInteraction, SpriteMaskLayer, SpriteModifyFlags, SpriteRenderer, SpriteTileMode, StateMachineScript, StaticCollider, StencilOperation, StencilState, SubFont, SubMesh, SubPrimitive, SubShader, SunMode, SystemInfo, TextAsset, TextHorizontalAlignment, TextRenderer, TextUtils, TextVerticalAlignment, Texture, Texture2D, Texture2DArray, Texture2DDecoder, TextureCoordinate, TextureCube, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureFormat, TextureSheetAnimationModule, TextureUsage, TextureUtils, TextureWrapMode$1 as TextureWrapMode, TiledSpriteAssembler, Time, TonemappingEffect, TonemappingMode, TrailMaterial, TrailRenderer, TrailTextureMode, Transform, TransformModifyFlags, UnlitMaterial, Utils, Vector2, Vector3, Vector4, VelocityOverLifetimeModule, VertexAttribute, VertexBufferBinding, VertexElement, VertexElementFormat, WebCanvas, WebGLEngine, WebGLGraphicDevice, WebGLMode, WrapMode, XRManager, assignmentClone, decode, decoder, decoderMap, deepClone, dependentComponents, ignoreClone, parseSingleKTX, registerGLTFExtension, registerGLTFParser, registerPointerEventEmitter, request, resourceLoader, shallowClone, version };
|
|
52929
|
+
export { AccessorType, AmbientLight, AmbientOcclusion, AmbientOcclusionQuality, AnimationArrayCurve, AnimationBoolCurve, AnimationClip, AnimationClipCurveBinding, AnimationClipDecoder, AnimationColorCurve, AnimationCurve, AnimationEvent, AnimationFloatArrayCurve, AnimationFloatCurve, AnimationQuaternionCurve, AnimationRectCurve, AnimationRefCurve, AnimationStringCurve, AnimationVector2Curve, AnimationVector3Curve, AnimationVector4Curve, Animator, AnimatorCondition, AnimatorConditionMode, AnimatorController, AnimatorControllerLayer, AnimatorControllerParameter, AnimatorCullingMode, AnimatorLayerBlendingMode, AnimatorLayerMask, AnimatorState, AnimatorStateMachine, AnimatorStateTransition, AntiAliasing, AssetPromise, AssetType, AudioClip, AudioManager, AudioSource, Background, BackgroundMode, BackgroundTextureFillMode, BaseMaterial, BasicRenderPipeline, BatchUtils, BlendFactor, BlendMode, BlendOperation, BlendShape, BlendShapeFrame, BlendState, BlinnPhongMaterial, Blitter, BloomDownScaleMode, BloomEffect, BoolUpdateFlag, BoundingBox, BoundingFrustum, BoundingSphere, BoxColliderShape, BoxShape, Buffer, BufferAsset, BufferBindFlag, BufferInfo, BufferMesh, BufferReader, BufferUsage, BufferUtil, Burst, Camera, CameraClearFlags, CameraModifyFlags, CameraType$1 as CameraType, Canvas, CapsuleColliderShape, CharRenderInfo, CharacterController, CircleShape, ClearableObjectPool, CloneManager, CloneUtils, Collider, ColliderShape, ColliderShapeUpAxis, Collision, CollisionDetectionMode, CollisionUtil, Color, ColorOverLifetimeModule, ColorWriteMask, CompareFunction, Component, ConeEmitType, ConeShape, ContactPoint, ContainmentType, ContentRestorer, ControllerCollisionFlag, ControllerNonWalkableMode, CubeProbe, CullMode, CurveKey, DataType, DependentMode, DepthState, DepthTextureMode, DiffuseMode, DirectLight, DisorderedArray, Downsampling, DynamicCollider, DynamicColliderConstraints, EmissionModule, Engine, EngineObject, Entity, EntityModifyFlags, EventDispatcher, FileHeader, FinalPass, FixedJoint, FogMode, Font, FontStyle, FrustumFace, GLCapabilityType, GLCompressedTextureInternalFormat, GLTFAnimationParser, GLTFAnimatorControllerParser, GLTFBufferParser, GLTFBufferViewParser, GLTFEntityParser, GLTFExtensionMode, GLTFExtensionParser, GLTFLoader, GLTFMaterialParser, GLTFMeshParser, GLTFParser, GLTFParserContext, GLTFParserType, GLTFResource, GLTFSceneParser, GLTFSchemaParser, GLTFSkinParser, GLTFTextureParser, GLTFUtils, GLTFValidator, GradientAlphaKey, GradientColorKey, HDRDecoder, HemisphereShape, HierarchyParser, HingeJoint, HitResult, IndexBufferBinding, IndexFormat, InputManager, InterpolableValueType, InterpolationType, JSONAsset, Joint, JointLimits, JointMotor, KTX2Loader, KTX2TargetFormat, Keyframe, Keys, Layer, LayerPathMask, Light, Loader, Logger, MSAASamples, MainModule, Material, MaterialLoaderType, MathUtil, Matrix, Matrix3x3, Mesh, MeshColliderShape, MeshColliderShapeCookingFlag, MeshDecoder, MeshRenderer, MeshShape, MeshTopology, ModelMesh, OverflowMode, PBRMaterial, ParserContext, ParserType, ParticleCompositeCurve, ParticleCompositeGradient, ParticleCurve, ParticleCurveMode, ParticleGenerator, ParticleGradient, ParticleGradientMode, ParticleMaterial, ParticleRenderMode, ParticleRenderer, ParticleScaleMode, ParticleShapeArcMode, ParticleShapeType, ParticleSimulationSpace, ParticleStopMode, PhysicsMaterial, PhysicsMaterialCombineMode, PhysicsScene, PipelineStage, Plane, PlaneColliderShape, PlaneIntersectionType, Platform, PointLight, Pointer, PointerButton, PointerEventData, PointerEventEmitter, PointerPhase, PostProcess, PostProcessEffect, PostProcessEffectBoolParameter, PostProcessEffectColorParameter, PostProcessEffectEnumParameter, PostProcessEffectFloatParameter, PostProcessEffectParameter, PostProcessEffectTextureParameter, PostProcessEffectVector2Parameter, PostProcessEffectVector3Parameter, PostProcessEffectVector4Parameter, PostProcessManager, PostProcessPass, PostProcessPassEvent, PostProcessUberPass, PrefabResource, Primitive, PrimitiveMesh, Probe, Quaternion, Rand, RasterState, Ray, Rect, ReferResource, ReflectionParser, RefractionMode, RenderBufferDepthFormat, RenderFace, RenderQueue, RenderQueueFlags, RenderQueueType, RenderState, RenderStateElementKey, RenderTarget, RenderTargetBlendState, Renderer, RendererUpdateFlags, RenderingStatistics, ReplacementFailureStrategy, ResourceManager, ReturnableObjectPool, RotationOverLifetimeModule, SafeLoopArray, Scene, SceneManager, SceneParser, Script, SetDataOptions, Shader, ShaderData, ShaderDataGroup, ShaderFactory, ShaderLanguage, ShaderLib, ShaderMacro, ShaderMacroCollection, ShaderPass, ShaderProperty, ShaderPropertyType, ShaderTagKey, ShadowCascadesMode, ShadowResolution, ShadowType, Signal, SimpleSpriteAssembler, SizeOverLifetimeModule, Skin, SkinnedMeshRenderer, Sky, SkyBoxMaterial, SkyProceduralMaterial, SlicedSpriteAssembler, SpecularMode, SphereColliderShape, SphereShape, SphericalHarmonics3, SpotLight, SpringJoint, Sprite, SpriteAtlas, SpriteDrawMode, SpriteMask, SpriteMaskInteraction, SpriteMaskLayer, SpriteModifyFlags, SpriteRenderer, SpriteTileMode, StateMachineScript, StaticCollider, StencilOperation, StencilState, SubFont, SubMesh, SubPrimitive, SubShader, SunMode, SystemInfo, TextAsset, TextHorizontalAlignment, TextRenderer, TextUtils, TextVerticalAlignment, Texture, Texture2D, Texture2DArray, Texture2DDecoder, TextureCoordinate, TextureCube, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureFormat, TextureSheetAnimationModule, TextureUsage, TextureUtils, TextureWrapMode$1 as TextureWrapMode, TiledSpriteAssembler, Time, TonemappingEffect, TonemappingMode, TrailMaterial, TrailRenderer, TrailTextureMode, Transform, TransformModifyFlags, UnlitMaterial, Utils, Vector2, Vector3, Vector4, VelocityOverLifetimeModule, VertexAttribute, VertexBufferBinding, VertexElement, VertexElementFormat, WebCanvas, WebGLEngine, WebGLGraphicDevice, WebGLMode, WrapMode, XRManager, assignmentClone, decode, decoder, decoderMap, deepClone, dependentComponents, ignoreClone, parseSingleKTX, registerGLTFExtension, registerGLTFParser, registerPointerEventEmitter, request, resourceLoader, shallowClone, version };
|
|
52708
52930
|
//# sourceMappingURL=bundled.module.js.map
|