@zephyr3d/editor 0.3.5 → 0.3.7

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.
Files changed (48) hide show
  1. package/dist/assets/{index-DlnbO59X.js → index-ySiLtSxz.js} +2 -2
  2. package/dist/assistant/zephyr-types-index.json +14215 -7892
  3. package/dist/index.html +1 -1
  4. package/dist/modules/zephyr3d_backend-webgl.js.map +1 -1
  5. package/dist/modules/zephyr3d_backend-webgpu.js.map +1 -1
  6. package/dist/modules/zephyr3d_base.js +152 -152
  7. package/dist/modules/zephyr3d_base.js.map +1 -1
  8. package/dist/modules/zephyr3d_imgui.js.map +1 -1
  9. package/dist/modules/zephyr3d_loaders.js +6 -6
  10. package/dist/modules/zephyr3d_loaders.js.map +1 -1
  11. package/dist/modules/zephyr3d_scene.js +2538 -348
  12. package/dist/modules/zephyr3d_scene.js.map +1 -1
  13. package/dist/vendor/zephyr3d/backend-webgl/dist/index.js.map +1 -1
  14. package/dist/vendor/zephyr3d/backend-webgpu/dist/index.js.map +1 -1
  15. package/dist/vendor/zephyr3d/base/dist/vfs/common.js +152 -152
  16. package/dist/vendor/zephyr3d/base/dist/vfs/common.js.map +1 -1
  17. package/dist/vendor/zephyr3d/imgui/dist/index.d.ts +7 -0
  18. package/dist/vendor/zephyr3d/imgui/dist/index.js.map +1 -1
  19. package/dist/vendor/zephyr3d/loaders/dist/gltf/gltf_importer.js +6 -6
  20. package/dist/vendor/zephyr3d/loaders/dist/gltf/gltf_importer.js.map +1 -1
  21. package/dist/vendor/zephyr3d/scene/dist/animation/animation.js +87 -0
  22. package/dist/vendor/zephyr3d/scene/dist/animation/animation.js.map +1 -1
  23. package/dist/vendor/zephyr3d/scene/dist/animation/animationcontroller.js +503 -0
  24. package/dist/vendor/zephyr3d/scene/dist/animation/animationcontroller.js.map +1 -0
  25. package/dist/vendor/zephyr3d/scene/dist/animation/animationset.js +782 -156
  26. package/dist/vendor/zephyr3d/scene/dist/animation/animationset.js.map +1 -1
  27. package/dist/vendor/zephyr3d/scene/dist/animation/animationtimeline.js +974 -0
  28. package/dist/vendor/zephyr3d/scene/dist/animation/animationtimeline.js.map +1 -0
  29. package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics/convex_collider.js +320 -0
  30. package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics/convex_collider.js.map +1 -0
  31. package/dist/vendor/zephyr3d/scene/dist/app/scriptregistry.js +130 -125
  32. package/dist/vendor/zephyr3d/scene/dist/app/scriptregistry.js.map +1 -1
  33. package/dist/vendor/zephyr3d/scene/dist/asset/model.js +64 -63
  34. package/dist/vendor/zephyr3d/scene/dist/asset/model.js.map +1 -1
  35. package/dist/vendor/zephyr3d/scene/dist/index.d.ts +1270 -9
  36. package/dist/vendor/zephyr3d/scene/dist/index.js +3 -1
  37. package/dist/vendor/zephyr3d/scene/dist/index.js.map +1 -1
  38. package/dist/vendor/zephyr3d/scene/dist/material/mixins/lit.js +7 -3
  39. package/dist/vendor/zephyr3d/scene/dist/material/mixins/lit.js.map +1 -1
  40. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js +1 -0
  41. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js.map +1 -1
  42. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/animation.js +4 -3
  43. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/animation.js.map +1 -1
  44. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/camera.js +1 -1
  45. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/camera.js.map +1 -1
  46. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/node.js +3 -2
  47. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/node.js.map +1 -1
  48. package/package.json +8 -8
@@ -4,9 +4,10 @@ import { Mesh } from '../scene/mesh.js';
4
4
  import { BoundingBox } from '../utility/bounding_volume.js';
5
5
  import { SceneNode, setSceneMeshAssetBinding } from '../scene/scene_node.js';
6
6
  import { SkeletonRig, SkinBinding } from '../animation/skeleton.js';
7
+ import '../animation/animationset.js';
8
+ import { NodeTranslationTrack } from '../animation/translationtrack.js';
7
9
  import { NodeRotationTrack } from '../animation/rotationtrack.js';
8
10
  import '../animation/eulerrotationtrack.js';
9
- import { NodeTranslationTrack } from '../animation/translationtrack.js';
10
11
  import { NodeScaleTrack } from '../animation/scaletrack.js';
