@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.js
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
|
'use strict';
|
|
@@ -4515,8 +4515,8 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4515
4515
|
BuiltinObjectGUID: BuiltinObjectGUID
|
|
4516
4516
|
});
|
|
4517
4517
|
|
|
4518
|
-
var decoratorInitialStore =
|
|
4519
|
-
var mergedStore =
|
|
4518
|
+
var decoratorInitialStore = new Map();
|
|
4519
|
+
var mergedStore = new Map();
|
|
4520
4520
|
var effectsClassStore = {};
|
|
4521
4521
|
function effectsClass(className) {
|
|
4522
4522
|
return function(target, context) {
|
|
@@ -4531,22 +4531,22 @@ function serialize(type, sourceName) {
|
|
|
4531
4531
|
return generateSerializableMember(type, sourceName); // value member
|
|
4532
4532
|
}
|
|
4533
4533
|
function getMergedStore(target) {
|
|
4534
|
-
var classKey = target.constructor
|
|
4535
|
-
if (mergedStore
|
|
4536
|
-
return mergedStore
|
|
4534
|
+
var classKey = target.constructor;
|
|
4535
|
+
if (mergedStore.get(classKey)) {
|
|
4536
|
+
return mergedStore.get(classKey);
|
|
4537
4537
|
}
|
|
4538
|
-
|
|
4539
|
-
|
|
4538
|
+
var store = {};
|
|
4539
|
+
mergedStore.set(classKey, store);
|
|
4540
4540
|
var currentTarget = target;
|
|
4541
4541
|
var currentKey = classKey;
|
|
4542
4542
|
while(currentKey){
|
|
4543
|
-
var initialStore = decoratorInitialStore
|
|
4543
|
+
var initialStore = decoratorInitialStore.get(currentKey);
|
|
4544
4544
|
for(var property in initialStore){
|
|
4545
4545
|
store[property] = initialStore[property];
|
|
4546
4546
|
}
|
|
4547
4547
|
var parent = Object.getPrototypeOf(currentTarget);
|
|
4548
|
-
currentKey = Object.getPrototypeOf(parent).constructor
|
|
4549
|
-
if (currentKey ===
|
|
4548
|
+
currentKey = Object.getPrototypeOf(parent).constructor;
|
|
4549
|
+
if (currentKey === Object) {
|
|
4550
4550
|
break;
|
|
4551
4551
|
}
|
|
4552
4552
|
currentTarget = parent;
|
|
@@ -4556,6 +4556,9 @@ function getMergedStore(target) {
|
|
|
4556
4556
|
function generateSerializableMember(type, sourceName) {
|
|
4557
4557
|
return function(target, propertyKey) {
|
|
4558
4558
|
var classStore = getDirectStore(target);
|
|
4559
|
+
if (!classStore) {
|
|
4560
|
+
return;
|
|
4561
|
+
}
|
|
4559
4562
|
if (!classStore[propertyKey]) {
|
|
4560
4563
|
classStore[propertyKey] = {
|
|
4561
4564
|
type: type,
|
|
@@ -4565,11 +4568,11 @@ function generateSerializableMember(type, sourceName) {
|
|
|
4565
4568
|
};
|
|
4566
4569
|
}
|
|
4567
4570
|
function getDirectStore(target) {
|
|
4568
|
-
var classKey = target.constructor
|
|
4569
|
-
if (!decoratorInitialStore
|
|
4570
|
-
decoratorInitialStore
|
|
4571
|
+
var classKey = target.constructor;
|
|
4572
|
+
if (!decoratorInitialStore.get(classKey)) {
|
|
4573
|
+
decoratorInitialStore.set(classKey, {});
|
|
4571
4574
|
}
|
|
4572
|
-
return decoratorInitialStore
|
|
4575
|
+
return decoratorInitialStore.get(classKey);
|
|
4573
4576
|
}
|
|
4574
4577
|
|
|
4575
4578
|
/**
|
|
@@ -8897,6 +8900,7 @@ exports.MaterialRenderType = void 0;
|
|
|
8897
8900
|
var _this;
|
|
8898
8901
|
_this = EffectsObject.call(this, engine) || this;
|
|
8899
8902
|
_this.stringTags = {};
|
|
8903
|
+
_this.enabledMacros = {};
|
|
8900
8904
|
_this.destroyed = false;
|
|
8901
8905
|
_this.initialized = false;
|
|
8902
8906
|
if (props) {
|
|
@@ -18742,9 +18746,9 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
18742
18746
|
var localTime = time - this.start;
|
|
18743
18747
|
var duration = this.duration;
|
|
18744
18748
|
if (localTime - duration > 0.001) {
|
|
18745
|
-
if (this.
|
|
18749
|
+
if (this.endBehavior === ItemEndBehavior.loop) {
|
|
18746
18750
|
localTime = localTime % duration;
|
|
18747
|
-
} else if (this.
|
|
18751
|
+
} else if (this.endBehavior === ItemEndBehavior.freeze) {
|
|
18748
18752
|
localTime = Math.min(duration, localTime);
|
|
18749
18753
|
}
|
|
18750
18754
|
}
|
|
@@ -18869,9 +18873,9 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
18869
18873
|
var weight = 1.0;
|
|
18870
18874
|
var ended = false;
|
|
18871
18875
|
var started = false;
|
|
18872
|
-
var
|
|
18873
|
-
if (localTime > clip.start + clip.duration + 0.001 && clip.
|
|
18874
|
-
if (exports.VFXItem.isParticle(
|
|
18876
|
+
var boundObject = this.track.binding;
|
|
18877
|
+
if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior === ItemEndBehavior.destroy) {
|
|
18878
|
+
if (_instanceof1(boundObject, exports.VFXItem) && exports.VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
|
|
18875
18879
|
weight = 1.0;
|
|
18876
18880
|
} else {
|
|
18877
18881
|
weight = 0.0;
|
|
@@ -18888,25 +18892,22 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
18888
18892
|
}
|
|
18889
18893
|
this.parentMixer.setInputWeight(this.playable, weight);
|
|
18890
18894
|
// 判断动画是否结束
|
|
18891
|
-
if (ended
|
|
18892
|
-
|
|
18893
|
-
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
|
|
18895
|
+
if (ended) {
|
|
18896
|
+
if (_instanceof1(boundObject, exports.VFXItem) && !boundObject.ended) {
|
|
18897
|
+
boundObject.ended = true;
|
|
18898
|
+
boundObject.onEnd();
|
|
18899
|
+
if (!boundObject.compositionReusable && !boundObject.reusable) {
|
|
18900
|
+
boundObject.dispose();
|
|
18901
|
+
this.playable.dispose();
|
|
18902
|
+
}
|
|
18903
|
+
}
|
|
18904
|
+
if (this.playable.getPlayState() === PlayState.Playing) {
|
|
18905
|
+
this.playable.pause();
|
|
18906
|
+
}
|
|
18898
18907
|
}
|
|
18899
18908
|
var clipTime = clip.toLocalTime(localTime);
|
|
18900
18909
|
this.playable.setTime(clipTime);
|
|
18901
18910
|
};
|
|
18902
|
-
_proto.onClipEnd = function onClipEnd() {
|
|
18903
|
-
var boundItem = this.track.binding;
|
|
18904
|
-
if (!boundItem.compositionReusable && !boundItem.reusable) {
|
|
18905
|
-
boundItem.dispose();
|
|
18906
|
-
this.playable.dispose();
|
|
18907
|
-
return;
|
|
18908
|
-
}
|
|
18909
|
-
};
|
|
18910
18911
|
_create_class(RuntimeClip, [
|
|
18911
18912
|
{
|
|
18912
18913
|
key: "enable",
|
|
@@ -18938,7 +18939,7 @@ exports.ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
|
18938
18939
|
var particleClip = particleTrack.createClip(ParticleBehaviourPlayableAsset);
|
|
18939
18940
|
particleClip.start = boundItem.start;
|
|
18940
18941
|
particleClip.duration = boundItem.duration;
|
|
18941
|
-
particleClip.
|
|
18942
|
+
particleClip.endBehavior = boundItem.endBehavior;
|
|
18942
18943
|
}
|
|
18943
18944
|
};
|
|
18944
18945
|
return ObjectBindingTrack;
|
|
@@ -19239,7 +19240,7 @@ function compareTracks(a, b) {
|
|
|
19239
19240
|
if (!props) {
|
|
19240
19241
|
throw new Error("Referenced precomposition with Id: " + refId + " does not exist.");
|
|
19241
19242
|
}
|
|
19242
|
-
//
|
|
19243
|
+
// endBehavior 类型需优化
|
|
19243
19244
|
props.content = itemData.content;
|
|
19244
19245
|
item = assetLoader.loadGUID(itemData.id);
|
|
19245
19246
|
item.composition = this.item.composition;
|
|
@@ -19693,7 +19694,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
19693
19694
|
_proto.updateWithOptions = function updateWithOptions(options) {
|
|
19694
19695
|
this.textStyle = new TextStyle(options);
|
|
19695
19696
|
this.textLayout = new TextLayout(options);
|
|
19696
|
-
this.text = options.text;
|
|
19697
|
+
this.text = options.text.toString();
|
|
19697
19698
|
this.lineCount = this.getLineCount(options.text, true);
|
|
19698
19699
|
};
|
|
19699
19700
|
_proto.getLineCount = function getLineCount(text, init) {
|
|
@@ -19764,7 +19765,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
19764
19765
|
if (this.text === value) {
|
|
19765
19766
|
return;
|
|
19766
19767
|
}
|
|
19767
|
-
this.text = value;
|
|
19768
|
+
this.text = value.toString();
|
|
19768
19769
|
this.lineCount = this.getLineCount(value, false);
|
|
19769
19770
|
this.isDirty = true;
|
|
19770
19771
|
};
|
|
@@ -20873,29 +20874,31 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20873
20874
|
effectsObject.toData();
|
|
20874
20875
|
res[effectsObject.getInstanceId()] = effectsObject;
|
|
20875
20876
|
var serializedProperties = getMergedStore(effectsObject);
|
|
20876
|
-
|
|
20877
|
-
var
|
|
20878
|
-
|
|
20879
|
-
|
|
20880
|
-
|
|
20881
|
-
value
|
|
20882
|
-
|
|
20883
|
-
if (EffectsObject.is(value)) {
|
|
20884
|
-
SerializationHelper.collectSerializableObject(value, res);
|
|
20885
|
-
} else if (isArray(value)) {
|
|
20886
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(value), _step1; !(_step1 = _iterator1()).done;){
|
|
20887
|
-
var arrayValue = _step1.value;
|
|
20888
|
-
if (EffectsObject.is(arrayValue)) {
|
|
20889
|
-
SerializationHelper.collectSerializableObject(arrayValue, res);
|
|
20890
|
-
}
|
|
20877
|
+
if (serializedProperties) {
|
|
20878
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
|
|
20879
|
+
var key = _step.value;
|
|
20880
|
+
// TODO 待移除,序列化属性通过 effectsObject 对象直接获取
|
|
20881
|
+
var value = effectsObject.taggedProperties[key];
|
|
20882
|
+
if (value === undefined) {
|
|
20883
|
+
value = effectsObject[key];
|
|
20891
20884
|
}
|
|
20892
|
-
|
|
20893
|
-
|
|
20894
|
-
|
|
20895
|
-
var
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20885
|
+
if (EffectsObject.is(value)) {
|
|
20886
|
+
SerializationHelper.collectSerializableObject(value, res);
|
|
20887
|
+
} else if (isArray(value)) {
|
|
20888
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(value), _step1; !(_step1 = _iterator1()).done;){
|
|
20889
|
+
var arrayValue = _step1.value;
|
|
20890
|
+
if (EffectsObject.is(arrayValue)) {
|
|
20891
|
+
SerializationHelper.collectSerializableObject(arrayValue, res);
|
|
20892
|
+
}
|
|
20893
|
+
}
|
|
20894
|
+
} else if (isObject(value)) {
|
|
20895
|
+
// 非 EffectsObject 对象只递归一层
|
|
20896
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(Object.keys(value)), _step2; !(_step2 = _iterator2()).done;){
|
|
20897
|
+
var objectKey = _step2.value;
|
|
20898
|
+
var objectValue = value[objectKey];
|
|
20899
|
+
if (EffectsObject.is(objectValue)) {
|
|
20900
|
+
SerializationHelper.collectSerializableObject(objectValue, res);
|
|
20901
|
+
}
|
|
20899
20902
|
}
|
|
20900
20903
|
}
|
|
20901
20904
|
}
|
|
@@ -20926,27 +20929,29 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20926
20929
|
serializedData = {};
|
|
20927
20930
|
}
|
|
20928
20931
|
var serializedProperties = getMergedStore(effectsObject);
|
|
20929
|
-
|
|
20930
|
-
var
|
|
20931
|
-
|
|
20932
|
-
|
|
20933
|
-
|
|
20934
|
-
|
|
20935
|
-
|
|
20936
|
-
if (
|
|
20937
|
-
serializedData[key]
|
|
20938
|
-
|
|
20939
|
-
|
|
20940
|
-
|
|
20941
|
-
|
|
20942
|
-
|
|
20943
|
-
|
|
20944
|
-
|
|
20945
|
-
|
|
20946
|
-
if (
|
|
20947
|
-
serializedData[key]
|
|
20932
|
+
if (serializedProperties) {
|
|
20933
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
|
|
20934
|
+
var key = _step.value;
|
|
20935
|
+
var value = effectsObject[key];
|
|
20936
|
+
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(value)) {
|
|
20937
|
+
// TODO json 数据避免传 typedArray
|
|
20938
|
+
serializedData[key] = value;
|
|
20939
|
+
} else if (isArray(value)) {
|
|
20940
|
+
if (!serializedData[key]) {
|
|
20941
|
+
serializedData[key] = [];
|
|
20942
|
+
}
|
|
20943
|
+
SerializationHelper.serializeArrayProperty(value, serializedData[key], 0);
|
|
20944
|
+
} else if (EffectsObject.is(value)) {
|
|
20945
|
+
// TODO 处理 EffectsObject 递归序列化
|
|
20946
|
+
serializedData[key] = {
|
|
20947
|
+
id: value.getInstanceId()
|
|
20948
|
+
};
|
|
20949
|
+
} else if (isObject(value)) {
|
|
20950
|
+
if (!serializedData[key]) {
|
|
20951
|
+
serializedData[key] = {};
|
|
20952
|
+
}
|
|
20953
|
+
SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
|
|
20948
20954
|
}
|
|
20949
|
-
SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
|
|
20950
20955
|
}
|
|
20951
20956
|
}
|
|
20952
20957
|
// TODO 待移除 tagggedProperties 为没有装饰器的临时方案
|
|
@@ -20981,22 +20986,24 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
20981
20986
|
var engine = effectsObject.engine;
|
|
20982
20987
|
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedData)), _step; !(_step = _iterator()).done;){
|
|
20983
20988
|
var key = _step.value;
|
|
20984
|
-
if (serializedProperties[key]) {
|
|
20989
|
+
if (serializedProperties && serializedProperties[key]) {
|
|
20985
20990
|
continue;
|
|
20986
20991
|
}
|
|
20987
20992
|
var value = serializedData[key];
|
|
20988
20993
|
taggedProperties[key] = SerializationHelper.deserializeProperty(value, engine, 0);
|
|
20989
20994
|
}
|
|
20990
|
-
|
|
20991
|
-
var
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
20995
|
+
if (serializedProperties) {
|
|
20996
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step1; !(_step1 = _iterator1()).done;){
|
|
20997
|
+
var key1 = _step1.value;
|
|
20998
|
+
var value1 = serializedData[key1];
|
|
20999
|
+
if (value1 === undefined) {
|
|
21000
|
+
continue;
|
|
21001
|
+
}
|
|
21002
|
+
var propertyType = serializedProperties[key1].type;
|
|
21003
|
+
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
21004
|
+
// @ts-expect-error
|
|
21005
|
+
effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
|
|
20995
21006
|
}
|
|
20996
|
-
var propertyType = serializedProperties[key1].type;
|
|
20997
|
-
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
20998
|
-
// @ts-expect-error
|
|
20999
|
-
effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
|
|
21000
21007
|
}
|
|
21001
21008
|
effectsObject.fromData(taggedProperties);
|
|
21002
21009
|
};
|
|
@@ -21017,7 +21024,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
21017
21024
|
4
|
|
21018
21025
|
];
|
|
21019
21026
|
key = _step.value;
|
|
21020
|
-
if (serializedProperties[key]) {
|
|
21027
|
+
if (serializedProperties && serializedProperties[key]) {
|
|
21021
21028
|
return [
|
|
21022
21029
|
3,
|
|
21023
21030
|
3
|
|
@@ -21037,6 +21044,10 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
21037
21044
|
1
|
|
21038
21045
|
];
|
|
21039
21046
|
case 4:
|
|
21047
|
+
if (!serializedProperties) return [
|
|
21048
|
+
3,
|
|
21049
|
+
8
|
|
21050
|
+
];
|
|
21040
21051
|
_iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties));
|
|
21041
21052
|
_state.label = 5;
|
|
21042
21053
|
case 5:
|
|
@@ -22251,7 +22262,7 @@ function getStandardCameraContent(model) {
|
|
|
22251
22262
|
*/ function version30Migration(json) {
|
|
22252
22263
|
var _loop = function() {
|
|
22253
22264
|
var composition = _step1.value;
|
|
22254
|
-
// composition 的
|
|
22265
|
+
// composition 的 endBehavior 兼容
|
|
22255
22266
|
if (composition.endBehavior === CompositionEndBehavior.pause_destroy || composition.endBehavior === CompositionEndBehavior.pause) {
|
|
22256
22267
|
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
22257
22268
|
}
|
|
@@ -22637,7 +22648,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22637
22648
|
{
|
|
22638
22649
|
start: item.delay,
|
|
22639
22650
|
duration: item.duration,
|
|
22640
|
-
|
|
22651
|
+
endBehavior: item.endBehavior,
|
|
22641
22652
|
asset: {
|
|
22642
22653
|
id: newActivationPlayableAsset.id
|
|
22643
22654
|
}
|
|
@@ -22668,7 +22679,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22668
22679
|
{
|
|
22669
22680
|
start: item.delay,
|
|
22670
22681
|
duration: item.duration,
|
|
22671
|
-
|
|
22682
|
+
endBehavior: item.endBehavior,
|
|
22672
22683
|
asset: {
|
|
22673
22684
|
id: newTransformPlayableAssetData.id
|
|
22674
22685
|
}
|
|
@@ -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: newSpriteColorPlayableAssetData.id
|
|
22702
22713
|
}
|
|
@@ -22722,7 +22733,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
|
|
|
22722
22733
|
{
|
|
22723
22734
|
start: item.delay,
|
|
22724
22735
|
duration: item.duration,
|
|
22725
|
-
|
|
22736
|
+
endBehavior: item.endBehavior,
|
|
22726
22737
|
asset: {
|
|
22727
22738
|
id: newSubCompositionPlayableAssetData.id
|
|
22728
22739
|
}
|
|
@@ -24064,7 +24075,7 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24064
24075
|
function Camera(name, options) {
|
|
24065
24076
|
if (options === void 0) options = {};
|
|
24066
24077
|
this.name = name;
|
|
24067
|
-
this.
|
|
24078
|
+
this.viewportMatrix = Matrix4.fromIdentity();
|
|
24068
24079
|
this.viewMatrix = Matrix4.fromIdentity();
|
|
24069
24080
|
this.projectionMatrix = Matrix4.fromIdentity();
|
|
24070
24081
|
this.viewProjectionMatrix = Matrix4.fromIdentity();
|
|
@@ -24092,12 +24103,12 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24092
24103
|
this.updateMatrix();
|
|
24093
24104
|
}
|
|
24094
24105
|
var _proto = Camera.prototype;
|
|
24095
|
-
_proto.
|
|
24096
|
-
this.
|
|
24106
|
+
_proto.setViewportMatrix = function setViewportMatrix(matrix) {
|
|
24107
|
+
this.viewportMatrix = matrix.clone();
|
|
24097
24108
|
this.dirty = true;
|
|
24098
24109
|
};
|
|
24099
|
-
_proto.
|
|
24100
|
-
return this.
|
|
24110
|
+
_proto.getViewportMatrix = function getViewportMatrix() {
|
|
24111
|
+
return this.viewportMatrix;
|
|
24101
24112
|
};
|
|
24102
24113
|
/**
|
|
24103
24114
|
* 获取相机的视图变换矩阵
|
|
@@ -24156,11 +24167,13 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24156
24167
|
* 获取归一化坐标和 3D 世界坐标的换算比例
|
|
24157
24168
|
* @param z - 当前的位置 z
|
|
24158
24169
|
*/ _proto.getInverseVPRatio = function getInverseVPRatio(z) {
|
|
24159
|
-
var pos = new Vector3(
|
|
24170
|
+
var pos = new Vector3(this.position.x, this.position.y, z);
|
|
24160
24171
|
var mat = this.getViewProjectionMatrix();
|
|
24161
24172
|
var inverseVP = this.getInverseViewProjectionMatrix();
|
|
24162
24173
|
var _mat_projectPoint = mat.projectPoint(pos), nz = _mat_projectPoint.z;
|
|
24163
|
-
|
|
24174
|
+
var _inverseVP_projectPoint = inverseVP.projectPoint(new Vector3(1, 1, nz)), xMax = _inverseVP_projectPoint.x, yMax = _inverseVP_projectPoint.y;
|
|
24175
|
+
var _inverseVP_projectPoint1 = inverseVP.projectPoint(new Vector3(-1, -1, nz)), xMin = _inverseVP_projectPoint1.x, yMin = _inverseVP_projectPoint1.y;
|
|
24176
|
+
return new Vector3((xMax - xMin) / 2, (yMax - yMin) / 2, 0);
|
|
24164
24177
|
};
|
|
24165
24178
|
/**
|
|
24166
24179
|
* 设置相机的旋转四元数
|
|
@@ -24219,7 +24232,8 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24219
24232
|
*/ _proto.updateMatrix = function updateMatrix() {
|
|
24220
24233
|
if (this.dirty) {
|
|
24221
24234
|
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;
|
|
24222
|
-
this.projectionMatrix.perspective(fov * DEG2RAD
|
|
24235
|
+
this.projectionMatrix.perspective(fov * DEG2RAD, aspect, near, far, clipMode === CameraClipMode.portrait);
|
|
24236
|
+
this.projectionMatrix.premultiply(this.viewportMatrix);
|
|
24223
24237
|
this.inverseViewMatrix.compose(position, this.getQuat(), tmpScale);
|
|
24224
24238
|
this.viewMatrix.copyFrom(this.inverseViewMatrix).invert();
|
|
24225
24239
|
this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix, this.viewMatrix);
|
|
@@ -24812,6 +24826,7 @@ var listOrder = 0;
|
|
|
24812
24826
|
// this.extraCamera?.getComponent(TimelineComponent)?.update(deltaTime);
|
|
24813
24827
|
this.updateCamera();
|
|
24814
24828
|
if (this.shouldDispose()) {
|
|
24829
|
+
this.onEnd == null ? void 0 : this.onEnd.call(this, this);
|
|
24815
24830
|
this.dispose();
|
|
24816
24831
|
} else {
|
|
24817
24832
|
if (!skipRender) {
|
|
@@ -25334,12 +25349,12 @@ var listOrder = 0;
|
|
|
25334
25349
|
}
|
|
25335
25350
|
},
|
|
25336
25351
|
{
|
|
25337
|
-
key: "
|
|
25352
|
+
key: "viewportMatrix",
|
|
25338
25353
|
get: function get() {
|
|
25339
|
-
return this.camera.
|
|
25354
|
+
return this.camera.getViewportMatrix();
|
|
25340
25355
|
},
|
|
25341
|
-
set: function set(
|
|
25342
|
-
this.camera.
|
|
25356
|
+
set: function set(matrix) {
|
|
25357
|
+
this.camera.setViewportMatrix(matrix);
|
|
25343
25358
|
}
|
|
25344
25359
|
}
|
|
25345
25360
|
]);
|
|
@@ -25738,7 +25753,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
|
|
|
25738
25753
|
registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
|
|
25739
25754
|
registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
|
|
25740
25755
|
registerPlugin("interact", InteractLoader, exports.VFXItem, true);
|
|
25741
|
-
var version$1 = "2.0.0-alpha.
|
|
25756
|
+
var version$1 = "2.0.0-alpha.26";
|
|
25742
25757
|
logger.info("Core version: " + version$1 + ".");
|
|
25743
25758
|
|
|
25744
25759
|
var _obj;
|
|
@@ -27371,7 +27386,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
27371
27386
|
*/ Mesh.create = function(engine, props) {
|
|
27372
27387
|
return new ThreeMesh(engine, props);
|
|
27373
27388
|
};
|
|
27374
|
-
var version = "2.0.0-alpha.
|
|
27389
|
+
var version = "2.0.0-alpha.26";
|
|
27375
27390
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
27376
27391
|
|
|
27377
27392
|
exports.AbstractPlugin = AbstractPlugin;
|