@galacean/engine-core 1.2.0-beta.4 → 1.2.0-beta.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "1.2.0-beta.4",
3
+ "version": "1.2.0-beta.5",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,10 +15,10 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-math": "1.2.0-beta.4"
18
+ "@galacean/engine-math": "1.2.0-beta.5"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "1.2.0-beta.4"
21
+ "@galacean/engine-design": "1.2.0-beta.5"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
package/types/Entity.d.ts CHANGED
@@ -127,7 +127,7 @@ export declare class Entity extends EngineObject {
127
127
  */
128
128
  clearChildren(): void;
129
129
  /**
130
- * Clone.
130
+ * Clone this entity include children and components.
131
131
  * @returns Cloned entity
132
132
  */
133
133
  clone(): Entity;
@@ -0,0 +1 @@
1
+ export {};
@@ -13,5 +13,5 @@ export declare class ComponentCloner {
13
13
  * @param source - Clone source
14
14
  * @param target - Clone target
15
15
  */
16
- static cloneComponent(source: Component, target: Component, srcRoot: Entity, targetRoot: Entity): void;
16
+ static cloneComponent(source: Component, target: Component, srcRoot: Entity, targetRoot: Entity, deepInstanceMap: Map<Object, Object>): void;
17
17
  }
@@ -1,19 +1,35 @@
1
1
  import { Matrix } from "@galacean/engine-math";
2
- import { EngineObject } from "../base/EngineObject";
3
2
  import { Entity } from "../Entity";
3
+ import { EngineObject } from "../base/EngineObject";
4
+ import { IComponentCustomClone } from "../clone/ComponentCloner";
4
5
  /**
5
- * Mesh skin data, equal glTF skins define
6
+ * Skin used for skinned mesh renderer.
6
7
  */
7
- export declare class Skin extends EngineObject {
8
+ export declare class Skin extends EngineObject implements IComponentCustomClone {
8
9
  name: string;
10
+ /** Inverse bind matrices. */
9
11
  inverseBindMatrices: Matrix[];
10
- joints: string[];
11
- skeleton: string;
12
- _rootBone: Entity;
13
- _bones: Entity[];
12
+ private _rootBone;
13
+ private _bones;
14
+ private _updateMark;
14
15
  /**
15
- * Constructor of skin
16
- * @param name - name
16
+ * Root bone.
17
17
  */
18
+ get rootBone(): Entity;
19
+ set rootBone(value: Entity);
20
+ /**
21
+ * Bones of the skin.
22
+ */
23
+ get bones(): ReadonlyArray<Entity>;
24
+ set bones(value: ReadonlyArray<Entity>);
18
25
  constructor(name: string);
26
+ /** @deprecated Please use `bones` instead. */
27
+ joints: string[];
28
+ /** @deprecated Please use `rootBone` instead. */
29
+ get skeleton(): string;
30
+ set skeleton(value: string);
31
+ }
32
+ export declare enum SkinUpdateFlag {
33
+ BoneCountChanged = 0,
34
+ RootBoneChanged = 1
19
35
  }
@@ -14,10 +14,13 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
14
14
  private _jointDataCreateCache;
15
15
  private _blendShapeWeights;
16
16
  private _maxVertexUniformVectors;
17
- private _rootBone;
18
- private _jointMatrices;
19
17
  private _jointTexture;
20
- private _bones;
18
+ private _skin;
19
+ /**
20
+ * Skin of the SkinnedMeshRenderer.
21
+ */
22
+ get skin(): Skin;
23
+ set skin(value: Skin);
21
24
  /**
22
25
  * The weights of the BlendShapes.
23
26
  * @remarks Array index is BlendShape index.
@@ -29,31 +32,19 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
29
32
  */
30
33
  get localBounds(): BoundingBox;
31
34
  set localBounds(value: BoundingBox);
35
+ _updateShaderData(context: RenderContext, onlyMVP: boolean): void;
36
+ private _checkBlendShapeWeightLength;
37
+ private _onLocalBoundsChanged;
38
+ private _onSkinUpdated;
39
+ private _applySkin;
32
40
  /**
33
- * Root bone.
41
+ * @deprecated use {@link SkinnedMeshRenderer.skin.rootBone} instead.
34
42
  */
35
43
  get rootBone(): Entity;
36
44
  set rootBone(value: Entity);
37
45
  /**
38
- * Bones of the SkinnedMeshRenderer.
46
+ * @deprecated use {@link SkinnedMeshRenderer.skin.bones} instead.
39
47
  */
40
- get bones(): ReadonlyArray<Entity>;
41
- set bones(value: ReadonlyArray<Entity>);
42
- _updateShaderData(context: RenderContext, onlyMVP: boolean): void;
43
- private _checkBlendShapeWeightLength;
44
- private _onLocalBoundsChanged;
45
- private _getEntityHierarchyPath;
46
- private _skin;
47
- /**
48
- * @deprecated
49
- * Skin Object.
50
- *
51
- * If you want get `skeleton`, use {@link SkinnedMeshRenderer.rootBone} instead.
52
- * If you want get `bones`, use {@link SkinnedMeshRenderer.bones} instead.
53
- * `inverseBindMatrices` will migrate to mesh in the future.
54
- *
55
- * @remarks `rootBone` and `bones` will not update when `skin` changed.
56
- */
57
- get skin(): Skin;
58
- set skin(value: Skin);
48
+ get bones(): Readonly<Entity[]>;
49
+ set bones(value: Readonly<Entity[]>);
59
50
  }