@galacean/effects-threejs 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/index.js +15 -7
- 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 +15 -7
- 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.3.0-beta.
|
|
6
|
+
* Version: v2.3.0-beta.2
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -16854,7 +16854,10 @@ exports.CameraController = /*#__PURE__*/ function(Behaviour) {
|
|
|
16854
16854
|
camera.far = this.options.far;
|
|
16855
16855
|
camera.fov = this.options.fov;
|
|
16856
16856
|
camera.clipMode = this.options.clipMode;
|
|
16857
|
-
camera.
|
|
16857
|
+
camera.transform.parentTransform = this.transform.parentTransform;
|
|
16858
|
+
camera.position = this.transform.position;
|
|
16859
|
+
// TODO 修正 GE 四元数旋转共轭问题
|
|
16860
|
+
camera.setQuat(this.transform.getQuaternion().clone().conjugate());
|
|
16858
16861
|
}
|
|
16859
16862
|
};
|
|
16860
16863
|
_proto.fromData = function fromData(data) {
|
|
@@ -28817,12 +28820,14 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
28817
28820
|
function Camera(name, options) {
|
|
28818
28821
|
if (options === void 0) options = {};
|
|
28819
28822
|
this.name = name;
|
|
28823
|
+
this./**
|
|
28824
|
+
* @internal
|
|
28825
|
+
*/ transform = new Transform();
|
|
28820
28826
|
this.viewportMatrix = Matrix4.fromIdentity();
|
|
28821
28827
|
this.viewMatrix = Matrix4.fromIdentity();
|
|
28822
28828
|
this.projectionMatrix = Matrix4.fromIdentity();
|
|
28823
28829
|
this.viewProjectionMatrix = Matrix4.fromIdentity();
|
|
28824
28830
|
this.inverseViewMatrix = Matrix4.fromIdentity();
|
|
28825
|
-
this.transform = new Transform();
|
|
28826
28831
|
this.dirty = true;
|
|
28827
28832
|
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 ? [
|
|
28828
28833
|
0,
|
|
@@ -28936,7 +28941,10 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
28936
28941
|
* 设置相机的旋转四元数
|
|
28937
28942
|
* @param value - 旋转四元数
|
|
28938
28943
|
*/ _proto.setQuat = function setQuat(value) {
|
|
28939
|
-
this.transform.
|
|
28944
|
+
if (!this.transform.getQuaternion().equals(value)) {
|
|
28945
|
+
this.transform.setQuaternion(value.x, value.y, value.z, value.w);
|
|
28946
|
+
this.dirty = true;
|
|
28947
|
+
}
|
|
28940
28948
|
};
|
|
28941
28949
|
/**
|
|
28942
28950
|
* 获取相机旋转对应的四元数
|
|
@@ -28974,7 +28982,7 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
28974
28982
|
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;
|
|
28975
28983
|
this.projectionMatrix.perspective(fov * DEG2RAD, aspect, near, far, clipMode === CameraClipMode.portrait);
|
|
28976
28984
|
this.projectionMatrix.premultiply(this.viewportMatrix);
|
|
28977
|
-
this.inverseViewMatrix.compose(this.position, this.getQuat()
|
|
28985
|
+
this.inverseViewMatrix.compose(this.position, this.getQuat(), tmpScale);
|
|
28978
28986
|
var _this_transform_getParentMatrix;
|
|
28979
28987
|
this.inverseViewMatrix.premultiply((_this_transform_getParentMatrix = this.transform.getParentMatrix()) != null ? _this_transform_getParentMatrix : Matrix4.IDENTITY);
|
|
28980
28988
|
this.viewMatrix.copyFrom(this.inverseViewMatrix).invert();
|
|
@@ -32092,7 +32100,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
|
|
|
32092
32100
|
registerPlugin("particle", ParticleLoader, exports.VFXItem);
|
|
32093
32101
|
registerPlugin("cal", CalculateLoader, exports.VFXItem);
|
|
32094
32102
|
registerPlugin("interact", InteractLoader, exports.VFXItem);
|
|
32095
|
-
var version$1 = "2.3.0-beta.
|
|
32103
|
+
var version$1 = "2.3.0-beta.2";
|
|
32096
32104
|
logger.info("Core version: " + version$1 + ".");
|
|
32097
32105
|
|
|
32098
32106
|
var _obj;
|
|
@@ -33738,7 +33746,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
33738
33746
|
*/ Mesh.create = function(engine, props) {
|
|
33739
33747
|
return new ThreeMesh(engine, props);
|
|
33740
33748
|
};
|
|
33741
|
-
var version = "2.3.0-beta.
|
|
33749
|
+
var version = "2.3.0-beta.2";
|
|
33742
33750
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
33743
33751
|
|
|
33744
33752
|
exports.AbstractPlugin = AbstractPlugin;
|