@galacean/effects-plugin-editor-gizmo 2.0.0-alpha.30 → 2.0.0-alpha.32
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/gizmo-component.d.ts +1 -0
- package/dist/index.js +17 -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 +18 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
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.32
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as EFFECTS from '@galacean/effects';
|
|
10
|
-
import { math, DestroyOptions, glContext, ShaderType, GLSLVersion, Material, Mesh, GLGeometry, createShaderWithMacros, Texture, noop, Geometry, Transform, serialize, effectsClass,
|
|
10
|
+
import { math, DestroyOptions, glContext, ShaderType, GLSLVersion, Material, Mesh, GLGeometry, createShaderWithMacros, Texture, noop, Geometry, Transform, serialize, effectsClass, RendererComponent, ParticleSystemRenderer, assertExist, HitTestType, spec, removeItem, RenderPass, RenderPassPriorityPostprocess, TextureLoadAction, RenderPassPriorityPrepare, AbstractPlugin, registerPlugin, VFXItem, logger } from '@galacean/effects';
|
|
11
11
|
|
|
12
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
13
13
|
try {
|
|
@@ -3081,9 +3081,23 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
|
|
|
3081
3081
|
}
|
|
3082
3082
|
composition.loaderData.gizmoItems.push(this.item);
|
|
3083
3083
|
};
|
|
3084
|
-
_proto.
|
|
3084
|
+
_proto.update = function update(dt) {
|
|
3085
3085
|
this.updateRenderData();
|
|
3086
3086
|
};
|
|
3087
|
+
_proto.render = function render(renderer) {
|
|
3088
|
+
// The material of the 3D plugin is updated during the render phase. In order to obtain the correct value, it is kept consistent here.
|
|
3089
|
+
if (this.subType === GizmoSubType.modelWireframe) {
|
|
3090
|
+
if (this.wireframeMesh && this.targetItem) {
|
|
3091
|
+
var _this_targetItem_getComponent;
|
|
3092
|
+
//@ts-expect-error TODO 和 3D 类型解耦
|
|
3093
|
+
var meshes = (_this_targetItem_getComponent = this.targetItem.getComponent(RendererComponent)) == null ? void 0 : _this_targetItem_getComponent.content.subMeshes;
|
|
3094
|
+
var wireframeMeshes = this.wireframeMeshes;
|
|
3095
|
+
if ((meshes == null ? void 0 : meshes.length) > 0) {
|
|
3096
|
+
updateWireframeMesh(meshes[0].geometry.geometry, meshes[0].material.effectMaterial, wireframeMeshes[0], WireframeGeometryType.triangle);
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
};
|
|
3087
3101
|
_proto.updateRenderData = function updateRenderData() {
|
|
3088
3102
|
var item = this.item;
|
|
3089
3103
|
var gizmoSubType = this.subType;
|
|
@@ -3100,16 +3114,6 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
|
|
|
3100
3114
|
this.wireframeMesh.worldMatrix = particle.particleMesh.mesh.worldMatrix;
|
|
3101
3115
|
}
|
|
3102
3116
|
}
|
|
3103
|
-
} else if (gizmoSubType === GizmoSubType.modelWireframe) {
|
|
3104
|
-
if (this.wireframeMesh && this.targetItem) {
|
|
3105
|
-
var _this_targetItem_getComponent;
|
|
3106
|
-
//@ts-expect-error TODO 和 3D 类型解耦
|
|
3107
|
-
var meshes = (_this_targetItem_getComponent = this.targetItem.getComponent(RendererComponent)) == null ? void 0 : _this_targetItem_getComponent.content.subMeshes;
|
|
3108
|
-
var wireframeMeshes = this.wireframeMeshes;
|
|
3109
|
-
if ((meshes == null ? void 0 : meshes.length) > 0) {
|
|
3110
|
-
updateWireframeMesh(meshes[0].geometry.geometry, meshes[0].material.effectMaterial, wireframeMeshes[0], WireframeGeometryType.triangle);
|
|
3111
|
-
}
|
|
3112
|
-
}
|
|
3113
3117
|
} else {
|
|
3114
3118
|
if (this.targetItem) {
|
|
3115
3119
|
if (this.contents) {
|
|
@@ -3689,7 +3693,7 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
3689
3693
|
}(AbstractPlugin);
|
|
3690
3694
|
|
|
3691
3695
|
registerPlugin("editor-gizmo", EditorGizmoPlugin, VFXItem);
|
|
3692
|
-
var version = "2.0.0-alpha.
|
|
3696
|
+
var version = "2.0.0-alpha.32";
|
|
3693
3697
|
logger.info("Plugin editor gizmo version: " + version + ".");
|
|
3694
3698
|
if (version !== EFFECTS.version) {
|
|
3695
3699
|
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!");
|