@shopware-ag/dive 3.0.11 → 4.0.0
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/README.md +31 -5
- package/build/chunks/{AssetCache-MtISiPD2.cjs → AssetCache-DdxevusY.cjs} +1 -1
- package/build/chunks/{AssetCache-DOB996Vk.mjs → AssetCache-MXFCGzZU.mjs} +1 -1
- package/build/chunks/AssetExporter-CD2iuQce.mjs +108 -0
- package/build/chunks/AssetExporter-CoL-QXkB.cjs +1 -0
- package/build/chunks/{AssetLoader-B1n3KGOu.cjs → AssetLoader-BDDJG9JL.cjs} +2 -2
- package/build/chunks/{AssetLoader-BY5D3Cvc.mjs → AssetLoader-kRhuVN4p.mjs} +12 -21
- package/build/chunks/FileTypes-DGSsi-AX.mjs +2294 -0
- package/build/chunks/FileTypes-gD_1MonW.cjs +29 -0
- package/build/chunks/ModelComponent-Cj3ff6nL.cjs +1 -0
- package/build/chunks/ModelComponent-DkfAgTL0.mjs +87 -0
- package/build/chunks/OrbitController-DFPcXvlO.cjs +1 -0
- package/build/chunks/OrbitController-DLEyTvUt.mjs +612 -0
- package/build/chunks/SpriteTextComponent-ByefJLeU.cjs +1 -0
- package/build/chunks/SpriteTextComponent-CG5vfiFy.mjs +83 -0
- package/build/chunks/collectAnimations-BgYCN1le.mjs +35 -0
- package/build/chunks/collectAnimations-C3HfZHte.cjs +1 -0
- package/build/chunks/contributesToBounds-C1mva__U.cjs +1 -0
- package/build/chunks/contributesToBounds-DYmHYES4.mjs +14 -0
- package/build/chunks/detachTransformControls-2XQrpLN-.cjs +1 -0
- package/build/chunks/detachTransformControls-Dr3TIdVy.mjs +209 -0
- package/build/chunks/{isFileTypeSupported-C-hfGk-7.mjs → isFileExtensionSupported-CgcqpgqN.mjs} +1 -1
- package/build/chunks/{isFileTypeSupported-xoGjHFuz.cjs → isFileExtensionSupported-RvlnH2dr.cjs} +1 -1
- package/build/chunks/isVisibleInHierarchy-D9JcLqR5.cjs +1 -0
- package/build/chunks/isVisibleInHierarchy-KzVGvDEw.mjs +21 -0
- package/build/components/boundingbox/BoundingBoxComponent.d.ts +100 -0
- package/build/components/boundingbox/index.d.ts +1 -0
- package/build/components/camera/CameraComponent.d.ts +75 -0
- package/build/components/camera/index.d.ts +2 -0
- package/build/components/camera/perspective/PerspectiveCameraComponent.d.ts +39 -0
- package/build/components/grid/GridComponent.d.ts +50 -0
- package/build/components/index.d.ts +6 -9
- package/build/components/light/LightComponent.d.ts +65 -0
- package/build/components/light/ambient/AmbientLightComponent.d.ts +10 -0
- package/build/components/light/directional/DirectionalLightComponent.d.ts +23 -0
- package/build/components/light/hemi/HemisphereLightComponent.d.ts +21 -0
- package/build/components/light/index.d.ts +5 -3
- package/build/components/light/point/PointLightComponent.d.ts +26 -0
- package/build/components/line/MultiLineComponent.d.ts +133 -0
- package/build/components/line/index.d.ts +1 -0
- package/build/components/mesh/MeshComponent.d.ts +74 -0
- package/build/components/mesh/floor/FloorComponent.d.ts +36 -0
- package/build/components/mesh/index.d.ts +4 -0
- package/build/components/mesh/model/ModelComponent.d.ts +67 -0
- package/build/components/mesh/primitive/PrimitiveComponent.d.ts +43 -0
- package/build/components/spritetext/SpriteTextComponent.d.ts +58 -0
- package/build/constants/VisibilityLayerMask.d.ts +23 -0
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +252 -774
- package/build/engine/Dive.d.ts +17 -13
- package/build/engine/boundingbox/BoundingBox.d.ts +76 -0
- package/build/engine/component/Component.d.ts +236 -0
- package/build/engine/environment/Environment.d.ts +8 -18
- package/build/engine/index.d.ts +4 -1
- package/build/engine/node/Node.d.ts +189 -0
- package/build/engine/promise/abortable/AbortablePromise.d.ts +8 -0
- package/build/engine/renderer/Renderer.d.ts +43 -7
- package/build/engine/scene/Scene.d.ts +88 -4
- package/build/engine/scene/root/Root.d.ts +29 -0
- package/build/engine/scene/xrroot/XRRoot.d.ts +1 -1
- package/build/engine/view/View.d.ts +15 -4
- package/build/helpers/collectAnimations/collectAnimations.d.ts +23 -0
- package/build/helpers/computeProductBounds/computeProductBounds.d.ts +18 -0
- package/build/helpers/contributesToBounds/contributesToBounds.d.ts +17 -0
- package/build/helpers/detachTransformControls/detachTransformControls.d.ts +15 -0
- package/build/helpers/disposeComponents/disposeComponents.d.ts +20 -0
- package/build/helpers/findSceneRecursive/findSceneRecursive.d.ts +7 -3
- package/build/helpers/implementsInterface/implementsInterface.d.ts +11 -0
- package/build/helpers/index.d.ts +6 -1
- package/build/helpers/isVisibleInHierarchy/isVisibleInHierarchy.d.ts +12 -0
- package/build/index.d.ts +0 -1
- package/build/plugins/animation/index.mjs +3 -2
- package/build/plugins/animation/src/system/AnimationSystem.d.ts +3 -2
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +2 -2
- package/build/plugins/ar/src/webxr/WebXR.d.ts +7 -0
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetexporter/index.cjs +1 -1
- package/build/plugins/assetexporter/index.mjs +1 -1
- package/build/plugins/assetexporter/src/AssetExporter.d.ts +12 -0
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +2 -2
- package/build/plugins/mediacreator/index.cjs +1 -1
- package/build/plugins/mediacreator/index.mjs +32 -30
- package/build/plugins/mediacreator/src/MediaCreator.d.ts +1 -2
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.d.ts +1 -0
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orbitcontroller/src/OrbitController.d.ts +39 -6
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.mjs +41 -33
- package/build/plugins/orientationdisplay/src/OrientationDisplay.d.ts +3 -3
- package/build/plugins/quickview/index.cjs +1 -1
- package/build/plugins/quickview/index.mjs +71 -19
- package/build/plugins/quickview/src/QuickView.d.ts +40 -8
- package/build/plugins/quickview/types/QuickViewSettings.d.ts +14 -0
- package/build/plugins/state/index.cjs +1 -27
- package/build/plugins/state/index.mjs +2031 -4135
- package/build/plugins/state/src/EngineGateway.d.ts +98 -0
- package/build/plugins/state/src/EntityRegistry.d.ts +51 -0
- package/build/plugins/state/src/State.d.ts +20 -9
- package/build/plugins/state/src/actions/camera/computeencompassingview.d.ts +1 -1
- package/build/plugins/state/src/actions/camera/movecamera.d.ts +2 -2
- package/build/plugins/state/src/actions/index.d.ts +1 -0
- package/build/plugins/state/src/actions/media/generatemedia.d.ts +1 -1
- package/build/plugins/state/src/actions/object/addobject.d.ts +2 -3
- package/build/plugins/state/src/actions/object/deleteobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/deselectobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/dropit.d.ts +2 -2
- package/build/plugins/state/src/actions/object/getallobjects.d.ts +2 -3
- package/build/plugins/state/src/actions/object/getobjects.d.ts +3 -4
- package/build/plugins/state/src/actions/object/index.d.ts +0 -1
- package/build/plugins/state/src/actions/object/modelloaded.d.ts +2 -2
- package/build/plugins/state/src/actions/object/selectobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/setparent.d.ts +3 -4
- package/build/plugins/state/src/actions/object/updateobject.d.ts +3 -4
- package/build/plugins/state/src/actions/renderer/startrender.d.ts +1 -1
- package/build/plugins/state/src/actions/scene/exportscene.d.ts +2 -2
- package/build/plugins/state/src/actions/scene/index.d.ts +0 -1
- package/build/plugins/state/src/actions/scene/setbackground.d.ts +2 -2
- package/build/plugins/state/src/actions/scene/updatescene.d.ts +2 -2
- package/build/plugins/state/src/actions/state/getstate.d.ts +8 -0
- package/build/plugins/state/src/actions/state/index.d.ts +2 -0
- package/build/plugins/state/src/actions/state/setstate.d.ts +8 -0
- package/build/plugins/state/src/helpers/copyVectors/copyVectors.d.ts +17 -0
- package/build/plugins/state/src/helpers/updateParentLink/updateParentLink.d.ts +29 -0
- package/build/plugins/state/src/helpers/watchEntity/watchEntity.d.ts +30 -0
- package/build/plugins/state/types/ActionTypes.d.ts +18 -3
- package/build/plugins/state/types/RegisteredEntity.d.ts +27 -0
- package/build/plugins/state/types/{StateSceneData.d.ts → StateData.d.ts} +7 -8
- package/build/plugins/state/types/index.d.ts +3 -1
- package/build/plugins/state/types/schema/BaseEntitySchema.d.ts +25 -0
- package/build/plugins/state/types/schema/CameraSchema.d.ts +18 -0
- package/build/plugins/state/types/schema/EntitySchema.d.ts +21 -0
- package/build/plugins/state/types/schema/EntityTypeSchema.d.ts +9 -0
- package/build/{types → plugins/state/types}/schema/GroupSchema.d.ts +8 -1
- package/build/{types → plugins/state/types}/schema/LightSchema.d.ts +16 -0
- package/build/plugins/state/types/schema/ModelSchema.d.ts +33 -0
- package/build/{types → plugins/state/types}/schema/PrimitiveSchema.d.ts +8 -4
- package/build/{types → plugins/state/types}/schema/index.d.ts +1 -4
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +194 -150
- package/build/plugins/toolbox/src/PointerContext.d.ts +7 -0
- package/build/plugins/toolbox/src/SelectionState.d.ts +21 -0
- package/build/plugins/toolbox/src/Toolbox.d.ts +9 -2
- package/build/{components → plugins/toolbox/src}/gizmo/Gizmo.d.ts +16 -2
- package/build/{components → plugins/toolbox/src}/gizmo/handles/AxisHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/handles/RadialHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/handles/ScaleHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/rotate/RotateGizmo.d.ts +2 -2
- package/build/{components → plugins/toolbox/src}/gizmo/scale/ScaleGizmo.d.ts +3 -3
- package/build/{components → plugins/toolbox/src}/gizmo/translate/TranslateGizmo.d.ts +2 -2
- package/build/types/components/DIVESceneObject.d.ts +13 -6
- package/build/types/components/index.d.ts +0 -1
- package/build/types/events/DIVEComponentEventMap.d.ts +14 -0
- package/build/types/events/DIVEEntityEventMap.d.ts +47 -0
- package/build/types/events/index.d.ts +2 -0
- package/build/types/geometry/DIVEGeometry.d.ts +16 -0
- package/build/types/geometry/DIVEGeometryType.d.ts +7 -0
- package/build/types/geometry/index.d.ts +2 -0
- package/build/types/index.d.ts +3 -1
- package/build/types/material/DIVEMaterial.d.ts +21 -0
- package/build/types/material/index.d.ts +1 -0
- package/package.json +8 -9
- package/build/chunks/AssetExporter-Cdxb04b3.cjs +0 -1
- package/build/chunks/AssetExporter-DLL_vJae.mjs +0 -67
- package/build/chunks/FileTypes-DMTSUCcK.cjs +0 -29
- package/build/chunks/FileTypes-DYtXCJQV.mjs +0 -2141
- package/build/chunks/PerspectiveCamera-B5TvUzTa.mjs +0 -39
- package/build/chunks/PerspectiveCamera-DwQUmkDv.cjs +0 -1
- package/build/chunks/PovSchema-Co9FznEz.cjs +0 -1
- package/build/chunks/PovSchema-DWWvr_ED.mjs +0 -10
- package/build/chunks/findInterface-C6mrvf_t.cjs +0 -1
- package/build/chunks/findInterface-DbJ5qzbc.mjs +0 -11
- package/build/components/boundingbox/BoundingBox.d.ts +0 -136
- package/build/components/floor/Floor.d.ts +0 -14
- package/build/components/grid/Grid.d.ts +0 -23
- package/build/components/group/Group.d.ts +0 -28
- package/build/components/light/AmbientLight.d.ts +0 -19
- package/build/components/light/PointLight.d.ts +0 -29
- package/build/components/light/SceneLight.d.ts +0 -20
- package/build/components/model/Model.d.ts +0 -26
- package/build/components/node/Node.d.ts +0 -24
- package/build/components/primitive/Primitive.d.ts +0 -27
- package/build/components/root/Root.d.ts +0 -34
- package/build/engine/camera/PerspectiveCamera.d.ts +0 -24
- package/build/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +0 -9
- package/build/plugins/state/src/actions/object/placeonfloor.d.ts +0 -12
- package/build/plugins/state/src/actions/scene/getallscenedata.d.ts +0 -9
- package/build/types/components/DIVELight.d.ts +0 -4
- package/build/types/schema/BaseEntitySchema.d.ts +0 -8
- package/build/types/schema/EntitySchema.d.ts +0 -11
- package/build/types/schema/EntityTypeSchema.d.ts +0 -1
- package/build/types/schema/GeometrySchema.d.ts +0 -7
- package/build/types/schema/GeometryTypeSchema.d.ts +0 -1
- package/build/types/schema/MaterialSchema.d.ts +0 -11
- package/build/types/schema/ModelSchema.d.ts +0 -14
- package/build/types/schema/PovSchema.d.ts +0 -10
- /package/build/{components → plugins/toolbox/src}/gizmo/plane/GizmoPlane.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Object3D } from 'three/webgpu';
|
|
2
|
-
import { OrbitController } from '
|
|
2
|
+
import { OrbitController } from '../../../../orbitcontroller/index.ts';
|
|
3
3
|
import { DIVERadialHandle } from '../handles/RadialHandle.ts';
|
|
4
|
-
import { DraggableEvent } from '
|
|
4
|
+
import { DraggableEvent } from '../../drag/DraggableEvent.ts';
|
|
5
5
|
export declare class DIVERotateGizmo extends Object3D {
|
|
6
6
|
children: DIVERadialHandle[];
|
|
7
7
|
private _controller;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Object3D, Vector3 } from 'three/webgpu';
|
|
2
|
-
import { DIVEHoverable } from '
|
|
3
|
-
import { OrbitController } from '
|
|
2
|
+
import { DIVEHoverable } from '../../../../../index.ts';
|
|
3
|
+
import { OrbitController } from '../../../../orbitcontroller/index.ts';
|
|
4
4
|
import { DIVEScaleHandle } from '../handles/ScaleHandle.ts';
|
|
5
|
-
import { DraggableEvent } from '
|
|
5
|
+
import { DraggableEvent } from '../../drag/DraggableEvent.ts';
|
|
6
6
|
export declare class DIVEScaleGizmo extends Object3D implements DIVEHoverable {
|
|
7
7
|
readonly isHoverable: true;
|
|
8
8
|
children: DIVEScaleHandle[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Object3D } from 'three/webgpu';
|
|
2
|
-
import { OrbitController } from '
|
|
2
|
+
import { OrbitController } from '../../../../orbitcontroller/index.ts';
|
|
3
3
|
import { DIVEAxisHandle } from '../handles/AxisHandle.ts';
|
|
4
|
-
import { DraggableEvent } from '
|
|
4
|
+
import { DraggableEvent } from '../../drag/DraggableEvent.ts';
|
|
5
5
|
export declare class DIVETranslateGizmo extends Object3D {
|
|
6
6
|
private _controller;
|
|
7
7
|
set debug(value: boolean);
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { DIVENode } from '../../engine/node/Node.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Anything the engine can put in the scene tree.
|
|
4
|
+
*
|
|
5
|
+
* Every entity is a `DIVENode`: what it *is* comes from the components attached
|
|
6
|
+
* to it, not from its class. Lights, models, primitives and groups are all
|
|
7
|
+
* plain nodes with different component sets, and the state plugin's gateway is
|
|
8
|
+
* what decides which set an entity type gets.
|
|
9
|
+
*
|
|
10
|
+
* Kept as a named type because it reads better at the boundary and leaves room
|
|
11
|
+
* to narrow again later.
|
|
12
|
+
*/
|
|
13
|
+
export type DIVESceneObject = DIVENode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Carries nothing beyond the fact that it happened. */
|
|
2
|
+
type DIVEComponentBareEvent = object;
|
|
3
|
+
/**
|
|
4
|
+
* What a component announces about itself.
|
|
5
|
+
*
|
|
6
|
+
* Separate from {@link DIVEEntityEventMap}: a component knows about an asset, a
|
|
7
|
+
* geometry, a material -- never about entities or their ids. Whoever listens
|
|
8
|
+
* knows which component it attached to, and `event.target` is there for anyone
|
|
9
|
+
* who does not.
|
|
10
|
+
*/
|
|
11
|
+
export type DIVEComponentEventMap = {
|
|
12
|
+
'object-load': DIVEComponentBareEvent;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Object3DEventMap, Vector3Like } from 'three/webgpu';
|
|
2
|
+
import { DIVEComponent } from '../../engine/component/Component.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The transform an entity reports about itself.
|
|
5
|
+
*
|
|
6
|
+
* `position` is in world space, `rotation` and `scale` are local — that is
|
|
7
|
+
* what the objects already computed before they reported anything.
|
|
8
|
+
*
|
|
9
|
+
* The vectors are live references into the emitting object, including a
|
|
10
|
+
* scratch buffer that the next frame overwrites. A listener that keeps them
|
|
11
|
+
* must copy first. This is deliberate: the event fires once per gizmo frame
|
|
12
|
+
* and must not allocate.
|
|
13
|
+
*/
|
|
14
|
+
export type DIVEEntityTransformEvent = {
|
|
15
|
+
position: Vector3Like;
|
|
16
|
+
rotation: Vector3Like;
|
|
17
|
+
scale: Vector3Like;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* What a scene object announces about itself.
|
|
21
|
+
*
|
|
22
|
+
* The engine only states facts here — that something moved, was selected, or
|
|
23
|
+
* was deselected. Whether any of it means something is for a listener to
|
|
24
|
+
* decide, which is what keeps the engine free of state knowledge.
|
|
25
|
+
*
|
|
26
|
+
* A finished asset load is not on this list. Fetching is a component's business,
|
|
27
|
+
* and a component says so itself — see {@link DIVEComponentEventMap}. A node used
|
|
28
|
+
* to announce it only because a component had no way to speak for itself, which
|
|
29
|
+
* also meant a component with no owner yet dropped the event silently.
|
|
30
|
+
*
|
|
31
|
+
* No event carries an id: whoever attached the listener knows which object it
|
|
32
|
+
* belongs to, and `event.target` is available for anyone who does not.
|
|
33
|
+
*/
|
|
34
|
+
/** Carries nothing beyond the fact that it happened. */
|
|
35
|
+
type DIVEEntityBareEvent = object;
|
|
36
|
+
/** Which component joined or left. */
|
|
37
|
+
export type DIVENodeComponentEvent = {
|
|
38
|
+
component: DIVEComponent;
|
|
39
|
+
};
|
|
40
|
+
export type DIVEEntityEventMap = Object3DEventMap & {
|
|
41
|
+
'object-transform': DIVEEntityTransformEvent;
|
|
42
|
+
'object-select': DIVEEntityBareEvent;
|
|
43
|
+
'object-deselect': DIVEEntityBareEvent;
|
|
44
|
+
componentadded: DIVENodeComponentEvent;
|
|
45
|
+
componentremoved: DIVENodeComponentEvent;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DIVEGeometryType } from './DIVEGeometryType.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Describes the shape of a primitive.
|
|
4
|
+
*
|
|
5
|
+
* The three dimensions are a common denominator across all shapes rather than
|
|
6
|
+
* a bounding box, so each type reads only what it needs: a sphere derives its
|
|
7
|
+
* radius from `width` alone and ignores the other two, while a box uses all
|
|
8
|
+
* three.
|
|
9
|
+
*/
|
|
10
|
+
export type DIVEGeometry = {
|
|
11
|
+
/** Picks the shape to build, see {@link DIVEGeometryType}. */
|
|
12
|
+
name: DIVEGeometryType;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
depth: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes a primitive can take.
|
|
3
|
+
*
|
|
4
|
+
* `cube` and `box` build the same geometry. An unknown value is not an error,
|
|
5
|
+
* it only warns and leaves the primitive without a mesh.
|
|
6
|
+
*/
|
|
7
|
+
export type DIVEGeometryType = 'cylinder' | 'sphere' | 'pyramid' | 'cube' | 'box' | 'cone' | 'wall' | 'plane';
|
package/build/types/index.d.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Texture } from 'three/webgpu';
|
|
2
|
+
/**
|
|
3
|
+
* Surface properties of a model or primitive.
|
|
4
|
+
*
|
|
5
|
+
* Both carry this as a `Partial`, and a patch is merged into what is already
|
|
6
|
+
* there field by field. A nested field can therefore be overwritten but not
|
|
7
|
+
* removed again through an update.
|
|
8
|
+
*
|
|
9
|
+
* The `null` on the texture slots means "no texture", not "unchanged".
|
|
10
|
+
*/
|
|
11
|
+
export type DIVEMaterial = {
|
|
12
|
+
vertexColors: boolean;
|
|
13
|
+
color: string | number;
|
|
14
|
+
/** The base colour texture. */
|
|
15
|
+
map: Texture | null;
|
|
16
|
+
normalMap: Texture | null;
|
|
17
|
+
roughness: number;
|
|
18
|
+
roughnessMap: Texture | null;
|
|
19
|
+
metalness: number;
|
|
20
|
+
metalnessMap: Texture | null;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DIVEMaterial.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopware-ag/dive",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Shopware Spatial Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/dive.cjs",
|
|
@@ -107,9 +107,8 @@
|
|
|
107
107
|
"> 1%, not dead, not ie 11, not op_mini all"
|
|
108
108
|
],
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"three": "^0.
|
|
110
|
+
"three": "^0.185.1",
|
|
111
111
|
"@tweenjs/tween.js": "^25.0.0",
|
|
112
|
-
"three-spritetext": "^1.8.2",
|
|
113
112
|
"lodash": "^4.18.1",
|
|
114
113
|
"occt-import-js": "^0.0.23"
|
|
115
114
|
},
|
|
@@ -119,8 +118,8 @@
|
|
|
119
118
|
"@types/jest": "^29.5.12",
|
|
120
119
|
"@types/lodash": "^4.17.12",
|
|
121
120
|
"@types/node": "^20.12.7",
|
|
122
|
-
"@types/three": "^0.
|
|
123
|
-
"@vitest/coverage-v8": "3.
|
|
121
|
+
"@types/three": "^0.185.1",
|
|
122
|
+
"@vitest/coverage-v8": "3.2.7",
|
|
124
123
|
"acorn": "^8.14.1",
|
|
125
124
|
"acorn-walk": "^8.3.4",
|
|
126
125
|
"chokidar": "^3.6.0",
|
|
@@ -130,13 +129,11 @@
|
|
|
130
129
|
"jsdom": "^26.1.0",
|
|
131
130
|
"log-update": "^6.1.0",
|
|
132
131
|
"magic-string": "^0.30.17",
|
|
133
|
-
"prettier": "^3.
|
|
134
|
-
"prettier-plugin-multiline-arrays": "^3.0.6",
|
|
132
|
+
"prettier": "^3.9.6",
|
|
135
133
|
"rollup-plugin-copy": "^3.5.0",
|
|
136
134
|
"ts-jest": "^29.1.2",
|
|
137
135
|
"ts-morph": "^25.0.1",
|
|
138
136
|
"ts-node": "^10.9.2",
|
|
139
|
-
"tsc": "^2.0.4",
|
|
140
137
|
"tsx": "^4.19.4",
|
|
141
138
|
"typescript": "^5.8.2",
|
|
142
139
|
"typescript-eslint": "^7.7.1",
|
|
@@ -148,7 +145,9 @@
|
|
|
148
145
|
},
|
|
149
146
|
"resolutions": {
|
|
150
147
|
"lodash": "4.18.1",
|
|
151
|
-
"vite-plugin-dts/@microsoft/api-extractor/minimatch": "3.1.5"
|
|
148
|
+
"vite-plugin-dts/@microsoft/api-extractor/minimatch": "3.1.5",
|
|
149
|
+
"minimatch/brace-expansion": "1.1.16",
|
|
150
|
+
"fast-uri": "^3.1.7"
|
|
152
151
|
},
|
|
153
152
|
"scripts": {
|
|
154
153
|
"build": "vite build",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var c=(o,r,t)=>r in o?i(o,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[r]=t;var n=(o,r,t)=>c(o,typeof r!="symbol"?r+"":r,t);const p=require("three/webgpu"),u=require("three/examples/jsm/exporters/GLTFExporter.js"),f=require("three/examples/jsm/exporters/USDZExporter.js"),s=require("./parse-error-Dy_EE4rL.cjs");class x{constructor(){n(this,"_gltfExporter");n(this,"_usdzExporter");this._gltfExporter=new u.GLTFExporter,this._usdzExporter=new f.USDZExporter}async export(r,t,e){switch(this._computeNormals(r),t){case"glb":return this._exportGlb(r,e);case"gltf":return this._exportGltf(r,e);case"usdz":return this._exportUsdz(r,e);default:throw new s.FileTypeError(`Unsupported file type: ${t}`,t)}}async _exportGlb(r,t){try{const e=await this._gltfExporter.parseAsync(r,{animations:r.animations.length>0?r.animations:void 0,...t,binary:!0});if(e instanceof ArrayBuffer)return e;throw new s.ParseError("Failed to export GLB: expected ArrayBuffer")}catch(e){throw e instanceof s.ParseError?e:new s.ParseError("Failed to export GLB",e)}}async _exportGltf(r,t){try{const e=await this._gltfExporter.parseAsync(r,{animations:r.animations||[],...t,binary:!1}),a=JSON.stringify(e);return new TextEncoder().encode(a).buffer}catch(e){throw e instanceof s.ParseError?e:new s.ParseError("Failed to export GLTF",e)}}async _exportUsdz(r,t){try{return(await this._usdzExporter.parseAsync(r,t)).buffer}catch(e){throw e instanceof s.ParseError?e:new s.ParseError("Failed to export USDZ",e)}}_computeNormals(r){r.traverse(t=>{t instanceof p.Mesh&&t.geometry&&(t.geometry.getAttribute("normal")||t.geometry.computeVertexNormals())})}}exports.AssetExporter=x;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
var i = Object.defineProperty;
|
|
2
|
-
var f = (s, r, e) => r in s ? i(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
|
|
3
|
-
var n = (s, r, e) => f(s, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
-
import { Mesh as p } from "three/webgpu";
|
|
5
|
-
import { GLTFExporter as c } from "three/examples/jsm/exporters/GLTFExporter.js";
|
|
6
|
-
import { USDZExporter as x } from "three/examples/jsm/exporters/USDZExporter.js";
|
|
7
|
-
import { F as u, P as o } from "./parse-error-DfOPyLWM.mjs";
|
|
8
|
-
class E {
|
|
9
|
-
constructor() {
|
|
10
|
-
n(this, "_gltfExporter");
|
|
11
|
-
n(this, "_usdzExporter");
|
|
12
|
-
this._gltfExporter = new c(), this._usdzExporter = new x();
|
|
13
|
-
}
|
|
14
|
-
async export(r, e, t) {
|
|
15
|
-
switch (this._computeNormals(r), e) {
|
|
16
|
-
case "glb":
|
|
17
|
-
return this._exportGlb(r, t);
|
|
18
|
-
case "gltf":
|
|
19
|
-
return this._exportGltf(r, t);
|
|
20
|
-
case "usdz":
|
|
21
|
-
return this._exportUsdz(r, t);
|
|
22
|
-
default:
|
|
23
|
-
throw new u(`Unsupported file type: ${e}`, e);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
async _exportGlb(r, e) {
|
|
27
|
-
try {
|
|
28
|
-
const t = await this._gltfExporter.parseAsync(r, {
|
|
29
|
-
animations: r.animations.length > 0 ? r.animations : void 0,
|
|
30
|
-
...e,
|
|
31
|
-
binary: !0
|
|
32
|
-
});
|
|
33
|
-
if (t instanceof ArrayBuffer)
|
|
34
|
-
return t;
|
|
35
|
-
throw new o("Failed to export GLB: expected ArrayBuffer");
|
|
36
|
-
} catch (t) {
|
|
37
|
-
throw t instanceof o ? t : new o("Failed to export GLB", t);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
async _exportGltf(r, e) {
|
|
41
|
-
try {
|
|
42
|
-
const t = await this._gltfExporter.parseAsync(r, {
|
|
43
|
-
animations: r.animations || [],
|
|
44
|
-
...e,
|
|
45
|
-
binary: !1
|
|
46
|
-
}), a = JSON.stringify(t);
|
|
47
|
-
return new TextEncoder().encode(a).buffer;
|
|
48
|
-
} catch (t) {
|
|
49
|
-
throw t instanceof o ? t : new o("Failed to export GLTF", t);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
async _exportUsdz(r, e) {
|
|
53
|
-
try {
|
|
54
|
-
return (await this._usdzExporter.parseAsync(r, e)).buffer;
|
|
55
|
-
} catch (t) {
|
|
56
|
-
throw t instanceof o ? t : new o("Failed to export USDZ", t);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
_computeNormals(r) {
|
|
60
|
-
r.traverse((e) => {
|
|
61
|
-
e instanceof p && e.geometry && (e.geometry.getAttribute("normal") || e.geometry.computeVertexNormals());
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
E as A
|
|
67
|
-
};
|