11
12
  import { MorphTargetTrack } from '../animation/morphtrack.js';
12
13
  import { FixedGeometryCacheTrack } from '../animation/fixed_geometry_cache_track.js';
@@ -23,21 +24,21 @@ import { PBRSpecularGlossinessMaterial } from '../material/pbrsg.js';
23
24
  import { PBRMetallicRoughnessMaterial } from '../material/pbrmr.js';
24
25
  import { MToonMaterial } from '../material/mtoon.js';
25
26
 
26
- /**
27
- * Named object interface for model loading
28
- * @public
27
+ /**
28
+ * Named object interface for model loading
29
+ * @public
29
30
  */ class NamedObject {
30
31
  name;
31
- /**
32
- * Creates an instance of NamedObject
33
- * @param name - Name of the object
32
+ /**
33
+ * Creates an instance of NamedObject
34
+ * @param name - Name of the object
34
35
  */ constructor(name){
35
36
  this.name = name;
36
37
  }
37
38
  }
38
- /**
39
- * Heirarchical node interface for model loading
40
- * @public
39
+ /**
40
+ * Heirarchical node interface for model loading
41
+ * @public
41
42
  */ class AssetHierarchyNode extends NamedObject {
42
43
  _parent;
43
44
  _position;
@@ -51,10 +52,10 @@ import { MToonMaterial } from '../material/mtoon.js';
51
52
  _weights;
52
53
  _children;
53
54
  _instances;
54
- /**
55
- * Creates an instance of AssetHierarchyNode
56
- * @param name - Name of the node
57
- * @param parent - Parent of the node
55
+ /**
56
+ * Creates an instance of AssetHierarchyNode
57
+ * @param name - Name of the node
58
+ * @param parent - Parent of the node
58
59
  */ constructor(name, model, parent){
59
60
  super(name);
60
61
  model.nodes.push(this);
@@ -142,9 +143,9 @@ import { MToonMaterial } from '../material/mtoon.js';
142
143
  child.computeTransforms(this._worldMatrix);
143
144
  }
144
145
  }
