@galacean/effects-plugin-editor-gizmo 2.0.0-alpha.26 → 2.0.0-alpha.28
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.d.ts +2 -2
- package/dist/index.js +12 -13
- 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 +11 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GizmoSubType } from './define';
|
|
2
2
|
import { GeometryType, createGeometry } from './geometry';
|
|
3
|
-
import { GizmoComponent } from './gizmo-component';
|
|
4
3
|
export { DirectionLightData } from './geometry/direction-light';
|
|
5
|
-
export { GizmoSubType, GeometryType,
|
|
4
|
+
export { GizmoSubType, GeometryType, createGeometry, };
|
|
5
|
+
export * from './gizmo-component';
|
|
6
6
|
export declare const version: string;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects player editor gizmo plugin
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 茂安,旻诺
|
|
6
|
-
* Version: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.28
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -2849,19 +2849,23 @@ exports.GizmoComponent = /*#__PURE__*/ function(ItemBehaviour) {
|
|
|
2849
2849
|
worldMat4 = _this.transform.getWorldMatrix();
|
|
2850
2850
|
var targetItem = _this.targetItem;
|
|
2851
2851
|
if (targetItem) {
|
|
2852
|
-
var _item_getComponent;
|
|
2853
2852
|
//const targetTransform = this.targetItem.transform.clone();
|
|
2854
2853
|
var worldPos = new Vector3();
|
|
2855
2854
|
var worldQuat = new Quaternion();
|
|
2856
2855
|
var worldSca = new Vector3(1, 1, 1);
|
|
2857
|
-
|
|
2856
|
+
var gizmoSubType = _this.subType;
|
|
2857
|
+
// Scale Gizmo 没有世界空间
|
|
2858
|
+
if (_this.coordinateSpace == 0 || gizmoSubType === exports.GizmoSubType.scale) {
|
|
2859
|
+
_this.targetItem.transform.assignWorldTRS(worldPos, worldQuat);
|
|
2860
|
+
} else {
|
|
2861
|
+
_this.targetItem.transform.assignWorldTRS(worldPos);
|
|
2862
|
+
}
|
|
2858
2863
|
var targetTransform = new EFFECTS.Transform({
|
|
2859
2864
|
position: worldPos,
|
|
2860
2865
|
quat: worldQuat,
|
|
2861
2866
|
scale: worldSca,
|
|
2862
2867
|
valid: true
|
|
2863
2868
|
});
|
|
2864
|
-
var gizmoSubType = (_item_getComponent = item.getComponent(GizmoComponent)) == null ? void 0 : _item_getComponent.subType;
|
|
2865
2869
|
// 移动\旋转\缩放gizmo去除近大远小
|
|
2866
2870
|
if (gizmoSubType === exports.GizmoSubType.rotation || gizmoSubType === exports.GizmoSubType.scale || gizmoSubType === exports.GizmoSubType.translation || gizmoSubType === exports.GizmoSubType.camera || gizmoSubType === exports.GizmoSubType.light) {
|
|
2867
2871
|
var camera = item.composition.camera;
|
|
@@ -3103,12 +3107,7 @@ exports.GizmoComponent = /*#__PURE__*/ function(ItemBehaviour) {
|
|
|
3103
3107
|
_proto.update = function update(dt) {
|
|
3104
3108
|
this.updateRenderData();
|
|
3105
3109
|
};
|
|
3106
|
-
_proto.lateUpdate = function lateUpdate(dt) {
|
|
3107
|
-
if (this.needCreateModelContent) {
|
|
3108
|
-
this.createModelContent(this.targetItem, this.gizmoPlugin.meshToAdd);
|
|
3109
|
-
this.needCreateModelContent = false;
|
|
3110
|
-
}
|
|
3111
|
-
};
|
|
3110
|
+
_proto.lateUpdate = function lateUpdate(dt) {};
|
|
3112
3111
|
_proto.updateRenderData = function updateRenderData() {
|
|
3113
3112
|
var item = this.item;
|
|
3114
3113
|
var gizmoSubType = this.subType;
|
|
@@ -3441,11 +3440,11 @@ __decorate([
|
|
|
3441
3440
|
exports.GizmoComponent = __decorate([
|
|
3442
3441
|
EFFECTS.effectsClass("GizmoComponent")
|
|
3443
3442
|
], exports.GizmoComponent);
|
|
3444
|
-
|
|
3443
|
+
exports.CoordinateSpace = void 0;
|
|
3445
3444
|
(function(CoordinateSpace) {
|
|
3446
3445
|
CoordinateSpace[CoordinateSpace["Local"] = 0] = "Local";
|
|
3447
3446
|
CoordinateSpace[CoordinateSpace["World"] = 1] = "World";
|
|
3448
|
-
})(CoordinateSpace || (CoordinateSpace = {}));
|
|
3447
|
+
})(exports.CoordinateSpace || (exports.CoordinateSpace = {}));
|
|
3449
3448
|
|
|
3450
3449
|
var editorRenderPassName = "editor-gizmo";
|
|
3451
3450
|
var frontRenderPassName = "front-gizmo";
|
|
@@ -3714,7 +3713,7 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
3714
3713
|
}(EFFECTS.AbstractPlugin);
|
|
3715
3714
|
|
|
3716
3715
|
EFFECTS.registerPlugin("editor-gizmo", EditorGizmoPlugin, EFFECTS.VFXItem);
|
|
3717
|
-
var version = "2.0.0-alpha.
|
|
3716
|
+
var version = "2.0.0-alpha.28";
|
|
3718
3717
|
EFFECTS.logger.info("Plugin editor gizmo version: " + version + ".");
|
|
3719
3718
|
if (version !== EFFECTS__namespace.version) {
|
|
3720
3719
|
console.error("注意:请统一 Editor Gizmo 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Editor Gizmo plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");
|