@galacean/engine-core 1.1.0-beta.14 → 1.1.0-beta.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/main.js +32 -17
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +32 -17
- package/dist/module.js +32 -17
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/mesh/SkinnedMeshRenderer.d.ts +1 -1
- package/types/particle/modules/EmissionModule.d.ts +0 -1
- package/types/shader/Shader.d.ts +1 -1
package/dist/main.js
CHANGED
|
@@ -565,6 +565,9 @@ function _instanceof(left, right) {
|
|
|
565
565
|
if (sourceProperty._cloneTo) {
|
|
566
566
|
sourceProperty._cloneTo(targetOProperty);
|
|
567
567
|
}
|
|
568
|
+
if (sourceProperty.copyFrom) {
|
|
569
|
+
targetOProperty.copyFrom(sourceProperty);
|
|
570
|
+
}
|
|
568
571
|
break;
|
|
569
572
|
}
|
|
570
573
|
} else {
|
|
@@ -4207,7 +4210,11 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
4207
4210
|
}
|
|
4208
4211
|
cloneEntity.layer = srcEntity.layer;
|
|
4209
4212
|
cloneEntity._isActive = srcEntity._isActive;
|
|
4210
|
-
|
|
4213
|
+
var cloneTransform = cloneEntity.transform;
|
|
4214
|
+
var srcTransform = srcEntity.transform;
|
|
4215
|
+
cloneTransform.position = srcTransform.position;
|
|
4216
|
+
cloneTransform.rotation = srcTransform.rotation;
|
|
4217
|
+
cloneTransform.scale = srcTransform.scale;
|
|
4211
4218
|
var children = srcEntity._children;
|
|
4212
4219
|
for(var i = 0, n = srcEntity._children.length; i < n; i++){
|
|
4213
4220
|
cloneEntity.addChild(this._createCloneEntity(children[i]));
|
|
@@ -11776,8 +11783,8 @@ var PrimitiveType;
|
|
|
11776
11783
|
function SkinnedMeshRenderer(entity) {
|
|
11777
11784
|
var _this;
|
|
11778
11785
|
_this = MeshRenderer1.call(this, entity) || this;
|
|
11779
|
-
_this._jointDataCreateCache = new engineMath.Vector2(-1, -1);
|
|
11780
11786
|
_this._localBounds = new engineMath.BoundingBox();
|
|
11787
|
+
_this._jointDataCreateCache = new engineMath.Vector2(-1, -1);
|
|
11781
11788
|
_this._skin = null;
|
|
11782
11789
|
var rhi = _this.entity.engine._hardwareRenderer;
|
|
11783
11790
|
var maxVertexUniformVectors = rhi.renderStates.getParameter(rhi.gl.MAX_VERTEX_UNIFORM_VECTORS);
|
|
@@ -12081,6 +12088,9 @@ var PrimitiveType;
|
|
|
12081
12088
|
(function() {
|
|
12082
12089
|
SkinnedMeshRenderer._jointMatrixProperty = ShaderProperty.getByName("renderer_JointMatrix");
|
|
12083
12090
|
})();
|
|
12091
|
+
__decorate([
|
|
12092
|
+
deepClone
|
|
12093
|
+
], SkinnedMeshRenderer.prototype, "_localBounds", void 0);
|
|
12084
12094
|
__decorate([
|
|
12085
12095
|
ignoreClone
|
|
12086
12096
|
], SkinnedMeshRenderer.prototype, "_jointDataCreateCache", void 0);
|
|
@@ -12093,9 +12103,6 @@ __decorate([
|
|
|
12093
12103
|
__decorate([
|
|
12094
12104
|
ignoreClone
|
|
12095
12105
|
], SkinnedMeshRenderer.prototype, "_rootBone", void 0);
|
|
12096
|
-
__decorate([
|
|
12097
|
-
ignoreClone
|
|
12098
|
-
], SkinnedMeshRenderer.prototype, "_localBounds", void 0);
|
|
12099
12106
|
__decorate([
|
|
12100
12107
|
ignoreClone
|
|
12101
12108
|
], SkinnedMeshRenderer.prototype, "_jointMatrices", void 0);
|
|
@@ -13223,12 +13230,12 @@ var /** @internal */ PromiseState;
|
|
|
13223
13230
|
*/ ResourceManager._addLoader = function _addLoader(type, loader, extNames) {
|
|
13224
13231
|
this._loaders[type] = loader;
|
|
13225
13232
|
for(var i = 0, len = extNames.length; i < len; i++){
|
|
13226
|
-
this._extTypeMapping[extNames[i]] = type;
|
|
13233
|
+
this._extTypeMapping[extNames[i].toLowerCase()] = type;
|
|
13227
13234
|
}
|
|
13228
13235
|
};
|
|
13229
13236
|
ResourceManager._getTypeByUrl = function _getTypeByUrl(url) {
|
|
13230
13237
|
var path = url.split("?")[0];
|
|
13231
|
-
return this._extTypeMapping[path.substring(path.lastIndexOf(".") + 1)];
|
|
13238
|
+
return this._extTypeMapping[path.substring(path.lastIndexOf(".") + 1).toLowerCase()];
|
|
13232
13239
|
};
|
|
13233
13240
|
return ResourceManager;
|
|
13234
13241
|
}();
|
|
@@ -24486,7 +24493,7 @@ var DirtyFlag;
|
|
|
24486
24493
|
this.component = target.getComponent(type);
|
|
24487
24494
|
this.cureType = cureType;
|
|
24488
24495
|
var isBlendShape = _instanceof(this.component, SkinnedMeshRenderer);
|
|
24489
|
-
// @todo: Temp solution with blendShape
|
|
24496
|
+
// @todo: Temp solution with blendShape bug when multi SkinnedMeshRenderer in a entity. we need to run setTargetValue to solve it.
|
|
24490
24497
|
this._isCopyMode = cureType._isCopyMode && !isBlendShape;
|
|
24491
24498
|
var assemblerType = AnimationCurveOwner.getAssemblerType(type, property);
|
|
24492
24499
|
this._assembler = new assemblerType();
|
|
@@ -24564,7 +24571,8 @@ var DirtyFlag;
|
|
|
24564
24571
|
cureType._lerpValue(targetValue, value, weight, targetValue);
|
|
24565
24572
|
} else {
|
|
24566
24573
|
var originValue1 = this._assembler.getTargetValue();
|
|
24567
|
-
|
|
24574
|
+
// @todo: Temp solution in PR: https://github.com/galacean/engine/pull/1840
|
|
24575
|
+
var lerpValue = cureType._lerpValue(originValue1, value, weight, originValue1);
|
|
24568
24576
|
this._assembler.setTargetValue(lerpValue);
|
|
24569
24577
|
}
|
|
24570
24578
|
}
|
|
@@ -24574,7 +24582,8 @@ var DirtyFlag;
|
|
|
24574
24582
|
if (this._isCopyMode) {
|
|
24575
24583
|
return this.cureType._lerpValue(srcValue, destValue, crossWeight, this.baseEvaluateData.value);
|
|
24576
24584
|
} else {
|
|
24577
|
-
|
|
24585
|
+
// @todo: Temp solution in PR: https://github.com/galacean/engine/pull/1840
|
|
24586
|
+
this.baseEvaluateData.value = this.cureType._lerpValue(srcValue, destValue, crossWeight, this.baseEvaluateData.value);
|
|
24578
24587
|
return this.baseEvaluateData.value;
|
|
24579
24588
|
}
|
|
24580
24589
|
};
|
|
@@ -27432,6 +27441,7 @@ exports.ParticleStopMode = void 0;
|
|
|
27432
27441
|
context.camera._renderPipeline.pushRenderData(context, renderData);
|
|
27433
27442
|
};
|
|
27434
27443
|
_proto._onDestroy = function _onDestroy() {
|
|
27444
|
+
Renderer1.prototype._onDestroy.call(this);
|
|
27435
27445
|
this.generator._destroy();
|
|
27436
27446
|
};
|
|
27437
27447
|
_create_class(ParticleRenderer, [
|
|
@@ -28031,8 +28041,8 @@ __decorate([
|
|
|
28031
28041
|
/** The rate of particle emission. */ _this.rateOverTime = new ParticleCompositeCurve(10);
|
|
28032
28042
|
/** The rate at which the emitter spawns new particles over distance. */ _this.rateOverDistance = new ParticleCompositeCurve(0);
|
|
28033
28043
|
/** @internal */ _this._shapeRand = new engineMath.Rand(0, ParticleRandomSubSeeds.Shape);
|
|
28044
|
+
/** @internal */ _this._frameRateTime = 0;
|
|
28034
28045
|
_this._bursts = [];
|
|
28035
|
-
_this._frameRateTime = 0;
|
|
28036
28046
|
_this._currentBurstIndex = 0;
|
|
28037
28047
|
_this._burstRand = new engineMath.Rand(0, ParticleRandomSubSeeds.Burst);
|
|
28038
28048
|
return _this;
|
|
@@ -28081,7 +28091,8 @@ __decorate([
|
|
|
28081
28091
|
};
|
|
28082
28092
|
/**
|
|
28083
28093
|
* @internal
|
|
28084
|
-
*/ _proto.
|
|
28094
|
+
*/ _proto._reset = function _reset() {
|
|
28095
|
+
this._frameRateTime = 0;
|
|
28085
28096
|
this._currentBurstIndex = 0;
|
|
28086
28097
|
};
|
|
28087
28098
|
_proto._emitByRateOverTime = function _emitByRateOverTime(playTime) {
|
|
@@ -29039,7 +29050,7 @@ __decorate([
|
|
|
29039
29050
|
this._firstActiveElement = firstFreeElement;
|
|
29040
29051
|
this._firstNewElement = firstFreeElement;
|
|
29041
29052
|
this._playTime = 0;
|
|
29042
|
-
this.emission.
|
|
29053
|
+
this.emission._reset();
|
|
29043
29054
|
}
|
|
29044
29055
|
}
|
|
29045
29056
|
};
|
|
@@ -29074,19 +29085,23 @@ __decorate([
|
|
|
29074
29085
|
/**
|
|
29075
29086
|
* @internal
|
|
29076
29087
|
*/ _proto._update = function _update(elapsedTime) {
|
|
29088
|
+
var _this = this, main = _this.main, emission = _this.emission;
|
|
29089
|
+
var duration = main.duration;
|
|
29077
29090
|
var lastPlayTime = this._playTime;
|
|
29078
29091
|
this._playTime += elapsedTime;
|
|
29079
29092
|
this._retireActiveParticles();
|
|
29080
29093
|
this._freeRetiredParticles();
|
|
29081
|
-
if (
|
|
29082
|
-
|
|
29083
|
-
if (!
|
|
29094
|
+
if (emission.enabled && this._isPlaying) {
|
|
29095
|
+
emission._emit(lastPlayTime, this._playTime);
|
|
29096
|
+
if (!main.isLoop && this._playTime > duration) {
|
|
29084
29097
|
this._isPlaying = false;
|
|
29085
29098
|
}
|
|
29086
29099
|
}
|
|
29087
29100
|
// Reset play time when is not playing and no active particles to avoid potential precision problems in GPU
|
|
29088
29101
|
if (!this.isAlive) {
|
|
29089
|
-
this._playTime
|
|
29102
|
+
var discardTime = Math.min(emission._frameRateTime, Math.floor(this._playTime / duration) * duration);
|
|
29103
|
+
this._playTime -= discardTime;
|
|
29104
|
+
emission._frameRateTime -= discardTime;
|
|
29090
29105
|
}
|
|
29091
29106
|
// Add new particles to vertex buffer when has wait process retired element or new particle
|
|
29092
29107
|
//
|