@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 CHANGED
@@ -61,7 +61,7 @@ export declare class Camera {
61
61
  /**
62
62
  * 编辑器用于缩放画布
63
63
  */
64
- private fovScaleRatio;
64
+ private viewportMatrix;
65
65
  private options;
66
66
  private viewMatrix;
67
67
  private projectionMatrix;
@@ -118,8 +118,8 @@ export declare class Camera {
118
118
  */
119
119
  set rotation(value: Euler);
120
120
  get rotation(): Euler;
121
- setFovScaleRatio(value: number): void;
122
- getFovScaleRatio(): number;
121
+ setViewportMatrix(matrix: Matrix4): void;
122
+ getViewportMatrix(): Matrix4;
123
123
  /**
124
124
  * 获取相机的视图变换矩阵
125
125
  * @return
@@ -13,6 +13,7 @@ import type { Texture } from './texture';
13
13
  import type { Disposable, LostHandler } from './utils';
14
14
  import type { VFXItemProps } from './vfx-item';
15
15
  import { VFXItem } from './vfx-item';
16
+ import { type Matrix4 } from '@galacean/effects-math/es/core';
16
17
  export interface CompositionStatistic {
17
18
  loadTime: number;
18
19
  loadStart: number;
@@ -225,8 +226,8 @@ export declare class Composition implements Disposable, LostHandler {
225
226
  * 获取销毁状态
226
227
  */
227
228
  get isDestroyed(): boolean;
228
- set editorScaleRatio(value: number);
229
- get editorScaleRatio(): number;
229
+ set viewportMatrix(matrix: Matrix4);
230
+ get viewportMatrix(): Matrix4;
230
231
  /**
231
232
  * 获取合成的时长
232
233
  */
@@ -2,4 +2,4 @@ import type { Constructor } from './utils';
2
2
  export declare const effectsClassStore: Record<string, any>;
3
3
  export declare function effectsClass(className: string): (target: Object, context?: unknown) => void;
4
4
  export declare function serialize(type?: Constructor, sourceName?: string): (target: Object, propertyKey: string | symbol) => void;
5
- export declare function getMergedStore(target: Object): Record<string, any>;
5
+ export declare function getMergedStore(target: Object): Record<string, any> | undefined;
package/dist/index.js 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.24
6
+ * Version: v2.0.0-alpha.26
7
7
  */
8
8
 
9
9
  'use strict';
@@ -4493,8 +4493,8 @@ var index$1 = /*#__PURE__*/Object.freeze({
4493
4493
  BuiltinObjectGUID: BuiltinObjectGUID
4494
4494
  });
4495
4495
 
4496
- var decoratorInitialStore = {};
4497
- var mergedStore = {};
4496
+ var decoratorInitialStore = new Map();
4497
+ var mergedStore = new Map();
4498
4498
  var effectsClassStore = {};
4499
4499
  function effectsClass(className) {
4500
4500
  return function(target, context) {
@@ -4509,22 +4509,22 @@ function serialize(type, sourceName) {
4509
4509
  return generateSerializableMember(type, sourceName); // value member
4510
4510
  }
4511
4511
  function getMergedStore(target) {
4512
- var classKey = target.constructor.name;
4513
- if (mergedStore[classKey]) {
4514
- return mergedStore[classKey];
4512
+ var classKey = target.constructor;
4513
+ if (mergedStore.get(classKey)) {
4514
+ return mergedStore.get(classKey);
4515
4515
  }
4516
- mergedStore[classKey] = {};
4517
- var store = mergedStore[classKey];
4516
+ var store = {};
4517
+ mergedStore.set(classKey, store);
4518
4518
  var currentTarget = target;
4519
4519
  var currentKey = classKey;
4520
4520
  while(currentKey){
4521
- var initialStore = decoratorInitialStore[currentKey];
4521
+ var initialStore = decoratorInitialStore.get(currentKey);
4522
4522
  for(var property in initialStore){
4523
4523
  store[property] = initialStore[property];
4524
4524
  }
4525
4525
  var parent = Object.getPrototypeOf(currentTarget);
4526
- currentKey = Object.getPrototypeOf(parent).constructor.name;
4527
- if (currentKey === "Object") {
4526
+ currentKey = Object.getPrototypeOf(parent).constructor;
4527
+ if (currentKey === Object) {
4528
4528
  break;
4529
4529
  }
4530
4530
  currentTarget = parent;
@@ -4534,6 +4534,9 @@ function getMergedStore(target) {
4534
4534
  function generateSerializableMember(type, sourceName) {
4535
4535
  return function(target, propertyKey) {
4536
4536
  var classStore = getDirectStore(target);
4537
+ if (!classStore) {
4538
+ return;
4539
+ }
4537
4540
  if (!classStore[propertyKey]) {
4538
4541
  classStore[propertyKey] = {
4539
4542
  type: type,
@@ -4543,11 +4546,11 @@ function generateSerializableMember(type, sourceName) {
4543
4546
  };
4544
4547
  }
4545
4548
  function getDirectStore(target) {
4546
- var classKey = target.constructor.name;
4547
- if (!decoratorInitialStore[classKey]) {
4548
- decoratorInitialStore[classKey] = {};
4549
+ var classKey = target.constructor;
4550
+ if (!decoratorInitialStore.get(classKey)) {
4551
+ decoratorInitialStore.set(classKey, {});
4549
4552
  }
4550
- return decoratorInitialStore[classKey];
4553
+ return decoratorInitialStore.get(classKey);
4551
4554
  }
4552
4555
 
4553
4556
  /**
@@ -8875,6 +8878,7 @@ exports.MaterialRenderType = void 0;
8875
8878
  var _this;
8876
8879
  _this = EffectsObject.call(this, engine) || this;
8877
8880
  _this.stringTags = {};
8881
+ _this.enabledMacros = {};
8878
8882
  _this.destroyed = false;
8879
8883
  _this.initialized = false;
8880
8884
  if (props) {
@@ -18720,9 +18724,9 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
18720
18724
  var localTime = time - this.start;
18721
18725
  var duration = this.duration;
18722
18726
  if (localTime - duration > 0.001) {
18723
- if (this.endBehaviour === ItemEndBehavior.loop) {
18727
+ if (this.endBehavior === ItemEndBehavior.loop) {
18724
18728
  localTime = localTime % duration;
18725
- } else if (this.endBehaviour === ItemEndBehavior.freeze) {
18729
+ } else if (this.endBehavior === ItemEndBehavior.freeze) {
18726
18730
  localTime = Math.min(duration, localTime);
18727
18731
  }
18728
18732
  }
@@ -18847,9 +18851,9 @@ var RuntimeClip = /*#__PURE__*/ function() {
18847
18851
  var weight = 1.0;
18848
18852
  var ended = false;
18849
18853
  var started = false;
18850
- var boundItem = this.track.binding;
18851
- if (localTime > clip.start + clip.duration + 0.001 && clip.endBehaviour === ItemEndBehavior.destroy) {
18852
- if (exports.VFXItem.isParticle(boundItem) && this.particleSystem && !this.particleSystem.destroyed) {
18854
+ var boundObject = this.track.binding;
18855
+ if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior === ItemEndBehavior.destroy) {
18856
+ if (_instanceof1(boundObject, exports.VFXItem) && exports.VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
18853
18857
  weight = 1.0;
18854
18858
  } else {
18855
18859
  weight = 0.0;
@@ -18866,25 +18870,22 @@ var RuntimeClip = /*#__PURE__*/ function() {
18866
18870
  }
18867
18871
  this.parentMixer.setInputWeight(this.playable, weight);
18868
18872
  // 判断动画是否结束
18869
- if (ended && !boundItem.ended) {
18870
- boundItem.ended = true;
18871
- boundItem.onEnd();
18872
- }
18873
- if (ended && this.playable.getPlayState() === PlayState.Playing) {
18874
- this.playable.pause();
18875
- this.onClipEnd();
18873
+ if (ended) {
18874
+ if (_instanceof1(boundObject, exports.VFXItem) && !boundObject.ended) {
18875
+ boundObject.ended = true;
18876
+ boundObject.onEnd();
18877
+ if (!boundObject.compositionReusable && !boundObject.reusable) {
18878
+ boundObject.dispose();
18879
+ this.playable.dispose();
18880
+ }
18881
+ }
18882
+ if (this.playable.getPlayState() === PlayState.Playing) {
18883
+ this.playable.pause();
18884
+ }
18876
18885
  }
18877
18886
  var clipTime = clip.toLocalTime(localTime);
18878
18887
  this.playable.setTime(clipTime);
18879
18888
  };
18880
- _proto.onClipEnd = function onClipEnd() {
18881
- var boundItem = this.track.binding;
18882
- if (!boundItem.compositionReusable && !boundItem.reusable) {
18883
- boundItem.dispose();
18884
- this.playable.dispose();
18885
- return;
18886
- }
18887
- };
18888
18889
  _create_class(RuntimeClip, [
18889
18890
  {
18890
18891
  key: "enable",
@@ -18916,7 +18917,7 @@ exports.ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
18916
18917
  var particleClip = particleTrack.createClip(ParticleBehaviourPlayableAsset);
18917
18918
  particleClip.start = boundItem.start;
18918
18919
  particleClip.duration = boundItem.duration;
18919
- particleClip.endBehaviour = boundItem.endBehavior;
18920
+ particleClip.endBehavior = boundItem.endBehavior;
18920
18921
  }
18921
18922
  };
18922
18923
  return ObjectBindingTrack;
@@ -19217,7 +19218,7 @@ function compareTracks(a, b) {
19217
19218
  if (!props) {
19218
19219
  throw new Error("Referenced precomposition with Id: " + refId + " does not exist.");
19219
19220
  }
19220
- // endBehaviour 类型需优化
19221
+ // endBehavior 类型需优化
19221
19222
  props.content = itemData.content;
19222
19223
  item = assetLoader.loadGUID(itemData.id);
19223
19224
  item.composition = this.item.composition;
@@ -19671,7 +19672,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
19671
19672
  _proto.updateWithOptions = function updateWithOptions(options) {
19672
19673
  this.textStyle = new TextStyle(options);
19673
19674
  this.textLayout = new TextLayout(options);
19674
- this.text = options.text;
19675
+ this.text = options.text.toString();
19675
19676
  this.lineCount = this.getLineCount(options.text, true);
19676
19677
  };
19677
19678
  _proto.getLineCount = function getLineCount(text, init) {
@@ -19742,7 +19743,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
19742
19743
  if (this.text === value) {
19743
19744
  return;
19744
19745
  }
19745
- this.text = value;
19746
+ this.text = value.toString();
19746
19747
  this.lineCount = this.getLineCount(value, false);
19747
19748
  this.isDirty = true;
19748
19749
  };
@@ -20851,29 +20852,31 @@ var SerializationHelper = /*#__PURE__*/ function() {
20851
20852
  effectsObject.toData();
20852
20853
  res[effectsObject.getInstanceId()] = effectsObject;
20853
20854
  var serializedProperties = getMergedStore(effectsObject);
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];
20860
- }
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
- }
20855
+ if (serializedProperties) {
20856
+ for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
20857
+ var key = _step.value;
20858
+ // TODO 待移除,序列化属性通过 effectsObject 对象直接获取
20859
+ var value = effectsObject.taggedProperties[key];
20860
+ if (value === undefined) {
20861
+ value = effectsObject[key];
20869
20862
  }
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);
20863
+ if (EffectsObject.is(value)) {
20864
+ SerializationHelper.collectSerializableObject(value, res);
20865
+ } else if (isArray(value)) {
20866
+ for(var _iterator1 = _create_for_of_iterator_helper_loose(value), _step1; !(_step1 = _iterator1()).done;){
20867
+ var arrayValue = _step1.value;
20868
+ if (EffectsObject.is(arrayValue)) {
20869
+ SerializationHelper.collectSerializableObject(arrayValue, res);
20870
+ }
20871
+ }
20872
+ } else if (isObject(value)) {
20873
+ // 非 EffectsObject 对象只递归一层
20874
+ for(var _iterator2 = _create_for_of_iterator_helper_loose(Object.keys(value)), _step2; !(_step2 = _iterator2()).done;){
20875
+ var objectKey = _step2.value;
20876
+ var objectValue = value[objectKey];
20877
+ if (EffectsObject.is(objectValue)) {
20878
+ SerializationHelper.collectSerializableObject(objectValue, res);
20879
+ }
20877
20880
  }
20878
20881
  }
20879
20882
  }
@@ -20904,27 +20907,29 @@ var SerializationHelper = /*#__PURE__*/ function() {
20904
20907
  serializedData = {};
20905
20908
  }
20906
20909
  var serializedProperties = getMergedStore(effectsObject);
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] = {};
20910
+ if (serializedProperties) {
20911
+ for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
20912
+ var key = _step.value;
20913
+ var value = effectsObject[key];
20914
+ if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(value)) {
20915
+ // TODO json 数据避免传 typedArray
20916
+ serializedData[key] = value;
20917
+ } else if (isArray(value)) {
20918
+ if (!serializedData[key]) {
20919
+ serializedData[key] = [];
20920
+ }
20921
+ SerializationHelper.serializeArrayProperty(value, serializedData[key], 0);
20922
+ } else if (EffectsObject.is(value)) {
20923
+ // TODO 处理 EffectsObject 递归序列化
20924
+ serializedData[key] = {
20925
+ id: value.getInstanceId()
20926
+ };
20927
+ } else if (isObject(value)) {
20928
+ if (!serializedData[key]) {
20929
+ serializedData[key] = {};
20930
+ }
20931
+ SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
20926
20932
  }
20927
- SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
20928
20933
  }
20929
20934
  }
20930
20935
  // TODO 待移除 tagggedProperties 为没有装饰器的临时方案
@@ -20959,22 +20964,24 @@ var SerializationHelper = /*#__PURE__*/ function() {
20959
20964
  var engine = effectsObject.engine;
20960
20965
  for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedData)), _step; !(_step = _iterator()).done;){
20961
20966
  var key = _step.value;
20962
- if (serializedProperties[key]) {
20967
+ if (serializedProperties && serializedProperties[key]) {
20963
20968
  continue;
20964
20969
  }
20965
20970
  var value = serializedData[key];
20966
20971
  taggedProperties[key] = SerializationHelper.deserializeProperty(value, engine, 0);
20967
20972
  }
20968
- for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step1; !(_step1 = _iterator1()).done;){
20969
- var key1 = _step1.value;
20970
- var value1 = serializedData[key1];
20971
- if (value1 === undefined) {
20972
- continue;
20973
+ if (serializedProperties) {
20974
+ for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step1; !(_step1 = _iterator1()).done;){
20975
+ var key1 = _step1.value;
20976
+ var value1 = serializedData[key1];
20977
+ if (value1 === undefined) {
20978
+ continue;
20979
+ }
20980
+ var propertyType = serializedProperties[key1].type;
20981
+ // FIXME: taggedProperties 为 readonly,这里存在强制赋值
20982
+ // @ts-expect-error
20983
+ effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
20973
20984
  }
20974
- var propertyType = serializedProperties[key1].type;
20975
- // FIXME: taggedProperties 为 readonly,这里存在强制赋值
20976
- // @ts-expect-error
20977
- effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
20978
20985
  }
20979
20986
  effectsObject.fromData(taggedProperties);
20980
20987
  };
@@ -20995,7 +21002,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
20995
21002
  4
20996
21003
  ];
20997
21004
  key = _step.value;
20998
- if (serializedProperties[key]) {
21005
+ if (serializedProperties && serializedProperties[key]) {
20999
21006
  return [
21000
21007
  3,
21001
21008
  3
@@ -21015,6 +21022,10 @@ var SerializationHelper = /*#__PURE__*/ function() {
21015
21022
  1
21016
21023
  ];
21017
21024
  case 4:
21025
+ if (!serializedProperties) return [
21026
+ 3,
21027
+ 8
21028
+ ];
21018
21029
  _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties));
21019
21030
  _state.label = 5;
21020
21031
  case 5:
@@ -22229,7 +22240,7 @@ function getStandardCameraContent(model) {
22229
22240
  */ function version30Migration(json) {
22230
22241
  var _loop = function() {
22231
22242
  var composition = _step1.value;
22232
- // composition 的 endbehaviour 兼容
22243
+ // composition 的 endBehavior 兼容
22233
22244
  if (composition.endBehavior === CompositionEndBehavior.pause_destroy || composition.endBehavior === CompositionEndBehavior.pause) {
22234
22245
  composition.endBehavior = END_BEHAVIOR_FREEZE;
22235
22246
  }
@@ -22615,7 +22626,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
22615
22626
  {
22616
22627
  start: item.delay,
22617
22628
  duration: item.duration,
22618
- endBehaviour: item.endBehavior,
22629
+ endBehavior: item.endBehavior,
22619
22630
  asset: {
22620
22631
  id: newActivationPlayableAsset.id
22621
22632
  }
@@ -22646,7 +22657,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
22646
22657
  {
22647
22658
  start: item.delay,
22648
22659
  duration: item.duration,
22649
- endBehaviour: item.endBehavior,
22660
+ endBehavior: item.endBehavior,
22650
22661
  asset: {
22651
22662
  id: newTransformPlayableAssetData.id
22652
22663
  }
@@ -22674,7 +22685,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
22674
22685
  {
22675
22686
  start: item.delay,
22676
22687
  duration: item.duration,
22677
- endBehaviour: item.endBehavior,
22688
+ endBehavior: item.endBehavior,
22678
22689
  asset: {
22679
22690
  id: newSpriteColorPlayableAssetData.id
22680
22691
  }
@@ -22700,7 +22711,7 @@ function convertTimelineAsset(composition, guidToItemMap, jsonScene) {
22700
22711
  {
22701
22712
  start: item.delay,
22702
22713
  duration: item.duration,
22703
- endBehaviour: item.endBehavior,
22714
+ endBehavior: item.endBehavior,
22704
22715
  asset: {
22705
22716
  id: newSubCompositionPlayableAssetData.id
22706
22717
  }
@@ -24042,7 +24053,7 @@ var tmpScale = new Vector3(1, 1, 1);
24042
24053
  function Camera(name, options) {
24043
24054
  if (options === void 0) options = {};
24044
24055
  this.name = name;
24045
- this.fovScaleRatio = 1.0;
24056
+ this.viewportMatrix = Matrix4.fromIdentity();
24046
24057
  this.viewMatrix = Matrix4.fromIdentity();
24047
24058
  this.projectionMatrix = Matrix4.fromIdentity();
24048
24059
  this.viewProjectionMatrix = Matrix4.fromIdentity();
@@ -24070,12 +24081,12 @@ var tmpScale = new Vector3(1, 1, 1);
24070
24081
  this.updateMatrix();
24071
24082
  }
24072
24083
  var _proto = Camera.prototype;
24073
- _proto.setFovScaleRatio = function setFovScaleRatio(value) {
24074
- this.fovScaleRatio = value;
24084
+ _proto.setViewportMatrix = function setViewportMatrix(matrix) {
24085
+ this.viewportMatrix = matrix.clone();
24075
24086
  this.dirty = true;
24076
24087
  };
24077
- _proto.getFovScaleRatio = function getFovScaleRatio() {
24078
- return this.fovScaleRatio;
24088
+ _proto.getViewportMatrix = function getViewportMatrix() {
24089
+ return this.viewportMatrix;
24079
24090
  };
24080
24091
  /**
24081
24092
  * 获取相机的视图变换矩阵
@@ -24134,11 +24145,13 @@ var tmpScale = new Vector3(1, 1, 1);
24134
24145
  * 获取归一化坐标和 3D 世界坐标的换算比例
24135
24146
  * @param z - 当前的位置 z
24136
24147
  */ _proto.getInverseVPRatio = function getInverseVPRatio(z) {
24137
- var pos = new Vector3(0, 0, z);
24148
+ var pos = new Vector3(this.position.x, this.position.y, z);
24138
24149
  var mat = this.getViewProjectionMatrix();
24139
24150
  var inverseVP = this.getInverseViewProjectionMatrix();
24140
24151
  var _mat_projectPoint = mat.projectPoint(pos), nz = _mat_projectPoint.z;
24141
- return inverseVP.projectPoint(new Vector3(1, 1, nz));
24152
+ var _inverseVP_projectPoint = inverseVP.projectPoint(new Vector3(1, 1, nz)), xMax = _inverseVP_projectPoint.x, yMax = _inverseVP_projectPoint.y;
24153
+ var _inverseVP_projectPoint1 = inverseVP.projectPoint(new Vector3(-1, -1, nz)), xMin = _inverseVP_projectPoint1.x, yMin = _inverseVP_projectPoint1.y;
24154
+ return new Vector3((xMax - xMin) / 2, (yMax - yMin) / 2, 0);
24142
24155
  };
24143
24156
  /**
24144
24157
  * 设置相机的旋转四元数
@@ -24197,7 +24210,8 @@ var tmpScale = new Vector3(1, 1, 1);
24197
24210
  */ _proto.updateMatrix = function updateMatrix() {
24198
24211
  if (this.dirty) {
24199
24212
  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;
24200
- this.projectionMatrix.perspective(fov * DEG2RAD * this.fovScaleRatio, aspect, near, far, clipMode === CameraClipMode.portrait);
24213
+ this.projectionMatrix.perspective(fov * DEG2RAD, aspect, near, far, clipMode === CameraClipMode.portrait);
24214
+ this.projectionMatrix.premultiply(this.viewportMatrix);
24201
24215
  this.inverseViewMatrix.compose(position, this.getQuat(), tmpScale);
24202
24216
  this.viewMatrix.copyFrom(this.inverseViewMatrix).invert();
24203
24217
  this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix, this.viewMatrix);
@@ -24790,6 +24804,7 @@ var listOrder = 0;
24790
24804
  // this.extraCamera?.getComponent(TimelineComponent)?.update(deltaTime);
24791
24805
  this.updateCamera();
24792
24806
  if (this.shouldDispose()) {
24807
+ this.onEnd == null ? void 0 : this.onEnd.call(this, this);
24793
24808
  this.dispose();
24794
24809
  } else {
24795
24810
  if (!skipRender) {
@@ -25312,12 +25327,12 @@ var listOrder = 0;
25312
25327
  }
25313
25328
  },
25314
25329
  {
25315
- key: "editorScaleRatio",
25330
+ key: "viewportMatrix",
25316
25331
  get: function get() {
25317
- return this.camera.getFovScaleRatio();
25332
+ return this.camera.getViewportMatrix();
25318
25333
  },
25319
- set: function set(value) {
25320
- this.camera.setFovScaleRatio(value);
25334
+ set: function set(matrix) {
25335
+ this.camera.setViewportMatrix(matrix);
25321
25336
  }
25322
25337
  }
25323
25338
  ]);
@@ -25716,7 +25731,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
25716
25731
  registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
25717
25732
  registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
25718
25733
  registerPlugin("interact", InteractLoader, exports.VFXItem, true);
25719
- var version = "2.0.0-alpha.24";
25734
+ var version = "2.0.0-alpha.26";
25720
25735
  logger.info("Core version: " + version + ".");
25721
25736
 
25722
25737
  exports.AbstractPlugin = AbstractPlugin;