@galacean/effects-core 2.0.0-alpha.24 → 2.0.0-alpha.26
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/camera.d.ts +3 -3
- package/dist/composition.d.ts +3 -2
- package/dist/decorators.d.ts +1 -1
- package/dist/index.js +125 -110
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -110
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +1 -0
- package/dist/plugins/timeline/track.d.ts +1 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.26
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -4489,8 +4489,8 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4489
4489
|
BuiltinObjectGUID: BuiltinObjectGUID
|
|
4490
4490
|
});
|
|
4491
4491
|
|
|
4492
|
-
var decoratorInitialStore =
|
|
4493
|
-
var mergedStore =
|
|
4492
|
+
var decoratorInitialStore = new Map();
|
|
4493
|
+
var mergedStore = new Map();
|
|
4494
4494
|
var effectsClassStore = {};
|
|
4495
4495
|
function effectsClass(className) {
|
|
4496
4496
|
return function(target, context) {
|
|
@@ -4505,22 +4505,22 @@ function serialize(type, sourceName) {
|
|
|
4505
4505
|
return generateSerializableMember(type, sourceName); // value member
|
|
4506
4506
|
}
|
|
4507
4507
|
function getMergedStore(target) {
|
|
4508
|
-
var classKey = target.constructor
|
|
4509
|
-
if (mergedStore
|
|
4510
|
-
return mergedStore
|
|
4508
|
+
var classKey = target.constructor;
|
|
4509
|
+
if (mergedStore.get(classKey)) {
|
|
4510
|
+
return mergedStore.get(classKey);
|
|
4511
4511
|
}
|
|
4512
|
-
|
|
4513
|
-
|
|
4512
|
+
var store = {};
|
|
4513
|
+
mergedStore.set(classKey, store);
|
|
4514
4514
|
var currentTarget = target;
|
|
4515
4515
|
var currentKey = classKey;
|
|
4516
4516
|
while(currentKey){
|
|
4517
|
-
var initialStore = decoratorInitialStore
|
|
4517
|
+
var initialStore = decoratorInitialStore.get(currentKey);
|
|
4518
4518
|
for(var property in initialStore){
|
|
4519
4519
|
store[property] = initialStore[property];
|
|
4520
4520
|
}
|
|
4521
4521
|
var parent = Object.getPrototypeOf(currentTarget);
|
|
4522
|
-
currentKey = Object.getPrototypeOf(parent).constructor
|
|
4523
|
-
if (currentKey ===
|
|
4522
|
+
currentKey = Object.getPrototypeOf(parent).constructor;
|
|
4523
|
+
if (currentKey === Object) {
|
|
4524
4524
|
break;
|
|
4525
4525
|
}
|
|
4526
4526
|
currentTarget = parent;
|
|
@@ -4530,6 +4530,9 @@ function getMergedStore(target) {
|
|
|
4530
4530
|
function generateSerializableMember(type, sourceName) {
|
|
4531
4531
|
return function(target, propertyKey) {
|
|
4532
4532
|
var classStore = getDirectStore(target);
|
|
4533
|
+
if (!classStore) {
|
|
4534
|
+
return;
|
|
4535
|
+
}
|
|
4533
4536
|
if (!classStore[propertyKey]) {
|
|
4534
4537
|
classStore[propertyKey] = {
|
|
4535
4538
|
type: type,
|
|
@@ -4539,11 +4542,11 @@ function generateSerializableMember(type, sourceName) {
|
|
|
4539
4542
|
};
|
|
4540
4543
|
}
|
|
4541
4544
|
function getDirectStore(target) {
|
|
4542
|
-
var classKey = target.constructor
|
|
4543
|
-
if (!decoratorInitialStore
|
|
4544
|
-
decoratorInitialStore
|
|
4545
|
+
var classKey = target.constructor;
|
|
4546
|
+
if (!decoratorInitialStore.get(classKey)) {
|
|
4547
|
+
decoratorInitialStore.set(classKey, {});
|
|
4545
4548
|
}
|
|
4546
|
-
return decoratorInitialStore
|
|
4549
|
+
return decoratorInitialStore.get(classKey);
|
|
4547
4550
|
}
|
|
4548
4551
|
|
|
4549
4552
|
/**
|
|
@@ -8871,6 +8874,7 @@ var MaterialRenderType;
|
|
|
8871
8874
|
var _this;
|
|
8872
8875
|
_this = EffectsObject.call(this, engine) || this;
|
|
8873
8876
|
_this.stringTags = {};
|
|
8877
|
+
_this.enabledMacros = {};
|
|
8874
8878
|
_this.destroyed = false;
|
|
8875
8879
|
_this.initialized = false;
|
|
8876
8880
|
if (props) {
|
|
@@ -18716,9 +18720,9 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
18716
18720
|
var localTime = time - this.start;
|
|
18717
18721
|
var duration = this.duration;
|
|
18718
18722
|
if (localTime - duration > 0.001) {
|
|
18719
|
-
if (this.
|
|
18723
|
+
if (this.endBehavior === ItemEndBehavior.loop) {
|
|
18720
18724
|
localTime = localTime % duration;
|
|
18721
|
-
} else if (this.
|
|
18725
|
+
} else if (this.endBehavior === ItemEndBehavior.freeze) {
|
|
18722
18726
|
localTime = Math.min(duration, localTime);
|
|
18723
18727
|
}
|
|
18724
18728
|
}
|
|
@@ -18843,9 +18847,9 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
18843
18847
|
var weight = 1.0;
|
|
18844
18848
|
var ended = false;
|
|
18845
18849
|
var started = false;
|
|
18846
|
-
var
|
|
18847
|
-
if (localTime > clip.start + clip.duration + 0.001 && clip.
|
|
18848
|
-
if (VFXItem.isParticle(
|
|
18850
|
+
var boundObject = this.track.binding;
|
|
18851
|
+
if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior === ItemEndBehavior.destroy) {
|
|
18852
|
+
if (_instanceof1(boundObject, VFXItem) && VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
|
|
18849
18853
|
weight = 1.0;
|
|
18850
18854
|
} else {
|
|
18851
18855
|
weight = 0.0;
|
|
@@ -18862,25 +18866,22 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
18862
18866
|
}
|
|
18863
18867
|
this.parentMixer.setInputWeight(this.playable, weight);
|
|
18864
18868
|
// 判断动画是否结束
|
|
18865
|
-
if (ended
|
|
18866
|
-
|
|
18867
|
-
|
|
18868
|
-
|
|
18869
|
-
|
|
18870
|
-
|
|
18871
|
-
|
|
18869
|
+
if (ended) {
|
|
18870
|
+
if (_instanceof1(boundObject, VFXItem) && !boundObject.ended) {
|
|
18871
|
+
boundObject.ended = true;
|
|
18872
|
+
boundObject.onEnd();
|
|
18873
|
+
if (!boundObject.compositionReusable && !boundObject.reusable) {
|
|
18874
|
+
boundObject.dispose();
|
|
18875
|
+
this.playable.dispose();
|
|
18876
|
+
}
|
|
18877
|
+
}
|
|
18878
|
+
if (this.playable.getPlayState() === PlayState.Playing) {
|
|
18879
|
+
this.playable.pause();
|
|
18880
|
+
}
|
|
18872
18881
|
}
|
|
18873
18882
|
var clipTime = clip.toLocalTime(localTime);
|
|
18874
18883
|
this.playable.setTime(clipTime);
|
|
18875
18884
|
};
|
|
18876
|
-
_proto.onClipEnd = function onClipEnd() {
|
|
18877
|
-
var boundItem = this.track.binding;
|
|
18878
|
-
if (!boundItem.compositionReusable && !boundItem.reusable) {
|
|
18879
|
-
boundItem.dispose();
|
|
18880
|
-
this.playable.dispose();
|
|
18881
|
-
return;
|
|
18882
|
-
}
|
|
18883
|
-
};
|
|
18884
18885
|
_create_class(RuntimeClip, [
|
|
18885
18886
|
{
|
|
18886
18887
|
key: "enable",
|
|
@@ -18912,7 +18913,7 @@ var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
|
18912
18913
|
var particleClip = particleTrack.createClip(ParticleBehaviourPlayableAsset);
|
|
18913
18914
|
particleClip.start = boundItem.start;
|
|
18914
18915
|
particleClip.duration = boundItem.duration;
|
|
18915
|
-
particleClip.
|
|
18916
|
+
particleClip.endBehavior = boundItem.endBehavior;
|
|
18916
18917
|
}
|
|
18917
18918
|
};
|
|
18918
18919
|
return ObjectBindingTrack;
|
|
@@ -19213,7 +19214,7 @@ function compareTracks(a, b) {
|
|
|
19213
19214
|
if (!props) {
|
|
19214
19215
|
throw new Error("Referenced precomposition with Id: " + refId + " does not exist.");
|
|
19215
19216
|
}
|
|
19216
|
-
//
|
|
19217
|
+
// endBehavior 类型需优化
|
|
19217
19218
|
props.content = itemData.content;
|
|
19218
19219
|
item = assetLoader.loadGUID(itemData.id);
|
|
19219
19220
|
item.composition = this.item.composition;
|
|
@@ -19667,7 +19668,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
19667
19668
|
_proto.updateWithOptions = function updateWithOptions(options) {
|
|
19668
19669
|
this.textStyle = new TextStyle(options);
|
|
19669
19670
|
this.textLayout = new TextLayout(options);
|
|
19670
|
-
this.text = options.text;
|
|
19671
|
+
this.text = options.text.toString();
|
|
19671
19672
|
this.lineCount = this.getLineCount(options.text, true);
|
|
19672
19673
|
};
|
|
19673
19674
|
_proto.getLineCount = function getLineCount(text, init) {
|
|
@@ -19738,7 +19739,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
19738
19739
|
if (this.text === value) {
|
|
19739
19740
|
return;
|
|
19740
19741
|
}
|
|
19741
|
-
this.text = value;
|
|
19742
|
+
this.text = value.toString();
|
|
19742
19743
|
this.lineCount = this.getLineCount(value, false);
|
|
19743
19744
|
this.isDirty = true;
|
|
19744
19745
|
};
|
|
@@ -20847,29 +20848,31 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20847
20848
|
effectsObject.toData();
|
|
20848
20849
|
res[effectsObject.getInstanceId()] = effectsObject;
|
|
20849
20850
|
var serializedProperties = getMergedStore(effectsObject);
|
|
20850
|
-
|
|
20851
|
-
var
|
|
20852
|
-
|
|
20853
|
-
|
|
20854
|
-
|
|
20855
|
-
value
|
|
20856
|
-
|
|
20857
|
-
if (EffectsObject.is(value)) {
|
|
20858
|
-
SerializationHelper.collectSerializableObject(value, res);
|
|
20859
|
-
} else if (isArray(value)) {
|
|
20860
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(value), _step1; !(_step1 = _iterator1()).done;){
|
|
20861
|
-
var arrayValue = _step1.value;
|
|
20862
|
-
if (EffectsObject.is(arrayValue)) {
|
|
20863
|
-
SerializationHelper.collectSerializableObject(arrayValue, res);
|
|
20864
|
-
}
|
|
20851
|
+
if (serializedProperties) {
|
|
20852
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
|
|
20853
|
+
var key = _step.value;
|
|
20854
|
+
// TODO 待移除,序列化属性通过 effectsObject 对象直接获取
|
|
20855
|
+
var value = effectsObject.taggedProperties[key];
|
|
20856
|
+
if (value === undefined) {
|
|
20857
|
+
value = effectsObject[key];
|
|
20865
20858
|
}
|
|
20866
|
-
|
|
20867
|
-
|
|
20868
|
-
|
|
20869
|
-
var
|
|
20870
|
-
|
|
20871
|
-
|
|
20872
|
-
|
|
20859
|
+
if (EffectsObject.is(value)) {
|
|
20860
|
+
SerializationHelper.collectSerializableObject(value, res);
|
|
20861
|
+
} else if (isArray(value)) {
|
|
20862
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(value), _step1; !(_step1 = _iterator1()).done;){
|
|
20863
|
+
var arrayValue = _step1.value;
|
|
20864
|
+
if (EffectsObject.is(arrayValue)) {
|
|
20865
|
+
SerializationHelper.collectSerializableObject(arrayValue, res);
|
|
20866
|
+
}
|
|
20867
|
+
}
|
|
20868
|
+
} else if (isObject(value)) {
|
|
20869
|
+
// 非 EffectsObject 对象只递归一层
|
|
20870
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(Object.keys(value)), _step2; !(_step2 = _iterator2()).done;){
|
|
20871
|
+
var objectKey = _step2.value;
|
|
20872
|
+
var objectValue = value[objectKey];
|
|
20873
|
+
if (EffectsObject.is(objectValue)) {
|
|
20874
|
+
SerializationHelper.collectSerializableObject(objectValue, res);
|
|
20875
|
+
}
|
|
20873
20876
|
}
|
|
20874
20877
|
}
|
|
20875
20878
|
}
|
|
@@ -20900,27 +20903,29 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20900
20903
|
serializedData = {};
|
|
20901
20904
|
}
|
|
20902
20905
|
var serializedProperties = getMergedStore(effectsObject);
|
|
20903
|
-
|
|
20904
|
-
var
|
|
20905
|
-
|
|
20906
|
-
|
|
20907
|
-
|
|
20908
|
-
|
|
20909
|
-
|
|
20910
|
-
if (
|
|
20911
|
-
serializedData[key]
|
|
20912
|
-
|
|
20913
|
-
|
|
20914
|
-
|
|
20915
|
-
|
|
20916
|
-
|
|
20917
|
-
|
|
20918
|
-
|
|
20919
|
-
|
|
20920
|
-
if (
|
|
20921
|
-
serializedData[key]
|
|
20906
|
+
if (serializedProperties) {
|
|
20907
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
|
|
20908
|
+
var key = _step.value;
|
|
20909
|
+
var value = effectsObject[key];
|
|
20910
|
+
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(value)) {
|
|
20911
|
+
// TODO json 数据避免传 typedArray
|
|
20912
|
+
serializedData[key] = value;
|
|
20913
|
+
} else if (isArray(value)) {
|
|
20914
|
+
if (!serializedData[key]) {
|
|
20915
|
+
serializedData[key] = [];
|
|
20916
|
+
}
|
|
20917
|
+
SerializationHelper.serializeArrayProperty(value, serializedData[key], 0);
|
|
20918
|
+
} else if (EffectsObject.is(value)) {
|
|
20919
|
+
// TODO 处理 EffectsObject 递归序列化
|
|
20920
|
+
serializedData[key] = {
|
|
20921
|
+
id: value.getInstanceId()
|
|
20922
|
+
};
|
|
20923
|
+
} else if (isObject(value)) {
|
|
20924
|
+
if (!serializedData[key]) {
|
|
20925
|
+
serializedData[key] = {};
|
|
20926
|
+
}
|
|
20927
|
+
SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
|
|
20922
20928
|
}
|
|
20923
|
-
SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
|
|
20924
20929
|
}
|
|
20925
20930
|
}
|
|
20926
20931
|
// TODO 待移除 tagggedProperties 为没有装饰器的临时方案
|
|
@@ -20955,22 +20960,24 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20955
20960
|
var engine = effectsObject.engine;
|
|
20956
20961
|
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedData)), _step; !(_step = _iterator()).done;){
|
|
20957
20962
|
var key = _step.value;
|
|
20958
|
-
if (serializedProperties[key]) {
|
|
20963
|
+
if (serializedProperties && serializedProperties[key]) {
|
|
20959
20964
|
continue;
|
|
20960
20965
|
}
|
|
20961
20966
|
var value = serializedData[key];
|
|
20962
20967
|
taggedProperties[key] = SerializationHelper.deserializeProperty(value, engine, 0);
|
|
20963
20968
|
}
|
|
20964
|
-
|
|
20965
|
-
var
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
+
if (serializedProperties) {
|
|
20970
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step1; !(_step1 = _iterator1()).done;){
|
|
20971
|
+
var key1 = _step1.value;
|
|
20972
|
+
var value1 = serializedData[key1];
|
|
20973
|
+
if (value1 === undefined) {
|
|
20974
|
+
continue;
|
|
20975
|
+
}
|
|
20976
|
+
var propertyType = serializedProperties[key1].type;
|
|
20977
|
+
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
20978
|
+
// @ts-expect-error
|
|
20979
|
+
effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
|
|
20969
20980
|
}
|
|
20970
|
-
var propertyType = serializedProperties[key1].type;
|
|
20971
|
-
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
20972
|
-
// @ts-expect-error
|
|
20973
|
-
effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
|
|
20974
20981
|
}
|
|
20975
20982
|
effectsObject.fromData(taggedProperties);
|
|
20976
20983
|
};
|
|
@@ -20991,7 +20998,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20991
20998
|
4
|
|
20992
20999
|
];
|
|
20993
21000
|
key = _step.value;
|
|
20994
|
-
if (serializedProperties[key]) {
|
|
21001
|
+
if (serializedProperties && serializedProperties[key]) {
|
|
20995
21002
|
return [
|
|
20996
21003
|
3,
|
|
20997
21004
|
3
|
|
@@ -21011,6 +21018,10 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
21011
21018
|
1
|
|
21012
21019
|
];
|
|
21013
21020
|
case 4:
|
|
21021
|
+
if (!serializedProperties) return [
|
|
21022
|
+
3,
|
|
21023
|
+
8
|
|
21024
|
+
];
|
|
21014
21025
|
_iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties));
|
|
21015
21026
|
_state.label = 5;
|
|
21016
21027
|
case 5:
|
|
@@ -22225,7 +22236,7 @@ function getStandardCameraContent(model) {
|
|
|
22225
22236
|
*/ function version30Migration(json) {
|
|
22226
22237
|
var _loop = function() {
|
|
22227
22238
|
var composition = _step1.value;
|
|
22228
|
-
// composition 的
|
|
22239
|
+
// composition 的 endBehavior 兼容
|
|
22229
22240
|
if (composition.endBehavior === CompositionEndBehavior.pause_destroy || composition.endBehavior === CompositionEndBehavior.pause) {
|
|
22230
22241
|
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
22231
22242
|
}
|
|
@@ -22611,7 +22622,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22611
22622
|
{
|
|
22612
22623
|
start: item.delay,
|
|
22613
22624
|
duration: item.duration,
|
|
22614
|
-
|
|
22625
|
+
endBehavior: item.endBehavior,
|
|
22615
22626
|
asset: {
|
|
22616
22627
|
id: newActivationPlayableAsset.id
|
|
22617
22628
|
}
|
|
@@ -22642,7 +22653,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22642
22653
|
{
|
|
22643
22654
|
start: item.delay,
|
|
22644
22655
|
duration: item.duration,
|
|
22645
|
-
|
|
22656
|
+
endBehavior: item.endBehavior,
|
|
22646
22657
|
asset: {
|
|
22647
22658
|
id: newTransformPlayableAssetData.id
|
|
22648
22659
|
}
|
|
@@ -22670,7 +22681,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22670
22681
|
{
|
|
22671
22682
|
start: item.delay,
|
|
22672
22683
|
duration: item.duration,
|
|
22673
|
-
|
|
22684
|
+
endBehavior: item.endBehavior,
|
|
22674
22685
|
asset: {
|
|
22675
22686
|
id: newSpriteColorPlayableAssetData.id
|
|
22676
22687
|
}
|
|
@@ -22696,7 +22707,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22696
22707
|
{
|
|
22697
22708
|
start: item.delay,
|
|
22698
22709
|
duration: item.duration,
|
|
22699
|
-
|
|
22710
|
+
endBehavior: item.endBehavior,
|
|
22700
22711
|
asset: {
|
|
22701
22712
|
id: newSubCompositionPlayableAssetData.id
|
|
22702
22713
|
}
|
|
@@ -24038,7 +24049,7 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24038
24049
|
function Camera(name, options) {
|
|
24039
24050
|
if (options === void 0) options = {};
|
|
24040
24051
|
this.name = name;
|
|
24041
|
-
this.
|
|
24052
|
+
this.viewportMatrix = Matrix4.fromIdentity();
|
|
24042
24053
|
this.viewMatrix = Matrix4.fromIdentity();
|
|
24043
24054
|
this.projectionMatrix = Matrix4.fromIdentity();
|
|
24044
24055
|
this.viewProjectionMatrix = Matrix4.fromIdentity();
|
|
@@ -24066,12 +24077,12 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24066
24077
|
this.updateMatrix();
|
|
24067
24078
|
}
|
|
24068
24079
|
var _proto = Camera.prototype;
|
|
24069
|
-
_proto.
|
|
24070
|
-
this.
|
|
24080
|
+
_proto.setViewportMatrix = function setViewportMatrix(matrix) {
|
|
24081
|
+
this.viewportMatrix = matrix.clone();
|
|
24071
24082
|
this.dirty = true;
|
|
24072
24083
|
};
|
|
24073
|
-
_proto.
|
|
24074
|
-
return this.
|
|
24084
|
+
_proto.getViewportMatrix = function getViewportMatrix() {
|
|
24085
|
+
return this.viewportMatrix;
|
|
24075
24086
|
};
|
|
24076
24087
|
/**
|
|
24077
24088
|
* 获取相机的视图变换矩阵
|
|
@@ -24130,11 +24141,13 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24130
24141
|
* 获取归一化坐标和 3D 世界坐标的换算比例
|
|
24131
24142
|
* @param z - 当前的位置 z
|
|
24132
24143
|
*/ _proto.getInverseVPRatio = function getInverseVPRatio(z) {
|
|
24133
|
-
var pos = new Vector3(
|
|
24144
|
+
var pos = new Vector3(this.position.x, this.position.y, z);
|
|
24134
24145
|
var mat = this.getViewProjectionMatrix();
|
|
24135
24146
|
var inverseVP = this.getInverseViewProjectionMatrix();
|
|
24136
24147
|
var _mat_projectPoint = mat.projectPoint(pos), nz = _mat_projectPoint.z;
|
|
24137
|
-
|
|
24148
|
+
var _inverseVP_projectPoint = inverseVP.projectPoint(new Vector3(1, 1, nz)), xMax = _inverseVP_projectPoint.x, yMax = _inverseVP_projectPoint.y;
|
|
24149
|
+
var _inverseVP_projectPoint1 = inverseVP.projectPoint(new Vector3(-1, -1, nz)), xMin = _inverseVP_projectPoint1.x, yMin = _inverseVP_projectPoint1.y;
|
|
24150
|
+
return new Vector3((xMax - xMin) / 2, (yMax - yMin) / 2, 0);
|
|
24138
24151
|
};
|
|
24139
24152
|
/**
|
|
24140
24153
|
* 设置相机的旋转四元数
|
|
@@ -24193,7 +24206,8 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24193
24206
|
*/ _proto.updateMatrix = function updateMatrix() {
|
|
24194
24207
|
if (this.dirty) {
|
|
24195
24208
|
var _this_options = this.options, fov = _this_options.fov, aspect = _this_options.aspect, near = _this_options.near, far = _this_options.far, clipMode = _this_options.clipMode, position = _this_options.position;
|
|
24196
|
-
this.projectionMatrix.perspective(fov * DEG2RAD
|
|
24209
|
+
this.projectionMatrix.perspective(fov * DEG2RAD, aspect, near, far, clipMode === CameraClipMode.portrait);
|
|
24210
|
+
this.projectionMatrix.premultiply(this.viewportMatrix);
|
|
24197
24211
|
this.inverseViewMatrix.compose(position, this.getQuat(), tmpScale);
|
|
24198
24212
|
this.viewMatrix.copyFrom(this.inverseViewMatrix).invert();
|
|
24199
24213
|
this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix, this.viewMatrix);
|
|
@@ -24786,6 +24800,7 @@ var listOrder = 0;
|
|
|
24786
24800
|
// this.extraCamera?.getComponent(TimelineComponent)?.update(deltaTime);
|
|
24787
24801
|
this.updateCamera();
|
|
24788
24802
|
if (this.shouldDispose()) {
|
|
24803
|
+
this.onEnd == null ? void 0 : this.onEnd.call(this, this);
|
|
24789
24804
|
this.dispose();
|
|
24790
24805
|
} else {
|
|
24791
24806
|
if (!skipRender) {
|
|
@@ -25308,12 +25323,12 @@ var listOrder = 0;
|
|
|
25308
25323
|
}
|
|
25309
25324
|
},
|
|
25310
25325
|
{
|
|
25311
|
-
key: "
|
|
25326
|
+
key: "viewportMatrix",
|
|
25312
25327
|
get: function get() {
|
|
25313
|
-
return this.camera.
|
|
25328
|
+
return this.camera.getViewportMatrix();
|
|
25314
25329
|
},
|
|
25315
|
-
set: function set(
|
|
25316
|
-
this.camera.
|
|
25330
|
+
set: function set(matrix) {
|
|
25331
|
+
this.camera.setViewportMatrix(matrix);
|
|
25317
25332
|
}
|
|
25318
25333
|
}
|
|
25319
25334
|
]);
|
|
@@ -25712,7 +25727,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
25712
25727
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
25713
25728
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
25714
25729
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
25715
|
-
var version = "2.0.0-alpha.
|
|
25730
|
+
var version = "2.0.0-alpha.26";
|
|
25716
25731
|
logger.info("Core version: " + version + ".");
|
|
25717
25732
|
|
|
25718
25733
|
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, Engine, EventSystem, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMacros, createShape, createVFXItem, createValueGetter, decimalEqual, defaultGlobalVolume, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isObject, isSceneJSON, isSceneURL, isSceneWithOptions, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, itemFrag, itemFrameFrag, itemVert, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, pluginLoaderMap, pointOnLine, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize, version, vertexFormatType2GLType };
|