145
- /**
146
- * Adds a child to this node
147
- * @param child - The child node to be added
146
+ /**
147
+ * Adds a child to this node
148
+ * @param child - The child node to be added
148
149
  */ addChild(child) {
149
150
  if (!child || child.parent) {
150
151
  throw new Error('AssetHierarchyNode.addChild(): invalid child node');
@@ -152,9 +153,9 @@ import { MToonMaterial } from '../material/mtoon.js';
152
153
  this._children.push(child);
153
154
  child._parent = this;
154
155
  }
155
- /**
156
- * Removes a child of this node
157
- * @param child - The child node to be removed
156
+ /**
157
+ * Removes a child of this node
158
+ * @param child - The child node to be removed
158
159
  */ removeChild(child) {
159
160
  const index = this._children.indexOf(child);
160
161
  if (index < 0) {
@@ -163,10 +164,10 @@ import { MToonMaterial } from '../material/mtoon.js';
163
164
  this._children[index]._parent = null;
164
165
  this._children.splice(index, 1);
165
166
  }
166
- /**
167
- * Attach this node to a skeleton
168
- * @param skeleton - The skeleton to which to node will attach
169
- * @param index - The joint index
167
+ /**
168
+ * Attach this node to a skeleton
169
+ * @param skeleton - The skeleton to which to node will attach
170
+ * @param index - The joint index
170
171
  */ attachToSkeleton(skeleton) {
171
172
  if (!this._attachToSkeleton) {
172
173
  this._attachToSkeleton = new Set();
@@ -174,18 +175,18 @@ import { MToonMaterial } from '../material/mtoon.js';
174
175
  this._attachToSkeleton.add(skeleton);
175
176
  }
176
177
  }
177
- /**
178
- * Skeleton information for model loading
179
- * @public
178
+ /**
179
+ * Skeleton information for model loading
180
+ * @public
180
181
  */ class AssetSkeleton extends NamedObject {
181
182
  /** The pivot node */ pivot;
182
183
  /** Joints of the skeleton */ joints;
183
184
  /** Inverse of the binding matrices of the joints */ inverseBindMatrices;
184
185
  /** Binding pose matrices of the joints */ bindPose;
185
186
  /** Explicit humanoid joint mapping, when supplied by the source asset. */ humanoidJointMapping;
186
- /**
187
- * Creates an instance of AssetSkeleton
188
- * @param name - Name of the skeleton
187
+ /**
188
+ * Creates an instance of AssetSkeleton
189
+ * @param name - Name of the skeleton
189
190
  */ constructor(name){
190
191
  super(name);
191
192
  this.name = name;
@@ -195,10 +196,10 @@ import { MToonMaterial } from '../material/mtoon.js';
195
196
  this.bindPose = [];
196
197
  this.humanoidJointMapping = null;
197
198
  }
198
- /**
199
- * Adds a joint to the skeleton
200
- * @param joint - The joint node
201
- * @param inverseBindMatrix - Inverse binding matrix of the joint
199
+ /**
200
+ * Adds a joint to the skeleton
201
+ * @param joint - The joint node
202
+ * @param inverseBindMatrix - Inverse binding matrix of the joint
202
203
  */ addJoint(joint, inverseBindMatrix) {
203
204
  joint.attachToSkeleton(this);
204
205
  this.joints.push(joint);
@@ -222,22 +223,22 @@ import { MToonMaterial } from '../material/mtoon.js';
222
223
  return root;
223
224
  }
224
225
  }
225
- /**
226
- * Scene for model loading
227
- * @public
226
+ /**
227
+ * Scene for model loading
228
+ * @public
228
229
  */ class AssetScene extends NamedObject {
229
230
  /** Root nodes of the scene */ rootNodes;
230
- /**
231
- * Creates an instance of AssetScene
232
- * @param name - Name of the scene
231
+ /**
232
+ * Creates an instance of AssetScene
233
+ * @param name - Name of the scene
233
234
  */ constructor(name){
234
235
  super(name);
235
236
  this.rootNodes = [];
236
237
  }
237
238
  }
238
- /**
239
- * Model information that can be shared by multiple model nodes
240
- * @public
239
+ /**
240
+ * Model information that can be shared by multiple model nodes
241
+ * @public
241
242
  */ class SharedModel extends Disposable {
242
243
  /** @internal */ _nodes;
243
244
  /** @internal */ _skeletons;
@@ -255,8 +256,8 @@ import { MToonMaterial } from '../material/mtoon.js';
255
256
  /** @internal */ _morphTargetGroups;
256
257
  /** @internal */ _textureMap;
257
258
  /** @internal */ _primitiveMap;
258
- /**
259
- * Creates an instance of SharedModel
259
+ /**
260
+ * Creates an instance of SharedModel
260
261
  */ constructor(){
261
262
  super();
262
263
  this._nodes = [];
@@ -526,29 +527,29 @@ import { MToonMaterial } from '../material/mtoon.js';
526
527
  getPrimitiveBaseName(info, index, fallback) {
527
528
  return info?.name?.trim() || `${fallback}_mesh_${index}`;
528
529
  }
529
- /**
530
- * Adds a model-level morph target group.
531
- * @param group - Morph target group to add
530
+ /**
531
+ * Adds a model-level morph target group.
532
+ * @param group - Morph target group to add
532
533
  */ addMorphTargetGroup(group) {
533
534
  if (group?.name && group.bindings?.length > 0) {
534
535
  this._morphTargetGroups.push(group);
535
536
  }
536
537
  }
537
- /**
538
- * Removes all model-level morph target groups.
538
+ /**
539
+ * Removes all model-level morph target groups.
539
540
  */ clearMorphTargetGroups() {
540
541
  this._morphTargetGroups = [];
541
542
  }
542
- /**
543
- * Finds a model-level morph target group by name.
544
- * @param name - Group name
545
- * @returns The matching group, or null if not found
543
+ /**
544
+ * Finds a model-level morph target group by name.
545
+ * @param name - Group name
546
+ * @returns The matching group, or null if not found
546
547
  */ getMorphTargetGroup(name) {
547
548
  return this._morphTargetGroups.find((group)=>group.name === name) ?? null;
548
549
  }
549
- /**
550
- * Builds morph target groups by collecting morph target names from every mesh.
551
- * @returns Generated morph target groups
550
+ /**
551
+ * Builds morph target groups by collecting morph target names from every mesh.
552
+ * @returns Generated morph target groups
552
553
  */ buildMorphTargetGroupsByName() {
553
554
  this.clearMorphTargetGroups();
554
555
  const groups = new Map();
@@ -581,15 +582,15 @@ import { MToonMaterial } from '../material/mtoon.js';
581
582
  this._morphTargetGroups = Array.from(groups.values());
582
583
  return this._morphTargetGroups;
583
584
  }
584
- /**
585
- * Adds a skeleton to the scene
586
- * @param skeleton - The skeleton to be added
585
+ /**
586
+ * Adds a skeleton to the scene
587
+ * @param skeleton - The skeleton to be added
587
588
  */ addSkeleton(skeleton) {
588
589
  this._skeletons.push(skeleton);
589
590
  }
590
- /**
591
- * Adds an animation to the scene
592
- * @param animation - The animation to be added
591
+ /**
592
+ * Adds an animation to the scene
593
+ * @param animation - The animation to be added
593
594
  */ addAnimation(animation) {
594
595
  this._animations.push(animation);
595
596
  }