@galacean/effects-core 2.3.0-beta.1 → 2.3.0-beta.2

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
@@ -73,7 +73,6 @@ export declare class Camera {
73
73
  private inverseViewMatrix;
74
74
  private inverseProjectionMatrix;
75
75
  private inverseViewProjectionMatrix;
76
- private transform;
77
76
  private dirty;
78
77
  /**
79
78
  *
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.3.0-beta.1
6
+ * Version: v2.3.0-beta.2
7
7
  */
8
8
 
9
9
  'use strict';
@@ -16832,7 +16832,10 @@ exports.CameraController = /*#__PURE__*/ function(Behaviour) {
16832
16832
  camera.far = this.options.far;
16833
16833
  camera.fov = this.options.fov;
16834
16834
  camera.clipMode = this.options.clipMode;
16835
- camera.setTransform(this.transform);
16835
+ camera.transform.parentTransform = this.transform.parentTransform;
16836
+ camera.position = this.transform.position;
16837
+ // TODO 修正 GE 四元数旋转共轭问题
16838
+ camera.setQuat(this.transform.getQuaternion().clone().conjugate());
16836
16839
  }
16837
16840
  };
16838
16841
  _proto.fromData = function fromData(data) {
@@ -28795,12 +28798,14 @@ var tmpScale = new Vector3(1, 1, 1);
28795
28798
  function Camera(name, options) {
28796
28799
  if (options === void 0) options = {};
28797
28800
  this.name = name;
28801
+ this./**
28802
+ * @internal
28803
+ */ transform = new Transform();
28798
28804
  this.viewportMatrix = Matrix4.fromIdentity();
28799
28805
  this.viewMatrix = Matrix4.fromIdentity();
28800
28806
  this.projectionMatrix = Matrix4.fromIdentity();
28801
28807
  this.viewProjectionMatrix = Matrix4.fromIdentity();
28802
28808
  this.inverseViewMatrix = Matrix4.fromIdentity();
28803
- this.transform = new Transform();
28804
28809
  this.dirty = true;
28805
28810
  var _options_near = options.near, near = _options_near === void 0 ? 0.1 : _options_near, _options_far = options.far, far = _options_far === void 0 ? 20 : _options_far, _options_fov = options.fov, fov = _options_fov === void 0 ? 60 : _options_fov, _options_aspect = options.aspect, aspect = _options_aspect === void 0 ? 1 : _options_aspect, _options_clipMode = options.clipMode, clipMode = _options_clipMode === void 0 ? CameraClipMode.portrait : _options_clipMode, _options_position = options.position, position = _options_position === void 0 ? [
28806
28811
  0,
@@ -28914,7 +28919,10 @@ var tmpScale = new Vector3(1, 1, 1);
28914
28919
  * 设置相机的旋转四元数
28915
28920
  * @param value - 旋转四元数
28916
28921
  */ _proto.setQuat = function setQuat(value) {
28917
- this.transform.setQuaternion(value.x, value.y, value.z, value.w);
28922
+ if (!this.transform.getQuaternion().equals(value)) {
28923
+ this.transform.setQuaternion(value.x, value.y, value.z, value.w);
28924
+ this.dirty = true;
28925
+ }
28918
28926
  };
28919
28927
  /**
28920
28928
  * 获取相机旋转对应的四元数
@@ -28952,7 +28960,7 @@ var tmpScale = new Vector3(1, 1, 1);
28952
28960
  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;
28953
28961
  this.projectionMatrix.perspective(fov * DEG2RAD, aspect, near, far, clipMode === CameraClipMode.portrait);
28954
28962
  this.projectionMatrix.premultiply(this.viewportMatrix);
28955
- this.inverseViewMatrix.compose(this.position, this.getQuat().conjugate(), tmpScale);
28963
+ this.inverseViewMatrix.compose(this.position, this.getQuat(), tmpScale);
28956
28964
  var _this_transform_getParentMatrix;
28957
28965
  this.inverseViewMatrix.premultiply((_this_transform_getParentMatrix = this.transform.getParentMatrix()) != null ? _this_transform_getParentMatrix : Matrix4.IDENTITY);
28958
28966
  this.viewMatrix.copyFrom(this.inverseViewMatrix).invert();
@@ -32070,7 +32078,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
32070
32078
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
32071
32079
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
32072
32080
  registerPlugin("interact", InteractLoader, exports.VFXItem);
32073
- var version = "2.3.0-beta.1";
32081
+ var version = "2.3.0-beta.2";
32074
32082
  logger.info("Core version: " + version + ".");
32075
32083
 
32076
32084
  exports.AbstractPlugin = AbstractPlugin;