@galacean/engine-physics-lite 0.0.0-experimental-0.9-plus.6 → 0.0.0-experimental-0.9-plus.8
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/main.js.map +1 -1
- package/dist/miniprogram.js +364 -93
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/LitePhysicsScene.d.ts +79 -0
package/dist/miniprogram.js
CHANGED
|
@@ -2734,9 +2734,11 @@ function ObjectValues(obj) {
|
|
|
2734
2734
|
renderTexture
|
|
2735
2735
|
];
|
|
2736
2736
|
for(var i = 0, n = colorTextures.length; i < n; i++){
|
|
2737
|
-
|
|
2737
|
+
var colorTexture = colorTextures[i];
|
|
2738
|
+
if (colorTexture._isDepthTexture) {
|
|
2738
2739
|
throw "Render texture can't use depth format.";
|
|
2739
2740
|
}
|
|
2741
|
+
colorTexture._addRefCount(1);
|
|
2740
2742
|
}
|
|
2741
2743
|
_this._colorTextures = colorTextures;
|
|
2742
2744
|
} else {
|
|
@@ -2747,6 +2749,7 @@ function ObjectValues(obj) {
|
|
|
2747
2749
|
throw "Depth texture must use depth format.";
|
|
2748
2750
|
}
|
|
2749
2751
|
_this._depthTexture = depth;
|
|
2752
|
+
_this._depthTexture._addRefCount(1);
|
|
2750
2753
|
}
|
|
2751
2754
|
_this._platformRenderTarget = engine._hardwareRenderer.createPlatformRenderTarget(_assert_this_initialized(_this));
|
|
2752
2755
|
return _this;
|
|
@@ -2776,8 +2779,14 @@ function ObjectValues(obj) {
|
|
|
2776
2779
|
/**
|
|
2777
2780
|
* Destroy render target.
|
|
2778
2781
|
*/ _proto.destroy = function destroy() {
|
|
2782
|
+
var _this__depthTexture;
|
|
2779
2783
|
this._platformRenderTarget.destroy();
|
|
2780
|
-
this
|
|
2784
|
+
var _this = this, colorTextures = _this._colorTextures;
|
|
2785
|
+
for(var i = 0, n = colorTextures.length; i < n; i++){
|
|
2786
|
+
colorTextures[i]._addRefCount(-1);
|
|
2787
|
+
}
|
|
2788
|
+
colorTextures.length = 0;
|
|
2789
|
+
(_this__depthTexture = this._depthTexture) == null ? void 0 : _this__depthTexture._addRefCount(-1);
|
|
2781
2790
|
this._depthTexture = null;
|
|
2782
2791
|
this._depth = null;
|
|
2783
2792
|
};
|
|
@@ -3218,6 +3227,7 @@ function ObjectValues(obj) {
|
|
|
3218
3227
|
var fontAtlas = new FontAtlas(engine);
|
|
3219
3228
|
var texture = new Texture2D(engine, 256, 256);
|
|
3220
3229
|
fontAtlas.texture = texture;
|
|
3230
|
+
fontAtlas.isGCIgnored = texture.isGCIgnored = true;
|
|
3221
3231
|
this._fontAtlases.push(fontAtlas);
|
|
3222
3232
|
return fontAtlas;
|
|
3223
3233
|
};
|
|
@@ -3493,6 +3503,28 @@ var /** @internal */ PromiseState;
|
|
|
3493
3503
|
* @remarks The release principle is that it is not referenced by the components, including direct and indirect reference.
|
|
3494
3504
|
*/ _proto.gc = function gc() {
|
|
3495
3505
|
this._gc(false);
|
|
3506
|
+
var engine = this.engine;
|
|
3507
|
+
engine._renderElementPool.garbageCollection();
|
|
3508
|
+
engine._spriteElementPool.garbageCollection();
|
|
3509
|
+
engine._spriteMaskElementPool.garbageCollection();
|
|
3510
|
+
engine._textElementPool.garbageCollection();
|
|
3511
|
+
var _componentsManager = engine._componentsManager, _lightManager = engine._lightManager;
|
|
3512
|
+
_componentsManager._renderers.garbageCollection();
|
|
3513
|
+
// @ts-ignore
|
|
3514
|
+
_componentsManager._onStartScripts.garbageCollection();
|
|
3515
|
+
// @ts-ignore
|
|
3516
|
+
_componentsManager._onUpdateScripts.garbageCollection();
|
|
3517
|
+
// @ts-ignore
|
|
3518
|
+
_componentsManager._onLateUpdateScripts.garbageCollection();
|
|
3519
|
+
// @ts-ignore
|
|
3520
|
+
_componentsManager._onPhysicsUpdateScripts.garbageCollection();
|
|
3521
|
+
// @ts-ignore
|
|
3522
|
+
_componentsManager._onUpdateAnimations.garbageCollection();
|
|
3523
|
+
// @ts-ignore
|
|
3524
|
+
_componentsManager._onUpdateRenderers.garbageCollection();
|
|
3525
|
+
_lightManager._spotLights.garbageCollection();
|
|
3526
|
+
_lightManager._pointLights.garbageCollection();
|
|
3527
|
+
_lightManager._directLights.garbageCollection();
|
|
3496
3528
|
};
|
|
3497
3529
|
/**
|
|
3498
3530
|
* @internal
|
|
@@ -5323,6 +5355,11 @@ var TransformModifyFlags;
|
|
|
5323
5355
|
* @returns Cloned entity
|
|
5324
5356
|
*/ _proto.clone = function clone() {
|
|
5325
5357
|
var cloneEntity = new Entity(this._engine, this.name);
|
|
5358
|
+
var _this = this, hookResource = _this._hookResource;
|
|
5359
|
+
if (hookResource) {
|
|
5360
|
+
cloneEntity._hookResource = hookResource;
|
|
5361
|
+
hookResource._addRefCount(1);
|
|
5362
|
+
}
|
|
5326
5363
|
cloneEntity._isActive = this._isActive;
|
|
5327
5364
|
cloneEntity.transform.localMatrix = this.transform.localMatrix;
|
|
5328
5365
|
var children = this._children;
|
|
@@ -5347,6 +5384,10 @@ var TransformModifyFlags;
|
|
|
5347
5384
|
return;
|
|
5348
5385
|
}
|
|
5349
5386
|
EngineObject.prototype.destroy.call(this);
|
|
5387
|
+
if (this._hookResource) {
|
|
5388
|
+
this._hookResource._addRefCount(-1);
|
|
5389
|
+
this._hookResource = null;
|
|
5390
|
+
}
|
|
5350
5391
|
var components = this._components;
|
|
5351
5392
|
for(var i = components.length - 1; i >= 0; i--){
|
|
5352
5393
|
components[i].destroy();
|
|
@@ -8693,6 +8734,7 @@ exports.DynamicColliderConstraints = void 0;
|
|
|
8693
8734
|
_proto.cloneTo = function cloneTo(target) {
|
|
8694
8735
|
CloneManager.deepCloneObject(this._macroCollection, target._macroCollection);
|
|
8695
8736
|
Object.assign(target._macroMap, this._macroMap);
|
|
8737
|
+
var referCount = target._getRefCount();
|
|
8696
8738
|
var propertyValueMap = this._propertyValueMap;
|
|
8697
8739
|
var targetPropertyValueMap = target._propertyValueMap;
|
|
8698
8740
|
var keys = Object.keys(propertyValueMap);
|
|
@@ -8704,6 +8746,7 @@ exports.DynamicColliderConstraints = void 0;
|
|
|
8704
8746
|
targetPropertyValueMap[k] = property;
|
|
8705
8747
|
} else if (_instanceof1$2(property, Texture)) {
|
|
8706
8748
|
targetPropertyValueMap[k] = property;
|
|
8749
|
+
referCount > 0 && property._addRefCount(referCount);
|
|
8707
8750
|
} else if (_instanceof1$2(property, Array) || _instanceof1$2(property, Float32Array) || _instanceof1$2(property, Int32Array)) {
|
|
8708
8751
|
targetPropertyValueMap[k] = property.slice();
|
|
8709
8752
|
} else {
|
|
@@ -9694,9 +9737,9 @@ __decorate$1([
|
|
|
9694
9737
|
var Material = function Material(engine, shader) {
|
|
9695
9738
|
var _this;
|
|
9696
9739
|
_this = RefObject.call(this, engine) || this;
|
|
9697
|
-
/** Shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Material);
|
|
9698
9740
|
/** @internal */ _this._renderStates = [] // todo: later will as a part of shaderData when shader effect frame is OK, that is more powerful and flexible.
|
|
9699
9741
|
;
|
|
9742
|
+
_this._shaderData = new ShaderData(ShaderDataGroup.Material);
|
|
9700
9743
|
_this.shader = shader;
|
|
9701
9744
|
return _this;
|
|
9702
9745
|
};
|
|
@@ -9729,8 +9772,21 @@ __decorate$1([
|
|
|
9729
9772
|
*/ _proto._preRender = function _preRender(renderElement) {};
|
|
9730
9773
|
/**
|
|
9731
9774
|
* @override
|
|
9732
|
-
*/ _proto._onDestroy = function _onDestroy() {
|
|
9775
|
+
*/ _proto._onDestroy = function _onDestroy() {
|
|
9776
|
+
this._shader = null;
|
|
9777
|
+
this._shaderData = null;
|
|
9778
|
+
this._renderStates.length = 0;
|
|
9779
|
+
this._renderStates = null;
|
|
9780
|
+
};
|
|
9733
9781
|
_create_class$2(Material, [
|
|
9782
|
+
{
|
|
9783
|
+
key: "shaderData",
|
|
9784
|
+
get: /**
|
|
9785
|
+
* Shader data.
|
|
9786
|
+
*/ function get() {
|
|
9787
|
+
return this._shaderData;
|
|
9788
|
+
}
|
|
9789
|
+
},
|
|
9734
9790
|
{
|
|
9735
9791
|
key: "shader",
|
|
9736
9792
|
get: /**
|
|
@@ -9798,6 +9854,12 @@ __decorate$1([
|
|
|
9798
9854
|
*/ _proto.resetPool = function resetPool() {
|
|
9799
9855
|
this._elementPoolIndex = 0;
|
|
9800
9856
|
};
|
|
9857
|
+
_proto.garbageCollection = function garbageCollection() {
|
|
9858
|
+
var _this = this, pool = _this._elementPool;
|
|
9859
|
+
for(var i = pool.length - 1; i >= 0; i--){
|
|
9860
|
+
pool[i].dispose && pool[i].dispose();
|
|
9861
|
+
}
|
|
9862
|
+
};
|
|
9801
9863
|
return ClassPool;
|
|
9802
9864
|
}();
|
|
9803
9865
|
var RenderElement = function RenderElement() {};
|
|
@@ -9817,6 +9879,9 @@ var RenderElement = function RenderElement() {};
|
|
|
9817
9879
|
this.renderState = renderState;
|
|
9818
9880
|
this.shaderPass = shaderPass;
|
|
9819
9881
|
};
|
|
9882
|
+
_proto.dispose = function dispose() {
|
|
9883
|
+
this.component = this.mesh = this.subMesh = this.material = this.renderState = this.shaderPass = null;
|
|
9884
|
+
};
|
|
9820
9885
|
return MeshRenderElement;
|
|
9821
9886
|
}(RenderElement);
|
|
9822
9887
|
/**
|
|
@@ -9860,6 +9925,9 @@ var SpriteElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
9860
9925
|
this.renderState = renderState;
|
|
9861
9926
|
this.shaderPass = shaderPass;
|
|
9862
9927
|
};
|
|
9928
|
+
_proto.dispose = function dispose() {
|
|
9929
|
+
this.component = this.renderData = this.material = this.texture = this.renderState = this.shaderPass = null;
|
|
9930
|
+
};
|
|
9863
9931
|
return SpriteElement;
|
|
9864
9932
|
}(RenderElement);
|
|
9865
9933
|
var SpriteMaskElement = /*#__PURE__*/ function(RenderElement) {
|
|
@@ -9877,6 +9945,9 @@ var SpriteMaskElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
9877
9945
|
this.renderData = renderData;
|
|
9878
9946
|
this.material = material;
|
|
9879
9947
|
};
|
|
9948
|
+
_proto.dispose = function dispose() {
|
|
9949
|
+
this.component = this.renderData = this.material = null;
|
|
9950
|
+
};
|
|
9880
9951
|
return SpriteMaskElement;
|
|
9881
9952
|
}(RenderElement);
|
|
9882
9953
|
/**
|
|
@@ -9892,7 +9963,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
9892
9963
|
var Renderer1 = function Renderer1(entity) {
|
|
9893
9964
|
var _this;
|
|
9894
9965
|
_this = Component.call(this, entity) || this;
|
|
9895
|
-
/** ShaderData related to renderer. */ _this.shaderData = new ShaderData(ShaderDataGroup.Renderer);
|
|
9896
9966
|
/** @internal */ _this._onUpdateIndex = -1;
|
|
9897
9967
|
/** @internal */ _this._rendererIndex = -1;
|
|
9898
9968
|
/** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
|
|
@@ -9900,6 +9970,7 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
9900
9970
|
_this._overrideUpdate = false;
|
|
9901
9971
|
_this._materials = [];
|
|
9902
9972
|
_this._dirtyUpdateFlag = 0;
|
|
9973
|
+
_this._shaderData = new ShaderData(ShaderDataGroup.Renderer);
|
|
9903
9974
|
_this._mvMatrix = new miniprogram$7.Matrix();
|
|
9904
9975
|
_this._mvpMatrix = new miniprogram$7.Matrix();
|
|
9905
9976
|
_this._mvInvMatrix = new miniprogram$7.Matrix();
|
|
@@ -10047,6 +10118,17 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10047
10118
|
var _materials_i;
|
|
10048
10119
|
(_materials_i = materials[i]) == null ? void 0 : _materials_i._addRefCount(-1);
|
|
10049
10120
|
}
|
|
10121
|
+
this._entity = null;
|
|
10122
|
+
this._globalShaderMacro = null;
|
|
10123
|
+
this._bounds = null;
|
|
10124
|
+
this._materials = null;
|
|
10125
|
+
this._shaderData = null;
|
|
10126
|
+
this._mvMatrix = null;
|
|
10127
|
+
this._mvpMatrix = null;
|
|
10128
|
+
this._mvInvMatrix = null;
|
|
10129
|
+
this._normalMatrix = null;
|
|
10130
|
+
this._materialsInstanced = null;
|
|
10131
|
+
this._rendererLayer = null;
|
|
10050
10132
|
};
|
|
10051
10133
|
_proto._updateShaderData = function _updateShaderData(context) {
|
|
10052
10134
|
var entity = this.entity;
|
|
@@ -10108,6 +10190,14 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10108
10190
|
this._dirtyUpdateFlag |= 0x1;
|
|
10109
10191
|
};
|
|
10110
10192
|
_create_class$2(Renderer1, [
|
|
10193
|
+
{
|
|
10194
|
+
key: "shaderData",
|
|
10195
|
+
get: /**
|
|
10196
|
+
* ShaderData related to renderer.
|
|
10197
|
+
*/ function get() {
|
|
10198
|
+
return this._shaderData;
|
|
10199
|
+
}
|
|
10200
|
+
},
|
|
10111
10201
|
{
|
|
10112
10202
|
key: "isCulled",
|
|
10113
10203
|
get: /**
|
|
@@ -10192,9 +10282,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10192
10282
|
}(), function() {
|
|
10193
10283
|
_Renderer._rendererLayerProperty = Shader.getPropertyByName("oasis_RendererLayer");
|
|
10194
10284
|
}(), _Renderer);
|
|
10195
|
-
__decorate$1([
|
|
10196
|
-
deepClone
|
|
10197
|
-
], exports.Renderer.prototype, "shaderData", void 0);
|
|
10198
10285
|
__decorate$1([
|
|
10199
10286
|
ignoreClone
|
|
10200
10287
|
], exports.Renderer.prototype, "_distanceForSort", void 0);
|
|
@@ -10222,6 +10309,9 @@ __decorate$1([
|
|
|
10222
10309
|
__decorate$1([
|
|
10223
10310
|
ignoreClone
|
|
10224
10311
|
], exports.Renderer.prototype, "_dirtyUpdateFlag", void 0);
|
|
10312
|
+
__decorate$1([
|
|
10313
|
+
deepClone
|
|
10314
|
+
], exports.Renderer.prototype, "_shaderData", void 0);
|
|
10225
10315
|
__decorate$1([
|
|
10226
10316
|
ignoreClone
|
|
10227
10317
|
], exports.Renderer.prototype, "_mvMatrix", void 0);
|
|
@@ -10420,16 +10510,6 @@ SimpleSpriteAssembler = __decorate$1([
|
|
|
10420
10510
|
}
|
|
10421
10511
|
var _proto = SpriteMask.prototype;
|
|
10422
10512
|
/**
|
|
10423
|
-
* @override
|
|
10424
|
-
* @inheritdoc
|
|
10425
|
-
*/ _proto._onDestroy = function _onDestroy() {
|
|
10426
|
-
var _this__sprite;
|
|
10427
|
-
(_this__sprite = this._sprite) == null ? void 0 : _this__sprite._updateFlagManager.removeListener(this._onSpriteChange);
|
|
10428
|
-
this._sprite = null;
|
|
10429
|
-
this._renderData = null;
|
|
10430
|
-
Renderer.prototype._onDestroy.call(this);
|
|
10431
|
-
};
|
|
10432
|
-
/**
|
|
10433
10513
|
* @internal
|
|
10434
10514
|
*/ _proto._cloneTo = function _cloneTo(target) {
|
|
10435
10515
|
Renderer.prototype._cloneTo.call(this, target);
|
|
@@ -10469,6 +10549,20 @@ SimpleSpriteAssembler = __decorate$1([
|
|
|
10469
10549
|
context.camera._renderPipeline._allSpriteMasks.add(this);
|
|
10470
10550
|
this._maskElement = maskElement;
|
|
10471
10551
|
};
|
|
10552
|
+
/**
|
|
10553
|
+
* @internal
|
|
10554
|
+
* @inheritdoc
|
|
10555
|
+
*/ _proto._onDestroy = function _onDestroy() {
|
|
10556
|
+
Renderer.prototype._onDestroy.call(this);
|
|
10557
|
+
var sprite = this._sprite;
|
|
10558
|
+
if (sprite) {
|
|
10559
|
+
sprite._addRefCount(-1);
|
|
10560
|
+
sprite._updateFlagManager.removeListener(this._onSpriteChange);
|
|
10561
|
+
}
|
|
10562
|
+
this._entity = null;
|
|
10563
|
+
this._sprite = null;
|
|
10564
|
+
this._renderData = null;
|
|
10565
|
+
};
|
|
10472
10566
|
_proto._calDefaultSize = function _calDefaultSize() {
|
|
10473
10567
|
var sprite = this._sprite;
|
|
10474
10568
|
if (sprite) {
|
|
@@ -10587,9 +10681,13 @@ SimpleSpriteAssembler = __decorate$1([
|
|
|
10587
10681
|
set: function set(value) {
|
|
10588
10682
|
var lastSprite = this._sprite;
|
|
10589
10683
|
if (lastSprite !== value) {
|
|
10590
|
-
|
|
10684
|
+
if (lastSprite) {
|
|
10685
|
+
lastSprite._addRefCount(-1);
|
|
10686
|
+
lastSprite._updateFlagManager.removeListener(this._onSpriteChange);
|
|
10687
|
+
}
|
|
10591
10688
|
this._dirtyUpdateFlag |= 0x7;
|
|
10592
10689
|
if (value) {
|
|
10690
|
+
value._addRefCount(1);
|
|
10593
10691
|
value._updateFlagManager.addListener(this._onSpriteChange);
|
|
10594
10692
|
this.shaderData.setTexture(SpriteMask._textureProperty, value.texture);
|
|
10595
10693
|
} else {
|
|
@@ -11056,14 +11154,19 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
11056
11154
|
}();
|
|
11057
11155
|
/**
|
|
11058
11156
|
* Sub-mesh, mainly contains drawing information.
|
|
11059
|
-
*/ var SubMesh = function
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11157
|
+
*/ var SubMesh = /*#__PURE__*/ function() {
|
|
11158
|
+
var SubMesh = function SubMesh(start, count, topology) {
|
|
11159
|
+
if (start === void 0) start = 0;
|
|
11160
|
+
if (count === void 0) count = 0;
|
|
11161
|
+
if (topology === void 0) topology = exports.MeshTopology.Triangles;
|
|
11162
|
+
this.start = start;
|
|
11163
|
+
this.count = count;
|
|
11164
|
+
this.topology = topology;
|
|
11165
|
+
};
|
|
11166
|
+
var _proto = SubMesh.prototype;
|
|
11167
|
+
_proto.dispose = function dispose() {};
|
|
11168
|
+
return SubMesh;
|
|
11169
|
+
}();
|
|
11067
11170
|
/**
|
|
11068
11171
|
* Mesh.
|
|
11069
11172
|
*/ var Mesh = /*#__PURE__*/ function(RefObject) {
|
|
@@ -11144,10 +11247,11 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
11144
11247
|
/**
|
|
11145
11248
|
* @internal
|
|
11146
11249
|
*/ _proto._setVertexBufferBinding = function _setVertexBufferBinding(index, binding) {
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11250
|
+
var referCount = this._getRefCount();
|
|
11251
|
+
if (referCount > 0) {
|
|
11252
|
+
var _this__vertexBufferBindings_index;
|
|
11253
|
+
(_this__vertexBufferBindings_index = this._vertexBufferBindings[index]) == null ? void 0 : _this__vertexBufferBindings_index._buffer._addRefCount(-referCount);
|
|
11254
|
+
binding == null ? void 0 : binding._buffer._addRefCount(referCount);
|
|
11151
11255
|
}
|
|
11152
11256
|
this._vertexBufferBindings[index] = binding;
|
|
11153
11257
|
this._bufferStructChanged = true;
|
|
@@ -11161,11 +11265,13 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
11161
11265
|
/**
|
|
11162
11266
|
* @override
|
|
11163
11267
|
*/ _proto._addRefCount = function _addRefCount(value) {
|
|
11268
|
+
var _this__indexBufferBinding;
|
|
11164
11269
|
RefObject.prototype._addRefCount.call(this, value);
|
|
11165
11270
|
var vertexBufferBindings = this._vertexBufferBindings;
|
|
11166
11271
|
for(var i = 0, n = vertexBufferBindings.length; i < n; i++){
|
|
11167
11272
|
vertexBufferBindings[i]._buffer._addRefCount(value);
|
|
11168
11273
|
}
|
|
11274
|
+
(_this__indexBufferBinding = this._indexBufferBinding) == null ? void 0 : _this__indexBufferBinding._buffer._addRefCount(value);
|
|
11169
11275
|
};
|
|
11170
11276
|
/**
|
|
11171
11277
|
* @override
|
|
@@ -11175,6 +11281,7 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
11175
11281
|
this._indexBufferBinding = null;
|
|
11176
11282
|
this._vertexElements = null;
|
|
11177
11283
|
this._vertexElementMap = null;
|
|
11284
|
+
this._updateFlagManager = null;
|
|
11178
11285
|
this._platformPrimitive.destroy();
|
|
11179
11286
|
};
|
|
11180
11287
|
_proto._setVertexElements = function _setVertexElements(elements) {
|
|
@@ -11185,6 +11292,11 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
11185
11292
|
};
|
|
11186
11293
|
_proto._setIndexBufferBinding = function _setIndexBufferBinding(binding) {
|
|
11187
11294
|
var lastBinding = this._indexBufferBinding;
|
|
11295
|
+
var referCount = this._getRefCount();
|
|
11296
|
+
if (referCount > 0) {
|
|
11297
|
+
lastBinding == null ? void 0 : lastBinding.buffer._addRefCount(-referCount);
|
|
11298
|
+
binding == null ? void 0 : binding.buffer._addRefCount(referCount);
|
|
11299
|
+
}
|
|
11188
11300
|
if (binding) {
|
|
11189
11301
|
this._indexBufferBinding = binding;
|
|
11190
11302
|
this._glIndexType = BufferUtil._getGLIndexType(binding.format);
|
|
@@ -12849,8 +12961,8 @@ var VertexChangedFlags;
|
|
|
12849
12961
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
12850
12962
|
Renderer.prototype._onDestroy.call(this);
|
|
12851
12963
|
var mesh = this._mesh;
|
|
12852
|
-
if (mesh
|
|
12853
|
-
mesh._addRefCount(-1);
|
|
12964
|
+
if (mesh) {
|
|
12965
|
+
mesh.destroyed || mesh._addRefCount(-1);
|
|
12854
12966
|
mesh._updateFlagManager.removeListener(this._onMeshChanged);
|
|
12855
12967
|
this._mesh = null;
|
|
12856
12968
|
}
|
|
@@ -13184,10 +13296,21 @@ var rePropName = RegExp("[^.[\\]]+" + "|" + // Or match property names within br
|
|
|
13184
13296
|
* @internal
|
|
13185
13297
|
* @override
|
|
13186
13298
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
13187
|
-
var
|
|
13299
|
+
var _this__rootBone, _this__jointTexture;
|
|
13188
13300
|
MeshRenderer.prototype._onDestroy.call(this);
|
|
13189
|
-
(
|
|
13301
|
+
(_this__rootBone = this._rootBone) == null ? void 0 : _this__rootBone.transform._updateFlagManager.removeListener(this._onTransformChanged);
|
|
13302
|
+
this._rootBone = null;
|
|
13303
|
+
this._jointDataCreateCache = null;
|
|
13304
|
+
this._skin = null;
|
|
13305
|
+
this._blendShapeWeights = null;
|
|
13306
|
+
this._localBounds = null;
|
|
13307
|
+
this._jointMatrices = null;
|
|
13190
13308
|
(_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
|
|
13309
|
+
this._jointTexture = null;
|
|
13310
|
+
if (this._jointEntities) {
|
|
13311
|
+
this._jointEntities.length = 0;
|
|
13312
|
+
this._jointEntities = null;
|
|
13313
|
+
}
|
|
13191
13314
|
};
|
|
13192
13315
|
/**
|
|
13193
13316
|
* @internal
|
|
@@ -14344,14 +14467,17 @@ var Basic2DBatcher = /*#__PURE__*/ function() {
|
|
|
14344
14467
|
_proto._createMesh = function _createMesh(engine, index) {
|
|
14345
14468
|
var MAX_VERTEX_COUNT = Basic2DBatcher.MAX_VERTEX_COUNT;
|
|
14346
14469
|
var mesh = new BufferMesh(engine, "BufferMesh" + index);
|
|
14470
|
+
mesh.isGCIgnored = true;
|
|
14347
14471
|
var vertexElements = [];
|
|
14348
14472
|
var vertexStride = this.createVertexElements(vertexElements);
|
|
14349
14473
|
// vertices
|
|
14350
|
-
this._vertexBuffers[index] = new Buffer(engine, exports.BufferBindFlag.VertexBuffer, MAX_VERTEX_COUNT * 4 * vertexStride, exports.BufferUsage.Dynamic);
|
|
14474
|
+
var vertexBuffer = this._vertexBuffers[index] = new Buffer(engine, exports.BufferBindFlag.VertexBuffer, MAX_VERTEX_COUNT * 4 * vertexStride, exports.BufferUsage.Dynamic);
|
|
14475
|
+
vertexBuffer.isGCIgnored = true;
|
|
14351
14476
|
// indices
|
|
14352
|
-
this._indiceBuffers[index] = new Buffer(engine, exports.BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT * 2 * 3, exports.BufferUsage.Dynamic);
|
|
14353
|
-
|
|
14354
|
-
mesh.
|
|
14477
|
+
var indiceBuffer = this._indiceBuffers[index] = new Buffer(engine, exports.BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT * 2 * 3, exports.BufferUsage.Dynamic);
|
|
14478
|
+
indiceBuffer.isGCIgnored = true;
|
|
14479
|
+
mesh.setVertexBufferBinding(vertexBuffer, vertexStride);
|
|
14480
|
+
mesh.setIndexBufferBinding(indiceBuffer, exports.IndexFormat.UInt16);
|
|
14355
14481
|
mesh.setVertexElements(vertexElements);
|
|
14356
14482
|
return mesh;
|
|
14357
14483
|
};
|
|
@@ -14559,6 +14685,11 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14559
14685
|
return _this;
|
|
14560
14686
|
};
|
|
14561
14687
|
_inherits$2(TextRenderElement, RenderElement);
|
|
14688
|
+
var _proto = TextRenderElement.prototype;
|
|
14689
|
+
_proto.dispose = function dispose() {
|
|
14690
|
+
this.component = this.material = this.renderState = this.shaderPass = null;
|
|
14691
|
+
this.charElements.length = 0;
|
|
14692
|
+
};
|
|
14562
14693
|
return TextRenderElement;
|
|
14563
14694
|
}(RenderElement);
|
|
14564
14695
|
/**
|
|
@@ -14584,6 +14715,12 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14584
14715
|
var _proto = Sky.prototype;
|
|
14585
14716
|
/**
|
|
14586
14717
|
* @internal
|
|
14718
|
+
*/ _proto.destroy = function destroy() {
|
|
14719
|
+
this.mesh = null;
|
|
14720
|
+
this.material = null;
|
|
14721
|
+
};
|
|
14722
|
+
/**
|
|
14723
|
+
* @internal
|
|
14587
14724
|
*/ _proto._render = function _render(context) {
|
|
14588
14725
|
var _this = this, material = _this.material, mesh = _this.mesh;
|
|
14589
14726
|
if (!material) {
|
|
@@ -14622,6 +14759,40 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14622
14759
|
rhi.drawPrimitive(mesh, mesh.subMesh, program);
|
|
14623
14760
|
cameraShaderData.setMatrix(RenderContext._vpMatrixProperty, originViewProjMatrix);
|
|
14624
14761
|
};
|
|
14762
|
+
_create_class$2(Sky, [
|
|
14763
|
+
{
|
|
14764
|
+
key: "material",
|
|
14765
|
+
get: /**
|
|
14766
|
+
* Material of the sky.
|
|
14767
|
+
*/ function get() {
|
|
14768
|
+
return this._material;
|
|
14769
|
+
},
|
|
14770
|
+
set: function set(value) {
|
|
14771
|
+
if (this._material !== value) {
|
|
14772
|
+
var _this__material;
|
|
14773
|
+
value == null ? void 0 : value._addRefCount(1);
|
|
14774
|
+
(_this__material = this._material) == null ? void 0 : _this__material._addRefCount(-1);
|
|
14775
|
+
this._material = value;
|
|
14776
|
+
}
|
|
14777
|
+
}
|
|
14778
|
+
},
|
|
14779
|
+
{
|
|
14780
|
+
key: "mesh",
|
|
14781
|
+
get: /**
|
|
14782
|
+
* Mesh of the sky.
|
|
14783
|
+
*/ function get() {
|
|
14784
|
+
return this._mesh;
|
|
14785
|
+
},
|
|
14786
|
+
set: function set(value) {
|
|
14787
|
+
if (this._mesh !== value) {
|
|
14788
|
+
var _this__mesh;
|
|
14789
|
+
value == null ? void 0 : value._addRefCount(1);
|
|
14790
|
+
(_this__mesh = this._mesh) == null ? void 0 : _this__mesh._addRefCount(-1);
|
|
14791
|
+
this._mesh = value;
|
|
14792
|
+
}
|
|
14793
|
+
}
|
|
14794
|
+
}
|
|
14795
|
+
]);
|
|
14625
14796
|
return Sky;
|
|
14626
14797
|
}();
|
|
14627
14798
|
(function() {
|
|
@@ -14651,11 +14822,27 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14651
14822
|
this.sky = new Sky();
|
|
14652
14823
|
this./** @internal */ _textureFillMode = exports.BackgroundTextureFillMode.AspectFitHeight;
|
|
14653
14824
|
this._texture = null;
|
|
14654
|
-
this.
|
|
14825
|
+
this._initMesh(_engine);
|
|
14655
14826
|
};
|
|
14656
14827
|
var _proto = Background.prototype;
|
|
14657
14828
|
/**
|
|
14658
14829
|
* @internal
|
|
14830
|
+
*/ _proto.destroy = function destroy() {
|
|
14831
|
+
this._mesh._addRefCount(-1);
|
|
14832
|
+
this._mesh = null;
|
|
14833
|
+
this.texture = null;
|
|
14834
|
+
this.solidColor = null;
|
|
14835
|
+
this.sky.destroy();
|
|
14836
|
+
};
|
|
14837
|
+
/**
|
|
14838
|
+
* @internal
|
|
14839
|
+
* Standalone for CanvasRenderer plugin.
|
|
14840
|
+
*/ _proto._initMesh = function _initMesh(engine) {
|
|
14841
|
+
this._mesh = this._createPlane(engine);
|
|
14842
|
+
this._mesh._addRefCount(1);
|
|
14843
|
+
};
|
|
14844
|
+
/**
|
|
14845
|
+
* @internal
|
|
14659
14846
|
*/ _proto._resizeBackgroundTexture = function _resizeBackgroundTexture() {
|
|
14660
14847
|
if (!this._texture) {
|
|
14661
14848
|
return;
|
|
@@ -14724,6 +14911,9 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14724
14911
|
},
|
|
14725
14912
|
set: function set(value) {
|
|
14726
14913
|
if (this._texture !== value) {
|
|
14914
|
+
var _this__texture;
|
|
14915
|
+
value == null ? void 0 : value._addRefCount(1);
|
|
14916
|
+
(_this__texture = this._texture) == null ? void 0 : _this__texture._addRefCount(-1);
|
|
14727
14917
|
this._texture = value;
|
|
14728
14918
|
this._engine._backgroundTextureMaterial.shaderData.setTexture("u_baseTexture", value);
|
|
14729
14919
|
}
|
|
@@ -15023,8 +15213,6 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15023
15213
|
function Scene(engine, name) {
|
|
15024
15214
|
var _this;
|
|
15025
15215
|
_this = EngineObject.call(this, engine) || this;
|
|
15026
|
-
/** The background of the scene. */ _this.background = new Background(_this._engine);
|
|
15027
|
-
/** Scene-related shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Scene);
|
|
15028
15216
|
/** If cast shadows. */ _this.castShadows = true;
|
|
15029
15217
|
/** The resolution of the shadow maps. */ _this.shadowResolution = exports.ShadowResolution.Medium;
|
|
15030
15218
|
/** The splits of two cascade distribution. */ _this.shadowTwoCascadeSplits = 1.0 / 3.0;
|
|
@@ -15034,6 +15222,8 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15034
15222
|
/** @internal */ _this._isActiveInEngine = false;
|
|
15035
15223
|
/** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
|
|
15036
15224
|
/** @internal */ _this._rootEntities = [];
|
|
15225
|
+
_this._background = new Background(_this._engine);
|
|
15226
|
+
_this._shaderData = new ShaderData(ShaderDataGroup.Scene);
|
|
15037
15227
|
_this._shadowCascades = exports.ShadowCascadesMode.NoCascades;
|
|
15038
15228
|
_this._fogMode = exports.FogMode.None;
|
|
15039
15229
|
_this._fogColor = new miniprogram$7.Color(0.5, 0.5, 0.5, 1.0);
|
|
@@ -15204,6 +15394,8 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15204
15394
|
shaderData.setVector3(Scene._sunlightColorProperty, this._sunlightVector3);
|
|
15205
15395
|
shaderData.setVector3(Scene._sunlightDirectionProperty, sunlight.direction);
|
|
15206
15396
|
this._sunLight = sunlight;
|
|
15397
|
+
} else {
|
|
15398
|
+
this._sunLight = null;
|
|
15207
15399
|
}
|
|
15208
15400
|
if (this.castShadows && this._sunLight && this._sunLight.shadowType !== exports.ShadowType.None) {
|
|
15209
15401
|
shaderData.enableMacro("SHADOW_TYPE", this._sunLight.shadowType.toString());
|
|
@@ -15232,6 +15424,7 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15232
15424
|
this._rootEntities[0].destroy();
|
|
15233
15425
|
}
|
|
15234
15426
|
this._activeCameras.length = 0;
|
|
15427
|
+
this.background.destroy();
|
|
15235
15428
|
this.shaderData._addRefCount(-1);
|
|
15236
15429
|
};
|
|
15237
15430
|
_proto._addToRootEntityList = function _addToRootEntityList(index, rootEntity) {
|
|
@@ -15262,6 +15455,22 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15262
15455
|
this._fogParams.w = density / Math.sqrt(Math.LN2);
|
|
15263
15456
|
};
|
|
15264
15457
|
_create_class$2(Scene, [
|
|
15458
|
+
{
|
|
15459
|
+
key: "shaderData",
|
|
15460
|
+
get: /**
|
|
15461
|
+
* Scene-related shader data.
|
|
15462
|
+
*/ function get() {
|
|
15463
|
+
return this._shaderData;
|
|
15464
|
+
}
|
|
15465
|
+
},
|
|
15466
|
+
{
|
|
15467
|
+
key: "background",
|
|
15468
|
+
get: /**
|
|
15469
|
+
* The background of the scene.
|
|
15470
|
+
*/ function get() {
|
|
15471
|
+
return this._background;
|
|
15472
|
+
}
|
|
15473
|
+
},
|
|
15265
15474
|
{
|
|
15266
15475
|
key: "shadowCascades",
|
|
15267
15476
|
get: /**
|
|
@@ -15628,7 +15837,7 @@ ShaderPool.init();
|
|
|
15628
15837
|
_this._spriteDefaultMaterial = _this._createSpriteMaterial();
|
|
15629
15838
|
_this._spriteMaskDefaultMaterial = _this._createSpriteMaskMaterial();
|
|
15630
15839
|
_this._textDefaultFont = Font.createFromOS(_assert_this_initialized(_this), "Arial");
|
|
15631
|
-
_this._textDefaultFont.isGCIgnored =
|
|
15840
|
+
_this._textDefaultFont.isGCIgnored = true;
|
|
15632
15841
|
_this.inputManager = new InputManager(_assert_this_initialized(_this));
|
|
15633
15842
|
var magentaPixel = new Uint8Array([
|
|
15634
15843
|
255,
|
|
@@ -15663,6 +15872,7 @@ ShaderPool.init();
|
|
|
15663
15872
|
_this._magentaTexture2DArray = magentaTexture2DArray;
|
|
15664
15873
|
}
|
|
15665
15874
|
var magentaMaterial = new Material(_assert_this_initialized(_this), Shader.find("unlit"));
|
|
15875
|
+
magentaMaterial.isGCIgnored = true;
|
|
15666
15876
|
magentaMaterial.shaderData.setColor("u_baseColor", new Color(1.0, 0.0, 1.01, 1.0));
|
|
15667
15877
|
_this._magentaMaterial = magentaMaterial;
|
|
15668
15878
|
var backgroundTextureMaterial = new Material(_assert_this_initialized(_this), Shader.find("background-texture"));
|
|
@@ -17188,7 +17398,11 @@ var /**
|
|
|
17188
17398
|
var height = shadowCascades == exports.ShadowCascadesMode.TwoCascades ? shadowTileResolution : shadowTileResolution * 2;
|
|
17189
17399
|
this._shadowMapSize.set(1.0 / width, 1.0 / height, width, height);
|
|
17190
17400
|
}
|
|
17191
|
-
this._renderTargets
|
|
17401
|
+
var renderTargets = this._renderTargets;
|
|
17402
|
+
if (renderTargets) {
|
|
17403
|
+
renderTargets.destroy();
|
|
17404
|
+
this._renderTargets = null;
|
|
17405
|
+
}
|
|
17192
17406
|
var viewportOffset = this._viewportOffsets;
|
|
17193
17407
|
var shadowTileResolution1 = this._shadowTileResolution;
|
|
17194
17408
|
switch(shadowCascades){
|
|
@@ -17519,7 +17733,6 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17519
17733
|
var Camera1 = function Camera1(entity) {
|
|
17520
17734
|
var _this;
|
|
17521
17735
|
_this = Component.call(this, entity) || this;
|
|
17522
|
-
/** Shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
17523
17736
|
/** Rendering priority - A Camera with higher priority will be rendered on top of a camera with lower priority. */ _this.priority = 0;
|
|
17524
17737
|
/** Whether to enable frustum culling, it is enabled by default. */ _this.enableFrustumCulling = true;
|
|
17525
17738
|
/**
|
|
@@ -17533,6 +17746,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17533
17746
|
/** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
|
|
17534
17747
|
/** @internal */ _this._frustum = new miniprogram$7.BoundingFrustum();
|
|
17535
17748
|
/** @internal */ _this._virtualCamera = new VirtualCamera();
|
|
17749
|
+
_this._shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
17536
17750
|
_this._isProjMatSetting = false;
|
|
17537
17751
|
_this._nearClipPlane = 0.1;
|
|
17538
17752
|
_this._farClipPlane = 100;
|
|
@@ -17732,6 +17946,20 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17732
17946
|
this._isInvViewProjDirty.destroy();
|
|
17733
17947
|
this._isViewMatrixDirty.destroy();
|
|
17734
17948
|
this.shaderData._addRefCount(-1);
|
|
17949
|
+
this._entity = null;
|
|
17950
|
+
this._globalShaderMacro = null;
|
|
17951
|
+
this._frustum = null;
|
|
17952
|
+
this._renderPipeline = null;
|
|
17953
|
+
this._virtualCamera = null;
|
|
17954
|
+
this._shaderData = null;
|
|
17955
|
+
this._frustumViewChangeFlag = null;
|
|
17956
|
+
this._transform = null;
|
|
17957
|
+
this._isViewMatrixDirty = null;
|
|
17958
|
+
this._isInvViewProjDirty = null;
|
|
17959
|
+
this._viewport = null;
|
|
17960
|
+
this._inverseProjectionMatrix = null;
|
|
17961
|
+
this._lastAspectSize = null;
|
|
17962
|
+
this._invViewProjMat = null;
|
|
17735
17963
|
};
|
|
17736
17964
|
_proto._projMatChange = function _projMatChange() {
|
|
17737
17965
|
this._isFrustumProjectDirty = true;
|
|
@@ -17771,6 +17999,14 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17771
17999
|
return this._inverseProjectionMatrix;
|
|
17772
18000
|
};
|
|
17773
18001
|
_create_class$2(Camera1, [
|
|
18002
|
+
{
|
|
18003
|
+
key: "shaderData",
|
|
18004
|
+
get: /**
|
|
18005
|
+
* Shader data.
|
|
18006
|
+
*/ function get() {
|
|
18007
|
+
return this._shaderData;
|
|
18008
|
+
}
|
|
18009
|
+
},
|
|
17774
18010
|
{
|
|
17775
18011
|
key: "nearClipPlane",
|
|
17776
18012
|
get: /**
|
|
@@ -19210,10 +19446,17 @@ exports.TextVerticalAlignment = void 0;
|
|
|
19210
19446
|
* @internal
|
|
19211
19447
|
*/ _proto._addSprite = function _addSprite(sprite) {
|
|
19212
19448
|
this._spriteNamesToIndex[sprite.name] = this._sprites.push(sprite) - 1;
|
|
19449
|
+
sprite._atlas = this;
|
|
19450
|
+
sprite.isGCIgnored = true;
|
|
19213
19451
|
};
|
|
19214
19452
|
/**
|
|
19215
19453
|
* @override
|
|
19216
19454
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
19455
|
+
var _this = this, sprites = _this._sprites;
|
|
19456
|
+
for(var i = 0, n = sprites.length; i < n; i++){
|
|
19457
|
+
sprites[i].destroy();
|
|
19458
|
+
}
|
|
19459
|
+
sprites.length = 0;
|
|
19217
19460
|
this._sprites = null;
|
|
19218
19461
|
this._spriteNamesToIndex = null;
|
|
19219
19462
|
};
|
|
@@ -19312,10 +19555,29 @@ exports.TextVerticalAlignment = void 0;
|
|
|
19312
19555
|
};
|
|
19313
19556
|
/**
|
|
19314
19557
|
* @override
|
|
19558
|
+
* @internal
|
|
19559
|
+
*/ _proto._addRefCount = function _addRefCount(value) {
|
|
19560
|
+
var _this__atlas;
|
|
19561
|
+
RefObject.prototype._addRefCount.call(this, value);
|
|
19562
|
+
(_this__atlas = this._atlas) == null ? void 0 : _this__atlas._addRefCount(value);
|
|
19563
|
+
};
|
|
19564
|
+
/**
|
|
19565
|
+
* @override
|
|
19566
|
+
* @internal
|
|
19315
19567
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
19316
|
-
|
|
19317
|
-
|
|
19318
|
-
|
|
19568
|
+
this._positions.length = 0;
|
|
19569
|
+
this._positions = null;
|
|
19570
|
+
this._uvs.length = 0;
|
|
19571
|
+
this._uvs = null;
|
|
19572
|
+
this._atlasRegion = null;
|
|
19573
|
+
this._atlasRegionOffset = null;
|
|
19574
|
+
this._region = null;
|
|
19575
|
+
this._pivot = null;
|
|
19576
|
+
this._border = null;
|
|
19577
|
+
this._bounds = null;
|
|
19578
|
+
this._atlas = null;
|
|
19579
|
+
this._texture = null;
|
|
19580
|
+
this._updateFlagManager = null;
|
|
19319
19581
|
};
|
|
19320
19582
|
_proto._calDefaultSize = function _calDefaultSize() {
|
|
19321
19583
|
if (this._texture) {
|
|
@@ -19418,7 +19680,7 @@ exports.TextVerticalAlignment = void 0;
|
|
|
19418
19680
|
key: "width",
|
|
19419
19681
|
get: /**
|
|
19420
19682
|
* The width of the sprite (in world coordinates).
|
|
19421
|
-
*
|
|
19683
|
+
*
|
|
19422
19684
|
* @remarks
|
|
19423
19685
|
* If width is set, return the set value,
|
|
19424
19686
|
* otherwise return the width calculated according to `Texture.width`, `Sprite.region`, `Sprite.atlasRegion`, `Sprite.atlasRegionOffset` and `Engine._pixelsPerUnit`.
|
|
@@ -19441,7 +19703,7 @@ exports.TextVerticalAlignment = void 0;
|
|
|
19441
19703
|
key: "height",
|
|
19442
19704
|
get: /**
|
|
19443
19705
|
* The height of the sprite (in world coordinates).
|
|
19444
|
-
*
|
|
19706
|
+
*
|
|
19445
19707
|
* @remarks
|
|
19446
19708
|
* If height is set, return the set value,
|
|
19447
19709
|
* otherwise return the height calculated according to `Texture.height`, `Sprite.region`, `Sprite.atlasRegion`, `Sprite.atlasRegionOffset` and `Engine._pixelsPerUnit`.
|
|
@@ -19747,17 +20009,6 @@ SlicedSpriteAssembler = __decorate$1([
|
|
|
19747
20009
|
target.drawMode = this._drawMode;
|
|
19748
20010
|
};
|
|
19749
20011
|
/**
|
|
19750
|
-
* @internal
|
|
19751
|
-
*/ _proto._onDestroy = function _onDestroy() {
|
|
19752
|
-
var _this__sprite;
|
|
19753
|
-
(_this__sprite = this._sprite) == null ? void 0 : _this__sprite._updateFlagManager.removeListener(this._onSpriteChange);
|
|
19754
|
-
this._color = null;
|
|
19755
|
-
this._sprite = null;
|
|
19756
|
-
this._assembler = null;
|
|
19757
|
-
this._renderData = null;
|
|
19758
|
-
Renderer.prototype._onDestroy.call(this);
|
|
19759
|
-
};
|
|
19760
|
-
/**
|
|
19761
20012
|
* @override
|
|
19762
20013
|
*/ _proto._updateBounds = function _updateBounds(worldBounds) {
|
|
19763
20014
|
if (this.sprite) {
|
|
@@ -19795,6 +20046,21 @@ SlicedSpriteAssembler = __decorate$1([
|
|
|
19795
20046
|
context.camera._renderPipeline.pushPrimitive(spriteElement);
|
|
19796
20047
|
}
|
|
19797
20048
|
};
|
|
20049
|
+
/**
|
|
20050
|
+
* @internal
|
|
20051
|
+
*/ _proto._onDestroy = function _onDestroy() {
|
|
20052
|
+
Renderer.prototype._onDestroy.call(this);
|
|
20053
|
+
var sprite = this._sprite;
|
|
20054
|
+
if (sprite) {
|
|
20055
|
+
sprite._addRefCount(-1);
|
|
20056
|
+
sprite._updateFlagManager.removeListener(this._onSpriteChange);
|
|
20057
|
+
}
|
|
20058
|
+
this._entity = null;
|
|
20059
|
+
this._color = null;
|
|
20060
|
+
this._sprite = null;
|
|
20061
|
+
this._assembler = null;
|
|
20062
|
+
this._renderData = null;
|
|
20063
|
+
};
|
|
19798
20064
|
_proto._calDefaultSize = function _calDefaultSize() {
|
|
19799
20065
|
var sprite = this._sprite;
|
|
19800
20066
|
if (sprite) {
|
|
@@ -19886,9 +20152,13 @@ SlicedSpriteAssembler = __decorate$1([
|
|
|
19886
20152
|
set: function set(value) {
|
|
19887
20153
|
var lastSprite = this._sprite;
|
|
19888
20154
|
if (lastSprite !== value) {
|
|
19889
|
-
|
|
20155
|
+
if (lastSprite) {
|
|
20156
|
+
lastSprite._addRefCount(-1);
|
|
20157
|
+
lastSprite._updateFlagManager.removeListener(this._onSpriteChange);
|
|
20158
|
+
}
|
|
19890
20159
|
this._dirtyUpdateFlag |= 0x7;
|
|
19891
20160
|
if (value) {
|
|
20161
|
+
value._addRefCount(1);
|
|
19892
20162
|
value._updateFlagManager.addListener(this._onSpriteChange);
|
|
19893
20163
|
this.shaderData.setTexture(SpriteRenderer._textureProperty, value.texture);
|
|
19894
20164
|
} else {
|
|
@@ -22302,9 +22572,16 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22302
22572
|
})(LayerState || (LayerState = {}));
|
|
22303
22573
|
/**
|
|
22304
22574
|
* @internal
|
|
22305
|
-
*/ var AnimationEventHandler = function
|
|
22306
|
-
|
|
22307
|
-
|
|
22575
|
+
*/ var AnimationEventHandler = /*#__PURE__*/ function() {
|
|
22576
|
+
var AnimationEventHandler = function AnimationEventHandler() {
|
|
22577
|
+
this.handlers = [];
|
|
22578
|
+
};
|
|
22579
|
+
var _proto = AnimationEventHandler.prototype;
|
|
22580
|
+
_proto.dispose = function dispose() {
|
|
22581
|
+
this.handlers.length = 0;
|
|
22582
|
+
};
|
|
22583
|
+
return AnimationEventHandler;
|
|
22584
|
+
}();
|
|
22308
22585
|
/**
|
|
22309
22586
|
* Transitions define when and how the state machine switch from on state to another. AnimatorTransition always originate from a StateMachine or a StateMachine entry.
|
|
22310
22587
|
*/ var AnimatorStateTransition = function AnimatorStateTransition() {
|
|
@@ -26112,6 +26389,10 @@ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
|
|
|
26112
26389
|
}
|
|
26113
26390
|
glTFResource.sceneRoots = sceneRoots;
|
|
26114
26391
|
glTFResource.defaultSceneRoot = sceneRoots[sceneID];
|
|
26392
|
+
// @ts-ignore
|
|
26393
|
+
glTFResource.defaultSceneRoot._hookResource = glTFResource;
|
|
26394
|
+
// @ts-ignore
|
|
26395
|
+
glTFResource._addRefCount(1);
|
|
26115
26396
|
};
|
|
26116
26397
|
return GLTFEntityParser;
|
|
26117
26398
|
}(GLTFParser);
|
|
@@ -26833,36 +27114,20 @@ var GLTFValidator = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
26833
27114
|
})();
|
|
26834
27115
|
/**
|
|
26835
27116
|
* Product after GLTF parser, usually, `defaultSceneRoot` is only needed to use.
|
|
26836
|
-
*/ var GLTFResource = /*#__PURE__*/ function(
|
|
27117
|
+
*/ var GLTFResource = /*#__PURE__*/ function(RefObject) {
|
|
26837
27118
|
var GLTFResource = function GLTFResource(engine, url) {
|
|
26838
27119
|
var _this;
|
|
26839
|
-
_this =
|
|
27120
|
+
_this = RefObject.call(this, engine) || this;
|
|
26840
27121
|
_this.url = url;
|
|
26841
27122
|
return _this;
|
|
26842
27123
|
};
|
|
26843
|
-
_inherits$1(GLTFResource,
|
|
27124
|
+
_inherits$1(GLTFResource, RefObject);
|
|
26844
27125
|
var _proto = GLTFResource.prototype;
|
|
26845
27126
|
/**
|
|
26846
|
-
* @
|
|
26847
|
-
*/ _proto.
|
|
26848
|
-
if (this._destroyed) {
|
|
26849
|
-
return;
|
|
26850
|
-
}
|
|
26851
|
-
EngineObject.prototype.destroy.call(this);
|
|
26852
|
-
this.defaultSceneRoot.destroy();
|
|
26853
|
-
this.textures = null;
|
|
26854
|
-
this.materials = null;
|
|
26855
|
-
this.meshes = null;
|
|
26856
|
-
this.skins = null;
|
|
26857
|
-
this.animations = null;
|
|
26858
|
-
this.entities = null;
|
|
26859
|
-
this.cameras = null;
|
|
26860
|
-
this.lights = null;
|
|
26861
|
-
this.sceneRoots = null;
|
|
26862
|
-
this.extensionsData = null;
|
|
26863
|
-
};
|
|
27127
|
+
* @internal
|
|
27128
|
+
*/ _proto._onDestroy = function _onDestroy() {};
|
|
26864
27129
|
return GLTFResource;
|
|
26865
|
-
}(miniprogram$5.
|
|
27130
|
+
}(miniprogram$5.RefObject);
|
|
26866
27131
|
var GLTFLoader = /*#__PURE__*/ function(Loader) {
|
|
26867
27132
|
var GLTFLoader = function GLTFLoader() {
|
|
26868
27133
|
return Loader.apply(this, arguments);
|
|
@@ -26886,8 +27151,14 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
|
|
|
26886
27151
|
}
|
|
26887
27152
|
});
|
|
26888
27153
|
((params == null ? void 0 : params.pipeline) || GLTFPipeline.defaultPipeline)._parse(context).then(masterPromiseInfo.resolve).catch(function(e) {
|
|
26889
|
-
|
|
26890
|
-
|
|
27154
|
+
var msg = "Error loading glTF model from " + url + " .";
|
|
27155
|
+
miniprogram$5.Logger.error(msg);
|
|
27156
|
+
masterPromiseInfo.reject(msg);
|
|
27157
|
+
context.defaultSceneRootPromiseInfo.reject(e);
|
|
27158
|
+
context.texturesPromiseInfo.reject(e);
|
|
27159
|
+
context.materialsPromiseInfo.reject(e);
|
|
27160
|
+
context.meshesPromiseInfo.reject(e);
|
|
27161
|
+
context.animationClipsPromiseInfo.reject(e);
|
|
26891
27162
|
});
|
|
26892
27163
|
return context.promiseMap;
|
|
26893
27164
|
};
|
|
@@ -28416,7 +28687,7 @@ exports.MeshLoader = /*#__PURE__*/ function(Loader) {
|
|
|
28416
28687
|
decode(data, resourceManager.engine).then(function(mesh) {
|
|
28417
28688
|
resolve(mesh);
|
|
28418
28689
|
});
|
|
28419
|
-
});
|
|
28690
|
+
}).catch(reject);
|
|
28420
28691
|
});
|
|
28421
28692
|
};
|
|
28422
28693
|
return MeshLoader;
|
|
@@ -28434,14 +28705,14 @@ exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
|
|
|
28434
28705
|
var _proto = EditorTextureLoader.prototype;
|
|
28435
28706
|
_proto.load = function load(item, resourceManager) {
|
|
28436
28707
|
var _this = this;
|
|
28437
|
-
return new miniprogram$5.AssetPromise(function(resolve) {
|
|
28708
|
+
return new miniprogram$5.AssetPromise(function(resolve, reject) {
|
|
28438
28709
|
_this.request(item.url, {
|
|
28439
28710
|
type: "arraybuffer"
|
|
28440
28711
|
}).then(function(data) {
|
|
28441
28712
|
decode(data, resourceManager.engine).then(function(texture) {
|
|
28442
28713
|
resolve(texture);
|
|
28443
28714
|
});
|
|
28444
|
-
});
|
|
28715
|
+
}).catch(reject);
|
|
28445
28716
|
});
|
|
28446
28717
|
};
|
|
28447
28718
|
return EditorTextureLoader;
|
|
@@ -36020,7 +36291,7 @@ function _interopNamespace(e) {
|
|
|
36020
36291
|
}
|
|
36021
36292
|
var CoreObjects__namespace = /*#__PURE__*/ _interopNamespace(CoreObjects);
|
|
36022
36293
|
//@ts-ignore
|
|
36023
|
-
var version = "0.0.0-experimental-0.9-plus.
|
|
36294
|
+
var version = "0.0.0-experimental-0.9-plus.8";
|
|
36024
36295
|
console.log("Galacean engine version: " + version);
|
|
36025
36296
|
for(var key in CoreObjects__namespace){
|
|
36026
36297
|
CoreObjects.Loader.registerClass(key, CoreObjects__namespace[key]);
|