@galacean/effects-threejs 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/index.js +126 -111
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +126 -111
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin 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
|
import * as THREE from 'three';
|
|
@@ -4491,8 +4491,8 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4491
4491
|
BuiltinObjectGUID: BuiltinObjectGUID
|
|
4492
4492
|
});
|
|
4493
4493
|
|
|
4494
|
-
var decoratorInitialStore =
|
|
4495
|
-
var mergedStore =
|
|
4494
|
+
var decoratorInitialStore = new Map();
|
|
4495
|
+
var mergedStore = new Map();
|
|
4496
4496
|
var effectsClassStore = {};
|
|
4497
4497
|
function effectsClass(className) {
|
|
4498
4498
|
return function(target, context) {
|
|
@@ -4507,22 +4507,22 @@ function serialize(type, sourceName) {
|
|
|
4507
4507
|
return generateSerializableMember(type, sourceName); // value member
|
|
4508
4508
|
}
|
|
4509
4509
|
function getMergedStore(target) {
|
|
4510
|
-
var classKey = target.constructor
|
|
4511
|
-
if (mergedStore
|
|
4512
|
-
return mergedStore
|
|
4510
|
+
var classKey = target.constructor;
|
|
4511
|
+
if (mergedStore.get(classKey)) {
|
|
4512
|
+
return mergedStore.get(classKey);
|
|
4513
4513
|
}
|
|
4514
|
-
|
|
4515
|
-
|
|
4514
|
+
var store = {};
|
|
4515
|
+
mergedStore.set(classKey, store);
|
|
4516
4516
|
var currentTarget = target;
|
|
4517
4517
|
var currentKey = classKey;
|
|
4518
4518
|
while(currentKey){
|
|
4519
|
-
var initialStore = decoratorInitialStore
|
|
4519
|
+
var initialStore = decoratorInitialStore.get(currentKey);
|
|
4520
4520
|
for(var property in initialStore){
|
|
4521
4521
|
store[property] = initialStore[property];
|
|
4522
4522
|
}
|
|
4523
4523
|
var parent = Object.getPrototypeOf(currentTarget);
|
|
4524
|
-
currentKey = Object.getPrototypeOf(parent).constructor
|
|
4525
|
-
if (currentKey ===
|
|
4524
|
+
currentKey = Object.getPrototypeOf(parent).constructor;
|
|
4525
|
+
if (currentKey === Object) {
|
|
4526
4526
|
break;
|
|
4527
4527
|
}
|
|
4528
4528
|
currentTarget = parent;
|
|
@@ -4532,6 +4532,9 @@ function getMergedStore(target) {
|
|
|
4532
4532
|
function generateSerializableMember(type, sourceName) {
|
|
4533
4533
|
return function(target, propertyKey) {
|
|
4534
4534
|
var classStore = getDirectStore(target);
|
|
4535
|
+
if (!classStore) {
|
|
4536
|
+
return;
|
|
4537
|
+
}
|
|
4535
4538
|
if (!classStore[propertyKey]) {
|
|
4536
4539
|
classStore[propertyKey] = {
|
|
4537
4540
|
type: type,
|
|
@@ -4541,11 +4544,11 @@ function generateSerializableMember(type, sourceName) {
|
|
|
4541
4544
|
};
|
|
4542
4545
|
}
|
|
4543
4546
|
function getDirectStore(target) {
|
|
4544
|
-
var classKey = target.constructor
|
|
4545
|
-
if (!decoratorInitialStore
|
|
4546
|
-
decoratorInitialStore
|
|
4547
|
+
var classKey = target.constructor;
|
|
4548
|
+
if (!decoratorInitialStore.get(classKey)) {
|
|
4549
|
+
decoratorInitialStore.set(classKey, {});
|
|
4547
4550
|
}
|
|
4548
|
-
return decoratorInitialStore
|
|
4551
|
+
return decoratorInitialStore.get(classKey);
|
|
4549
4552
|
}
|
|
4550
4553
|
|
|
4551
4554
|
/**
|
|
@@ -8873,6 +8876,7 @@ var MaterialRenderType;
|
|
|
8873
8876
|
var _this;
|
|
8874
8877
|
_this = EffectsObject.call(this, engine) || this;
|
|
8875
8878
|
_this.stringTags = {};
|
|
8879
|
+
_this.enabledMacros = {};
|
|
8876
8880
|
_this.destroyed = false;
|
|
8877
8881
|
_this.initialized = false;
|
|
8878
8882
|
if (props) {
|
|
@@ -18718,9 +18722,9 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
18718
18722
|
var localTime = time - this.start;
|
|
18719
18723
|
var duration = this.duration;
|
|
18720
18724
|
if (localTime - duration > 0.001) {
|
|
18721
|
-
if (this.
|
|
18725
|
+
if (this.endBehavior === ItemEndBehavior.loop) {
|
|
18722
18726
|
localTime = localTime % duration;
|
|
18723
|
-
} else if (this.
|
|
18727
|
+
} else if (this.endBehavior === ItemEndBehavior.freeze) {
|
|
18724
18728
|
localTime = Math.min(duration, localTime);
|
|
18725
18729
|
}
|
|
18726
18730
|
}
|
|
@@ -18845,9 +18849,9 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
18845
18849
|
var weight = 1.0;
|
|
18846
18850
|
var ended = false;
|
|
18847
18851
|
var started = false;
|
|
18848
|
-
var
|
|
18849
|
-
if (localTime > clip.start + clip.duration + 0.001 && clip.
|
|
18850
|
-
if (VFXItem.isParticle(
|
|
18852
|
+
var boundObject = this.track.binding;
|
|
18853
|
+
if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior === ItemEndBehavior.destroy) {
|
|
18854
|
+
if (_instanceof1(boundObject, VFXItem) && VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
|
|
18851
18855
|
weight = 1.0;
|
|
18852
18856
|
} else {
|
|
18853
18857
|
weight = 0.0;
|
|
@@ -18864,25 +18868,22 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
18864
18868
|
}
|
|
18865
18869
|
this.parentMixer.setInputWeight(this.playable, weight);
|
|
18866
18870
|
// 判断动画是否结束
|
|
18867
|
-
if (ended
|
|
18868
|
-
|
|
18869
|
-
|
|
18870
|
-
|
|
18871
|
-
|
|
18872
|
-
|
|
18873
|
-
|
|
18871
|
+
if (ended) {
|
|
18872
|
+
if (_instanceof1(boundObject, VFXItem) && !boundObject.ended) {
|
|
18873
|
+
boundObject.ended = true;
|
|
18874
|
+
boundObject.onEnd();
|
|
18875
|
+
if (!boundObject.compositionReusable && !boundObject.reusable) {
|
|
18876
|
+
boundObject.dispose();
|
|
18877
|
+
this.playable.dispose();
|
|
18878
|
+
}
|
|
18879
|
+
}
|
|
18880
|
+
if (this.playable.getPlayState() === PlayState.Playing) {
|
|
18881
|
+
this.playable.pause();
|
|
18882
|
+
}
|
|
18874
18883
|
}
|
|
18875
18884
|
var clipTime = clip.toLocalTime(localTime);
|
|
18876
18885
|
this.playable.setTime(clipTime);
|
|
18877
18886
|
};
|
|
18878
|
-
_proto.onClipEnd = function onClipEnd() {
|
|
18879
|
-
var boundItem = this.track.binding;
|
|
18880
|
-
if (!boundItem.compositionReusable && !boundItem.reusable) {
|
|
18881
|
-
boundItem.dispose();
|
|
18882
|
-
this.playable.dispose();
|
|
18883
|
-
return;
|
|
18884
|
-
}
|
|
18885
|
-
};
|
|
18886
18887
|
_create_class(RuntimeClip, [
|
|
18887
18888
|
{
|
|
18888
18889
|
key: "enable",
|
|
@@ -18914,7 +18915,7 @@ var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
|
18914
18915
|
var particleClip = particleTrack.createClip(ParticleBehaviourPlayableAsset);
|
|
18915
18916
|
particleClip.start = boundItem.start;
|
|
18916
18917
|
particleClip.duration = boundItem.duration;
|
|
18917
|
-
particleClip.
|
|
18918
|
+
particleClip.endBehavior = boundItem.endBehavior;
|
|
18918
18919
|
}
|
|
18919
18920
|
};
|
|
18920
18921
|
return ObjectBindingTrack;
|
|
@@ -19215,7 +19216,7 @@ function compareTracks(a, b) {
|
|
|
19215
19216
|
if (!props) {
|
|
19216
19217
|
throw new Error("Referenced precomposition with Id: " + refId + " does not exist.");
|
|
19217
19218
|
}
|
|
19218
|
-
//
|
|
19219
|
+
// endBehavior 类型需优化
|
|
19219
19220
|
props.content = itemData.content;
|
|
19220
19221
|
item = assetLoader.loadGUID(itemData.id);
|
|
19221
19222
|
item.composition = this.item.composition;
|
|
@@ -19669,7 +19670,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
19669
19670
|
_proto.updateWithOptions = function updateWithOptions(options) {
|
|
19670
19671
|
this.textStyle = new TextStyle(options);
|
|
19671
19672
|
this.textLayout = new TextLayout(options);
|
|
19672
|
-
this.text = options.text;
|
|
19673
|
+
this.text = options.text.toString();
|
|
19673
19674
|
this.lineCount = this.getLineCount(options.text, true);
|
|
19674
19675
|
};
|
|
19675
19676
|
_proto.getLineCount = function getLineCount(text, init) {
|
|
@@ -19740,7 +19741,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
19740
19741
|
if (this.text === value) {
|
|
19741
19742
|
return;
|
|
19742
19743
|
}
|
|
19743
|
-
this.text = value;
|
|
19744
|
+
this.text = value.toString();
|
|
19744
19745
|
this.lineCount = this.getLineCount(value, false);
|
|
19745
19746
|
this.isDirty = true;
|
|
19746
19747
|
};
|
|
@@ -20849,29 +20850,31 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20849
20850
|
effectsObject.toData();
|
|
20850
20851
|
res[effectsObject.getInstanceId()] = effectsObject;
|
|
20851
20852
|
var serializedProperties = getMergedStore(effectsObject);
|
|
20852
|
-
|
|
20853
|
-
var
|
|
20854
|
-
|
|
20855
|
-
|
|
20856
|
-
|
|
20857
|
-
value
|
|
20858
|
-
|
|
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
|
-
}
|
|
20853
|
+
if (serializedProperties) {
|
|
20854
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
|
|
20855
|
+
var key = _step.value;
|
|
20856
|
+
// TODO 待移除,序列化属性通过 effectsObject 对象直接获取
|
|
20857
|
+
var value = effectsObject.taggedProperties[key];
|
|
20858
|
+
if (value === undefined) {
|
|
20859
|
+
value = effectsObject[key];
|
|
20867
20860
|
}
|
|
20868
|
-
|
|
20869
|
-
|
|
20870
|
-
|
|
20871
|
-
var
|
|
20872
|
-
|
|
20873
|
-
|
|
20874
|
-
|
|
20861
|
+
if (EffectsObject.is(value)) {
|
|
20862
|
+
SerializationHelper.collectSerializableObject(value, res);
|
|
20863
|
+
} else if (isArray(value)) {
|
|
20864
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(value), _step1; !(_step1 = _iterator1()).done;){
|
|
20865
|
+
var arrayValue = _step1.value;
|
|
20866
|
+
if (EffectsObject.is(arrayValue)) {
|
|
20867
|
+
SerializationHelper.collectSerializableObject(arrayValue, res);
|
|
20868
|
+
}
|
|
20869
|
+
}
|
|
20870
|
+
} else if (isObject(value)) {
|
|
20871
|
+
// 非 EffectsObject 对象只递归一层
|
|
20872
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(Object.keys(value)), _step2; !(_step2 = _iterator2()).done;){
|
|
20873
|
+
var objectKey = _step2.value;
|
|
20874
|
+
var objectValue = value[objectKey];
|
|
20875
|
+
if (EffectsObject.is(objectValue)) {
|
|
20876
|
+
SerializationHelper.collectSerializableObject(objectValue, res);
|
|
20877
|
+
}
|
|
20875
20878
|
}
|
|
20876
20879
|
}
|
|
20877
20880
|
}
|
|
@@ -20902,27 +20905,29 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20902
20905
|
serializedData = {};
|
|
20903
20906
|
}
|
|
20904
20907
|
var serializedProperties = getMergedStore(effectsObject);
|
|
20905
|
-
|
|
20906
|
-
var
|
|
20907
|
-
|
|
20908
|
-
|
|
20909
|
-
|
|
20910
|
-
|
|
20911
|
-
|
|
20912
|
-
if (
|
|
20913
|
-
serializedData[key]
|
|
20914
|
-
|
|
20915
|
-
|
|
20916
|
-
|
|
20917
|
-
|
|
20918
|
-
|
|
20919
|
-
|
|
20920
|
-
|
|
20921
|
-
|
|
20922
|
-
if (
|
|
20923
|
-
serializedData[key]
|
|
20908
|
+
if (serializedProperties) {
|
|
20909
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
|
|
20910
|
+
var key = _step.value;
|
|
20911
|
+
var value = effectsObject[key];
|
|
20912
|
+
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(value)) {
|
|
20913
|
+
// TODO json 数据避免传 typedArray
|
|
20914
|
+
serializedData[key] = value;
|
|
20915
|
+
} else if (isArray(value)) {
|
|
20916
|
+
if (!serializedData[key]) {
|
|
20917
|
+
serializedData[key] = [];
|
|
20918
|
+
}
|
|
20919
|
+
SerializationHelper.serializeArrayProperty(value, serializedData[key], 0);
|
|
20920
|
+
} else if (EffectsObject.is(value)) {
|
|
20921
|
+
// TODO 处理 EffectsObject 递归序列化
|
|
20922
|
+
serializedData[key] = {
|
|
20923
|
+
id: value.getInstanceId()
|
|
20924
|
+
};
|
|
20925
|
+
} else if (isObject(value)) {
|
|
20926
|
+
if (!serializedData[key]) {
|
|
20927
|
+
serializedData[key] = {};
|
|
20928
|
+
}
|
|
20929
|
+
SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
|
|
20924
20930
|
}
|
|
20925
|
-
SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
|
|
20926
20931
|
}
|
|
20927
20932
|
}
|
|
20928
20933
|
// TODO 待移除 tagggedProperties 为没有装饰器的临时方案
|
|
@@ -20957,22 +20962,24 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20957
20962
|
var engine = effectsObject.engine;
|
|
20958
20963
|
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedData)), _step; !(_step = _iterator()).done;){
|
|
20959
20964
|
var key = _step.value;
|
|
20960
|
-
if (serializedProperties[key]) {
|
|
20965
|
+
if (serializedProperties && serializedProperties[key]) {
|
|
20961
20966
|
continue;
|
|
20962
20967
|
}
|
|
20963
20968
|
var value = serializedData[key];
|
|
20964
20969
|
taggedProperties[key] = SerializationHelper.deserializeProperty(value, engine, 0);
|
|
20965
20970
|
}
|
|
20966
|
-
|
|
20967
|
-
var
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
+
if (serializedProperties) {
|
|
20972
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step1; !(_step1 = _iterator1()).done;){
|
|
20973
|
+
var key1 = _step1.value;
|
|
20974
|
+
var value1 = serializedData[key1];
|
|
20975
|
+
if (value1 === undefined) {
|
|
20976
|
+
continue;
|
|
20977
|
+
}
|
|
20978
|
+
var propertyType = serializedProperties[key1].type;
|
|
20979
|
+
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
20980
|
+
// @ts-expect-error
|
|
20981
|
+
effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
|
|
20971
20982
|
}
|
|
20972
|
-
var propertyType = serializedProperties[key1].type;
|
|
20973
|
-
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
20974
|
-
// @ts-expect-error
|
|
20975
|
-
effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
|
|
20976
20983
|
}
|
|
20977
20984
|
effectsObject.fromData(taggedProperties);
|
|
20978
20985
|
};
|
|
@@ -20993,7 +21000,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20993
21000
|
4
|
|
20994
21001
|
];
|
|
20995
21002
|
key = _step.value;
|
|
20996
|
-
if (serializedProperties[key]) {
|
|
21003
|
+
if (serializedProperties && serializedProperties[key]) {
|
|
20997
21004
|
return [
|
|
20998
21005
|
3,
|
|
20999
21006
|
3
|
|
@@ -21013,6 +21020,10 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
21013
21020
|
1
|
|
21014
21021
|
];
|
|
21015
21022
|
case 4:
|
|
21023
|
+
if (!serializedProperties) return [
|
|
21024
|
+
3,
|
|
21025
|
+
8
|
|
21026
|
+
];
|
|
21016
21027
|
_iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties));
|
|
21017
21028
|
_state.label = 5;
|
|
21018
21029
|
case 5:
|
|
@@ -22227,7 +22238,7 @@ function getStandardCameraContent(model) {
|
|
|
22227
22238
|
*/ function version30Migration(json) {
|
|
22228
22239
|
var _loop = function() {
|
|
22229
22240
|
var composition = _step1.value;
|
|
22230
|
-
// composition 的
|
|
22241
|
+
// composition 的 endBehavior 兼容
|
|
22231
22242
|
if (composition.endBehavior === CompositionEndBehavior.pause_destroy || composition.endBehavior === CompositionEndBehavior.pause) {
|
|
22232
22243
|
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
22233
22244
|
}
|
|
@@ -22613,7 +22624,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22613
22624
|
{
|
|
22614
22625
|
start: item.delay,
|
|
22615
22626
|
duration: item.duration,
|
|
22616
|
-
|
|
22627
|
+
endBehavior: item.endBehavior,
|
|
22617
22628
|
asset: {
|
|
22618
22629
|
id: newActivationPlayableAsset.id
|
|
22619
22630
|
}
|
|
@@ -22644,7 +22655,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22644
22655
|
{
|
|
22645
22656
|
start: item.delay,
|
|
22646
22657
|
duration: item.duration,
|
|
22647
|
-
|
|
22658
|
+
endBehavior: item.endBehavior,
|
|
22648
22659
|
asset: {
|
|
22649
22660
|
id: newTransformPlayableAssetData.id
|
|
22650
22661
|
}
|
|
@@ -22672,7 +22683,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22672
22683
|
{
|
|
22673
22684
|
start: item.delay,
|
|
22674
22685
|
duration: item.duration,
|
|
22675
|
-
|
|
22686
|
+
endBehavior: item.endBehavior,
|
|
22676
22687
|
asset: {
|
|
22677
22688
|
id: newSpriteColorPlayableAssetData.id
|
|
22678
22689
|
}
|
|
@@ -22698,7 +22709,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22698
22709
|
{
|
|
22699
22710
|
start: item.delay,
|
|
22700
22711
|
duration: item.duration,
|
|
22701
|
-
|
|
22712
|
+
endBehavior: item.endBehavior,
|
|
22702
22713
|
asset: {
|
|
22703
22714
|
id: newSubCompositionPlayableAssetData.id
|
|
22704
22715
|
}
|
|
@@ -24040,7 +24051,7 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24040
24051
|
function Camera(name, options) {
|
|
24041
24052
|
if (options === void 0) options = {};
|
|
24042
24053
|
this.name = name;
|
|
24043
|
-
this.
|
|
24054
|
+
this.viewportMatrix = Matrix4.fromIdentity();
|
|
24044
24055
|
this.viewMatrix = Matrix4.fromIdentity();
|
|
24045
24056
|
this.projectionMatrix = Matrix4.fromIdentity();
|
|
24046
24057
|
this.viewProjectionMatrix = Matrix4.fromIdentity();
|
|
@@ -24068,12 +24079,12 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24068
24079
|
this.updateMatrix();
|
|
24069
24080
|
}
|
|
24070
24081
|
var _proto = Camera.prototype;
|
|
24071
|
-
_proto.
|
|
24072
|
-
this.
|
|
24082
|
+
_proto.setViewportMatrix = function setViewportMatrix(matrix) {
|
|
24083
|
+
this.viewportMatrix = matrix.clone();
|
|
24073
24084
|
this.dirty = true;
|
|
24074
24085
|
};
|
|
24075
|
-
_proto.
|
|
24076
|
-
return this.
|
|
24086
|
+
_proto.getViewportMatrix = function getViewportMatrix() {
|
|
24087
|
+
return this.viewportMatrix;
|
|
24077
24088
|
};
|
|
24078
24089
|
/**
|
|
24079
24090
|
* 获取相机的视图变换矩阵
|
|
@@ -24132,11 +24143,13 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24132
24143
|
* 获取归一化坐标和 3D 世界坐标的换算比例
|
|
24133
24144
|
* @param z - 当前的位置 z
|
|
24134
24145
|
*/ _proto.getInverseVPRatio = function getInverseVPRatio(z) {
|
|
24135
|
-
var pos = new Vector3(
|
|
24146
|
+
var pos = new Vector3(this.position.x, this.position.y, z);
|
|
24136
24147
|
var mat = this.getViewProjectionMatrix();
|
|
24137
24148
|
var inverseVP = this.getInverseViewProjectionMatrix();
|
|
24138
24149
|
var _mat_projectPoint = mat.projectPoint(pos), nz = _mat_projectPoint.z;
|
|
24139
|
-
|
|
24150
|
+
var _inverseVP_projectPoint = inverseVP.projectPoint(new Vector3(1, 1, nz)), xMax = _inverseVP_projectPoint.x, yMax = _inverseVP_projectPoint.y;
|
|
24151
|
+
var _inverseVP_projectPoint1 = inverseVP.projectPoint(new Vector3(-1, -1, nz)), xMin = _inverseVP_projectPoint1.x, yMin = _inverseVP_projectPoint1.y;
|
|
24152
|
+
return new Vector3((xMax - xMin) / 2, (yMax - yMin) / 2, 0);
|
|
24140
24153
|
};
|
|
24141
24154
|
/**
|
|
24142
24155
|
* 设置相机的旋转四元数
|
|
@@ -24195,7 +24208,8 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24195
24208
|
*/ _proto.updateMatrix = function updateMatrix() {
|
|
24196
24209
|
if (this.dirty) {
|
|
24197
24210
|
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;
|
|
24198
|
-
this.projectionMatrix.perspective(fov * DEG2RAD
|
|
24211
|
+
this.projectionMatrix.perspective(fov * DEG2RAD, aspect, near, far, clipMode === CameraClipMode.portrait);
|
|
24212
|
+
this.projectionMatrix.premultiply(this.viewportMatrix);
|
|
24199
24213
|
this.inverseViewMatrix.compose(position, this.getQuat(), tmpScale);
|
|
24200
24214
|
this.viewMatrix.copyFrom(this.inverseViewMatrix).invert();
|
|
24201
24215
|
this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix, this.viewMatrix);
|
|
@@ -24788,6 +24802,7 @@ var listOrder = 0;
|
|
|
24788
24802
|
// this.extraCamera?.getComponent(TimelineComponent)?.update(deltaTime);
|
|
24789
24803
|
this.updateCamera();
|
|
24790
24804
|
if (this.shouldDispose()) {
|
|
24805
|
+
this.onEnd == null ? void 0 : this.onEnd.call(this, this);
|
|
24791
24806
|
this.dispose();
|
|
24792
24807
|
} else {
|
|
24793
24808
|
if (!skipRender) {
|
|
@@ -25310,12 +25325,12 @@ var listOrder = 0;
|
|
|
25310
25325
|
}
|
|
25311
25326
|
},
|
|
25312
25327
|
{
|
|
25313
|
-
key: "
|
|
25328
|
+
key: "viewportMatrix",
|
|
25314
25329
|
get: function get() {
|
|
25315
|
-
return this.camera.
|
|
25330
|
+
return this.camera.getViewportMatrix();
|
|
25316
25331
|
},
|
|
25317
|
-
set: function set(
|
|
25318
|
-
this.camera.
|
|
25332
|
+
set: function set(matrix) {
|
|
25333
|
+
this.camera.setViewportMatrix(matrix);
|
|
25319
25334
|
}
|
|
25320
25335
|
}
|
|
25321
25336
|
]);
|
|
@@ -25714,7 +25729,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
25714
25729
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
25715
25730
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
25716
25731
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
25717
|
-
var version$1 = "2.0.0-alpha.
|
|
25732
|
+
var version$1 = "2.0.0-alpha.26";
|
|
25718
25733
|
logger.info("Core version: " + version$1 + ".");
|
|
25719
25734
|
|
|
25720
25735
|
var _obj;
|
|
@@ -27347,7 +27362,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
27347
27362
|
*/ Mesh.create = function(engine, props) {
|
|
27348
27363
|
return new ThreeMesh(engine, props);
|
|
27349
27364
|
};
|
|
27350
|
-
var version = "2.0.0-alpha.
|
|
27365
|
+
var version = "2.0.0-alpha.26";
|
|
27351
27366
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
27352
27367
|
|
|
27353
27368
|
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, 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, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, 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, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize, version, vertexFormatType2GLType };
|