@galacean/engine-core 0.0.0-experimental-stateMachine.0 → 0.0.0-experimental-1.3-xr.1

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 (102) hide show
  1. package/dist/main.js +18449 -16078
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +18449 -16078
  4. package/dist/module.js +18445 -16079
  5. package/dist/module.js.map +1 -1
  6. package/package.json +7 -7
  7. package/types/2d/assembler/ISpriteAssembler.d.ts +1 -0
  8. package/types/2d/sprite/SpriteMask.d.ts +11 -0
  9. package/types/2d/sprite/SpriteRenderer.d.ts +6 -3
  10. package/types/2d/text/CharRenderInfo.d.ts +1 -0
  11. package/types/2d/text/TextRenderer.d.ts +10 -4
  12. package/types/Camera.d.ts +18 -7
  13. package/types/DisorderedArray.d.ts +2 -2
  14. package/types/Engine.d.ts +3 -0
  15. package/types/Entity.d.ts +1 -1
  16. package/types/RenderPipeline/BasicRenderPipeline.d.ts +11 -5
  17. package/types/RenderPipeline/BatchUtils.d.ts +1 -0
  18. package/types/RenderPipeline/BatcherManager.d.ts +1 -0
  19. package/types/RenderPipeline/DynamicGeometryData.d.ts +1 -0
  20. package/types/RenderPipeline/DynamicGeometryDataManager.d.ts +1 -0
  21. package/types/RenderPipeline/MaskManager.d.ts +1 -0
  22. package/types/RenderPipeline/PipelinePass.d.ts +1 -1
  23. package/types/RenderPipeline/PrimitiveChunk.d.ts +1 -0
  24. package/types/RenderPipeline/PrimitiveChunkManager.d.ts +1 -0
  25. package/types/RenderPipeline/RenderData2D.d.ts +14 -0
  26. package/types/RenderPipeline/RenderElement.d.ts +9 -6
  27. package/types/RenderPipeline/RenderPass.d.ts +55 -0
  28. package/types/RenderPipeline/RenderQueue.d.ts +1 -30
  29. package/types/RenderPipeline/SubPrimitiveChunk.d.ts +1 -0
  30. package/types/RenderPipeline/SubRenderElement.d.ts +22 -0
  31. package/types/RenderPipeline/VertexArea.d.ts +1 -0
  32. package/types/RenderPipeline/enums/ForceUploadShaderDataFlag.d.ts +15 -0
  33. package/types/RenderPipeline/enums/RenderDataUsage.d.ts +13 -0
  34. package/types/RenderPipeline/index.d.ts +1 -1
  35. package/types/Renderer.d.ts +4 -3
  36. package/types/Scene.d.ts +6 -0
  37. package/types/animation/Animator.d.ts +17 -17
  38. package/types/animation/AnimatorCondition.d.ts +3 -3
  39. package/types/animation/AnimatorController.d.ts +14 -3
  40. package/types/animation/AnimatorControllerParameter.d.ts +2 -2
  41. package/types/animation/AnimatorState.d.ts +6 -9
  42. package/types/animation/AnimatorStateMachine.d.ts +6 -1
  43. package/types/animation/AnimatorStateTransition.d.ts +51 -0
  44. package/types/animation/AnimatorTransition.d.ts +0 -33
  45. package/types/animation/enums/AnimatorConditionMode.d.ts +9 -0
  46. package/types/animation/index.d.ts +1 -1
  47. package/types/asset/AssetType.d.ts +2 -0
  48. package/types/clone/ComponentCloner.d.ts +1 -1
  49. package/types/enums/ReplacementFailureStrategy.d.ts +9 -0
  50. package/types/graphic/SubMesh.d.ts +3 -16
  51. package/types/graphic/SubPrimitive.d.ts +10 -0
  52. package/types/graphic/index.d.ts +1 -0
  53. package/types/index.d.ts +4 -1
  54. package/types/input/pointer/PointerEvent.d.ts +4 -0
  55. package/types/input/pointer/PointerEventType.d.ts +7 -0
  56. package/types/material/BaseMaterial.d.ts +1 -1
  57. package/types/mesh/Skin.d.ts +25 -9
  58. package/types/mesh/SkinnedMeshRenderer.d.ts +15 -24
  59. package/types/particle/ParticleGenerator.d.ts +20 -0
  60. package/types/particle/ParticleRenderer.d.ts +3 -1
  61. package/types/particle/modules/EmissionModule.d.ts +6 -2
  62. package/types/particle/modules/MainModule.d.ts +49 -15
  63. package/types/particle/modules/ParticleCompositeCurve.d.ts +35 -10
  64. package/types/particle/modules/ParticleCurve.d.ts +16 -9
  65. package/types/particle/modules/ParticleGeneratorModule.d.ts +6 -2
  66. package/types/particle/modules/SizeOverLifetimeModule.d.ts +27 -8
  67. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +29 -8
  68. package/types/particle/modules/shape/BaseShape.d.ts +14 -4
  69. package/types/particle/modules/shape/BoxShape.d.ts +7 -2
  70. package/types/particle/modules/shape/CircleShape.d.ts +25 -8
  71. package/types/particle/modules/shape/ConeShape.d.ts +24 -8
  72. package/types/particle/modules/shape/HemisphereShape.d.ts +6 -2
  73. package/types/particle/modules/shape/SphereShape.d.ts +6 -2
  74. package/types/postProcess/PostProcessManager.d.ts +1 -0
  75. package/types/postProcess/effects/BloomEffect.d.ts +94 -0
  76. package/types/postProcess/effects/TonemappingEffect.d.ts +35 -0
  77. package/types/postProcess/effects/index.d.ts +2 -0
  78. package/types/postProcess/index.d.ts +3 -0
  79. package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +6 -0
  80. package/types/shader/ShaderPass.d.ts +10 -0
  81. package/types/shader/enums/ShaderDataGroup.d.ts +4 -2
  82. package/types/shader/enums/ShaderPlatformTarget.d.ts +4 -0
  83. package/types/shader/enums/ShaderType.d.ts +1 -0
  84. package/types/shader/index.d.ts +1 -0
  85. package/types/shader/state/RenderState.d.ts +1 -0
  86. package/types/shaderlib/ShaderFactory.d.ts +2 -1
  87. package/types/texture/enums/TextureFormat.d.ts +2 -0
  88. package/types/ui/Image.d.ts +38 -0
  89. package/types/ui/RedBlackTree.d.ts +2 -0
  90. package/types/ui/UICanvas.d.ts +55 -0
  91. package/types/ui/UIRenderer.d.ts +14 -0
  92. package/types/ui/UITransform.d.ts +20 -0
  93. package/types/ui/enums/BlockingObjects.d.ts +6 -0
  94. package/types/ui/enums/CanvasRenderMode.d.ts +8 -0
  95. package/types/ui/enums/ResolutionAdaptationStrategy.d.ts +10 -0
  96. package/types/ui/index.d.ts +6 -0
  97. package/types/utils/ClearableObjectPool.d.ts +16 -0
  98. package/types/utils/ObjectPool.d.ts +16 -0
  99. package/types/utils/Pool.d.ts +12 -0
  100. package/types/utils/ReturnableObjectPool.d.ts +16 -0
  101. package/types/utils/index.d.ts +3 -0
  102. package/LICENSE +0 -21
@@ -1,4 +1,4 @@
1
- import { AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
1
+ import { AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
2
2
  import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
3
3
  /**
4
4
  * Condition that is used to determine if a transition must be taken.
@@ -7,7 +7,7 @@ export declare class AnimatorCondition {
7
7
  /** The mode of the condition. */
8
8
  mode: AnimatorConditionMode;
9
9
  /** The name of the parameter used in the condition. */
10
- parameter: string;
10
+ parameterName: string;
11
11
  /** The AnimatorParameter's threshold value for the condition to be true. */
12
- threshold: AnimatorControllerParameterValue;
12
+ threshold?: AnimatorControllerParameterValueType;
13
13
  }
@@ -1,4 +1,4 @@
1
- import { AnimatorControllerParameter, AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
1
+ import { AnimatorControllerParameter, AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
2
2
  import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
3
3
  /**
4
4
  * Store the data for Animator playback.
@@ -16,9 +16,9 @@ export declare class AnimatorController {
16
16
  /**
17
17
  * Add a parameter to the controller.
18
18
  * @param name - The name of the parameter
19
- * @param defaultValue - The defaultValue of the parameter
19
+ * @param value - The value of the parameter
20
20
  */
21
- addParameter(name: string, defaultValue?: AnimatorControllerParameterValue): AnimatorControllerParameter;
21
+ addParameter(name: string, value?: AnimatorControllerParameterValueType): AnimatorControllerParameter;
22
22
  /**
23
23
  * Add a parameter to the controller.
24
24
  * @param parameter - The parameter
@@ -29,6 +29,17 @@ export declare class AnimatorController {
29
29
  * @param parameter - The parameter
30
30
  */
31
31
  removeParameter(parameter: AnimatorControllerParameter): void;
32
+ /**
33
+ * Get the parameter by name.
34
+ * @param name - The name of the parameter
35
+ */
36
+ getParameter(name: string): AnimatorControllerParameter;
37
+ /**
38
+ * Set the value of the given parameter.
39
+ * @param name - The name of the parameter
40
+ * @param value - The value of the parameter
41
+ */
42
+ setParameterValue(name: string, value: AnimatorControllerParameterValueType): void;
32
43
  /**
33
44
  * Get the layer by name.
34
45
  * @param name - The layer's name.
@@ -1,4 +1,4 @@
1
- export type AnimatorControllerParameterValue = number | string | boolean;
1
+ export type AnimatorControllerParameterValueType = number | string | boolean;
2
2
  /**
3
3
  * Used to communicate between scripting and the controller, parameters can be set in scripting and used by the controller.
4
4
  */
@@ -6,5 +6,5 @@ export declare class AnimatorControllerParameter {
6
6
  /** The name of the parameter. */
7
7
  name: string;
8
8
  /** The value of the parameter. */
9
- value: AnimatorControllerParameterValue;
9
+ value: AnimatorControllerParameterValueType;
10
10
  }
@@ -1,5 +1,5 @@
1
1
  import { AnimationClip } from "./AnimationClip";
2
- import { AnimatorStateTransition } from "./AnimatorTransition";
2
+ import { AnimatorStateTransition } from "./AnimatorStateTransition";
3
3
  import { WrapMode } from "./enums/WrapMode";
4
4
  import { StateMachineScript } from "./StateMachineScript";
5
5
  /**
@@ -24,14 +24,6 @@ export declare class AnimatorState {
24
24
  */
25
25
  get clip(): AnimationClip;
26
26
  set clip(clip: AnimationClip);
27
- /**
28
- * The start time of this state's clip
29
- */
30
- get startTime(): number;
31
- /**
32
- * The end time of this state's clip
33
- */
34
- get endTime(): number;
35
27
  /**
36
28
  * The normalized start time of the clip, the range is 0 to 1, default is 0.
37
29
  */
@@ -56,6 +48,11 @@ export declare class AnimatorState {
56
48
  * @param animatorState - The destination state
57
49
  */
58
50
  addTransition(animatorState: AnimatorState): AnimatorStateTransition;
51
+ /**
52
+ * Add an outgoing transition to exit of the stateMachine.
53
+ * @param exitTime - The time at which the transition can take effect. This is represented in normalized time.
54
+ */
55
+ addExitTransition(exitTime?: number): AnimatorStateTransition;
59
56
  /**
60
57
  * Remove a transition from the state.
61
58
  * @param transition - The transition
@@ -1,5 +1,5 @@
1
1
  import { AnimatorState } from "./AnimatorState";
2
- import { AnimatorStateTransition } from "./AnimatorTransition";
2
+ import { AnimatorStateTransition } from "./AnimatorStateTransition";
3
3
  export interface AnimatorStateMap {
4
4
  [key: string]: AnimatorState;
5
5
  }
@@ -14,6 +14,9 @@ export declare class AnimatorStateMachine {
14
14
  * @remarks When the Animator's AnimatorController changed or the Animator's onEnable be triggered.
15
15
  */
16
16
  defaultState: AnimatorState;
17
+ private _entryTransitions;
18
+ private _anyStateTransitions;
19
+ private _statesMap;
17
20
  /**
18
21
  * The list of entry transitions in the state machine.
19
22
  */
@@ -73,4 +76,6 @@ export declare class AnimatorStateMachine {
73
76
  * @param transition - The transition
74
77
  */
75
78
  removeAnyStateTransition(transition: AnimatorStateTransition): void;
79
+ private _addTransition;
80
+ private _removeTransition;
76
81
  }
@@ -0,0 +1,51 @@
1
+ import { AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
2
+ import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
3
+ import { AnimatorCondition } from "./AnimatorCondition";
4
+ import { AnimatorState } from "./AnimatorState";
5
+ /**
6
+ * Transitions define when and how the state machine switch from on state to another. AnimatorTransition always originate from a StateMachine or a StateMachine entry.
7
+ */
8
+ export declare class AnimatorStateTransition {
9
+ /** The duration of the transition. This is represented in normalized time. */
10
+ duration: number;
11
+ /** The time at which the destination state will start. This is represented in normalized time. */
12
+ offset: number;
13
+ /** ExitTime represents the exact time at which the transition can take effect. This is represented in normalized time. */
14
+ exitTime: number;
15
+ /** The destination state of the transition. */
16
+ destinationState: AnimatorState;
17
+ /** Mutes the transition. The transition will never occur. */
18
+ mute: boolean;
19
+ private _conditions;
20
+ private _solo;
21
+ /**
22
+ * Is the transition destination the exit of the current state machine.
23
+ */
24
+ get isExit(): Readonly<boolean>;
25
+ /**
26
+ * Mutes all other transitions in the source state.
27
+ */
28
+ get solo(): boolean;
29
+ set solo(value: boolean);
30
+ /**
31
+ * The conditions in the transition.
32
+ */
33
+ get conditions(): Readonly<AnimatorCondition[]>;
34
+ /**
35
+ * Add a condition to a transition.
36
+ * @param mode - The AnimatorCondition mode of the condition
37
+ * @param parameterName - The name of the parameter
38
+ * @param threshold - The threshold value of the condition
39
+ */
40
+ addCondition(mode: AnimatorConditionMode, parameterName: string, threshold?: AnimatorControllerParameterValueType): AnimatorCondition;
41
+ /**
42
+ * Add a condition to a transition.
43
+ * @param animatorCondition - The condition to add
44
+ */
45
+ addCondition(animatorCondition: AnimatorCondition): AnimatorCondition;
46
+ /**
47
+ * Remove a condition from the transition.
48
+ * @param condition - The condition to remove
49
+ */
50
+ removeCondition(condition: AnimatorCondition): void;
51
+ }
@@ -1,6 +1,3 @@
1
- import { AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
2
- import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
3
- import { AnimatorCondition } from "./AnimatorCondition";
4
1
  import { AnimatorState } from "./AnimatorState";
5
2
  /**
6
3
  * Transitions define when and how the state machine switch from on state to another. AnimatorTransition always originate from a StateMachine or a StateMachine entry.
@@ -14,34 +11,4 @@ export declare class AnimatorStateTransition {
14
11
  exitTime: number;
15
12
  /** The destination state of the transition. */
16
13
  destinationState: AnimatorState;
17
- /** Mutes the transition. The transition will never occur. */
18
- mute: boolean;
19
- /** Is the transition destination the exit of the current state machine. */
20
- isExit: boolean;
21
- private _conditions;
22
- private _solo;
23
- /** Mutes all other transitions in the source state. */
24
- get solo(): boolean;
25
- set solo(value: boolean);
26
- /**
27
- * The conditions in the transition.
28
- */
29
- get conditions(): Readonly<AnimatorCondition[]>;
30
- /**
31
- * Add a condition to a transition.
32
- * @param mode - The AnimatorCondition mode of the condition
33
- * @param parameter - The name of the parameter
34
- * @param threshold - The threshold value of the condition
35
- */
36
- addCondition(mode: AnimatorConditionMode, parameter: string, threshold?: AnimatorControllerParameterValue): AnimatorCondition;
37
- /**
38
- * Add a condition to a transition.
39
- * @param animatorCondition - The condition to add
40
- */
41
- addCondition(animatorCondition: AnimatorCondition): AnimatorCondition;
42
- /**
43
- * Remove a condition from the transition.
44
- * @param condition - The condition to remove
45
- */
46
- removeCondition(condition: AnimatorCondition): void;
47
14
  }
@@ -1,8 +1,17 @@
1
+ /**
2
+ * The mode of the animator condition.
3
+ */
1
4
  export declare enum AnimatorConditionMode {
5
+ /** The condition is true when the parameter value is true. */
2
6
  If = 0,
7
+ /** The condition is true when the parameter value is false. */
3
8
  IfNot = 1,
9
+ /** The condition is true when the parameter value is greater than the threshold. */
4
10
  Greater = 2,
11
+ /** The condition is true when the parameter value is less than the threshold. */
5
12
  Less = 3,
13
+ /** The condition is true when the parameter value is equal to the threshold. */
6
14
  Equals = 4,
15
+ /** The condition is true when the parameter value is not equal to the threshold. */
7
16
  NotEquals = 5
8
17
  }
@@ -11,7 +11,7 @@ export { AnimatorController } from "./AnimatorController";
11
11
  export { AnimatorControllerLayer } from "./AnimatorControllerLayer";
12
12
  export { AnimatorState } from "./AnimatorState";
13
13
  export { AnimatorStateMachine } from "./AnimatorStateMachine";
14
- export { AnimatorStateTransition } from "./AnimatorTransition";
14
+ export { AnimatorStateTransition } from "./AnimatorStateTransition";
15
15
  export { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
16
16
  export { AnimatorLayerBlendingMode } from "./enums/AnimatorLayerBlendingMode";
17
17
  export { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
@@ -30,6 +30,8 @@ export declare enum AssetType {
30
30
  /** AnimatorController. */
31
31
  AnimatorController = "AnimatorController",
32
32
  /** Prefab.*/
33
+ Prefab = "Prefab",
34
+ /** GLTF.*/
33
35
  GLTF = "GLTF",
34
36
  /** Compress Texture. */
35
37
  KTX = "KTX",
@@ -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
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The strategy to use when a shader replacement fails.
3
+ */
4
+ export declare enum ReplacementFailureStrategy {
5
+ /** Keep the original shader. */
6
+ KeepOriginalShader = 0,
7
+ /** Do not render. */
8
+ DoNotRender = 1
9
+ }
@@ -1,21 +1,8 @@
1
- import { IPoolElement } from "../RenderPipeline/IPoolElement";
2
- import { MeshTopology } from "./enums/MeshTopology";
1
+ import { IPoolElement } from "../utils/ObjectPool";
2
+ import { SubPrimitive } from "./SubPrimitive";
3
3
  /**
4
4
  * Sub-mesh, mainly contains drawing information.
5
5
  */
6
- export declare class SubMesh implements IPoolElement {
7
- /** Start drawing offset. */
8
- start: number;
9
- /** Drawing count. */
10
- count: number;
11
- /** Drawing topology. */
12
- topology: MeshTopology;
13
- /**
14
- * Create a sub-mesh.
15
- * @param start - Start drawing offset
16
- * @param count - Drawing count
17
- * @param topology - Drawing topology
18
- */
19
- constructor(start?: number, count?: number, topology?: MeshTopology);
6
+ export declare class SubMesh extends SubPrimitive implements IPoolElement {
20
7
  dispose?(): void;
21
8
  }
@@ -1,4 +1,7 @@
1
1
  import { MeshTopology } from "./enums/MeshTopology";
2
+ /**
3
+ * Sub-primitive, mainly contains drawing information.
4
+ */
2
5
  export declare class SubPrimitive {
3
6
  /** Start drawing offset. */
4
7
  start: number;
@@ -6,4 +9,11 @@ export declare class SubPrimitive {
6
9
  count: number;
7
10
  /** Drawing topology. */
8
11
  topology: MeshTopology;
12
+ /**
13
+ * Create a sub-primitive.
14
+ * @param start - Start drawing offset
15
+ * @param count - Drawing count
16
+ * @param topology - Drawing topology
17
+ */
18
+ constructor(start?: number, count?: number, topology?: MeshTopology);
9
19
  }
@@ -12,3 +12,4 @@ export { SubMesh } from "./SubMesh";
12
12
  export { VertexBufferBinding } from "./VertexBufferBinding";
13
13
  export { VertexElement } from "./VertexElement";
14
14
  export { Primitive } from "./Primitive";
15
+ export { SubPrimitive } from "./SubPrimitive";
package/types/index.d.ts CHANGED
@@ -19,6 +19,7 @@ export { Loader } from "./asset/Loader";
19
19
  export { ContentRestorer } from "./asset/ContentRestorer";
20
20
  export { ResourceManager, resourceLoader } from "./asset/ResourceManager";
21
21
  export { AssetPromise } from "./asset/AssetPromise";
22
+ export type { IReferable } from "./asset/IReferable";
22
23
  export type { LoadItem } from "./asset/LoadItem";
23
24
  export { AssetType } from "./asset/AssetType";
24
25
  export { ReferResource } from "./asset/ReferResource";
@@ -31,10 +32,12 @@ export { FogMode } from "./enums/FogMode";
31
32
  export { CameraClearFlags } from "./enums/CameraClearFlags";
32
33
  export { CameraType } from "./enums/CameraType";
33
34
  export { MSAASamples } from "./enums/MSAASamples";
35
+ export { ReplacementFailureStrategy } from "./enums/ReplacementFailureStrategy";
34
36
  export { Downsampling } from "./enums/Downsampling";
35
37
  export { ColorSpace } from "./enums/ColorSpace";
36
38
  export { BackgroundTextureFillMode } from "./enums/BackgroundTextureFillMode";
37
39
  export { XRManager } from "./xr/XRManager";
40
+ export * from "./utils/index";
38
41
  export * from "./input/index";
39
42
  export * from "./lighting/index";
40
43
  export * from "./shadow/index";
@@ -55,5 +58,5 @@ export * from "./clone/CloneManager";
55
58
  export * from "./renderingHardwareInterface/index";
56
59
  export * from "./physics/index";
57
60
  export * from "./Utils";
58
- export { Basic2DBatcher } from "./RenderPipeline/Basic2DBatcher";
59
61
  export { ShaderMacroCollection } from "./shader/ShaderMacroCollection";
62
+ export * from "./postProcess";
@@ -0,0 +1,4 @@
1
+ import { Pointer } from "./Pointer";
2
+ export declare class PointerEvent {
3
+ pointer: Pointer;
4
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum PointerEventType {
2
+ Down = 0,
3
+ Up = 1,
4
+ Click = 2,
5
+ Enter = 3,
6
+ Exit = 4
7
+ }
@@ -27,7 +27,7 @@ export declare class BaseMaterial extends Material {
27
27
  get shader(): Shader;
28
28
  set shader(value: Shader);
29
29
  /**
30
- * Whethor transparent of first shader pass render state.
30
+ * Whether transparent of first shader pass render state.
31
31
  */
32
32
  get isTransparent(): boolean;
33
33
  set isTransparent(value: boolean);
@@ -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
+ protected _updateRendererShaderData(context: RenderContext): 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
  }
@@ -10,7 +10,16 @@ import { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule
10
10
  * Particle Generator.
11
11
  */
12
12
  export declare class ParticleGenerator {
13
+ private static _tempVector20;
14
+ private static _tempVector21;
15
+ private static _tempVector22;
16
+ private static _tempVector30;
17
+ private static _tempVector31;
18
+ private static _tempMat;
19
+ private static _tempColor0;
20
+ private static _tempParticleRenderers;
13
21
  private static readonly _particleIncreaseCount;
22
+ private static readonly _transformedBoundsIncreaseCount;
14
23
  /** Use auto random seed. */
15
24
  useAutoRandomSeed: boolean;
16
25
  /** Main module. */
@@ -33,6 +42,10 @@ export declare class ParticleGenerator {
33
42
  private _instanceVertexBufferBinding;
34
43
  private _instanceVertices;
35
44
  private _randomSeed;
45
+ private _transformedBoundsArray;
46
+ private _transformedBoundsCount;
47
+ private _firstActiveTransformedBoundingBox;
48
+ private _firstFreeTransformedBoundingBox;
36
49
  /**
37
50
  * Whether the particle generator is contain alive or is still creating particles.
38
51
  */
@@ -67,4 +80,11 @@ export declare class ParticleGenerator {
67
80
  private _freeRetiredParticles;
68
81
  private _addActiveParticlesToVertexBuffer;
69
82
  private _addVertexBufferBindingsFilterDuplicate;
83
+ private _resizeTransformedBoundsArray;
84
+ private _retireTransformedBounds;
85
+ private _calculateGeneratorBounds;
86
+ private _mergeTransformedBounds;
87
+ private _calculateTransformedBounds;
88
+ private _addGravityToBounds;
89
+ private _getExtremeValueFromZero;
70
90
  }
@@ -1,4 +1,4 @@
1
- import { Vector3 } from "@galacean/engine-math";
1
+ import { BoundingBox, Vector3 } from "@galacean/engine-math";
2
2
  import { RenderContext } from "../RenderPipeline/RenderContext";
3
3
  import { Renderer } from "../Renderer";
4
4
  import { ModelMesh } from "../mesh/ModelMesh";
@@ -40,6 +40,8 @@ export declare class ParticleRenderer extends Renderer {
40
40
  */
41
41
  get mesh(): ModelMesh;
42
42
  set mesh(value: ModelMesh);
43
+ protected _updateBounds(worldBounds: BoundingBox): void;
44
+ protected _updateRendererShaderData(context: RenderContext): void;
43
45
  protected _render(context: RenderContext): void;
44
46
  protected _onDestroy(): void;
45
47
  }
@@ -10,11 +10,15 @@ export declare class EmissionModule extends ParticleGeneratorModule {
10
10
  rateOverTime: ParticleCompositeCurve;
11
11
  /** The rate at which the emitter spawns new particles over distance. */
12
12
  rateOverDistance: ParticleCompositeCurve;
13
- /** The shape of the emitter. */
14
- shape: BaseShape;
13
+ _shape: BaseShape;
15
14
  private _bursts;
16
15
  private _currentBurstIndex;
17
16
  private _burstRand;
17
+ /**
18
+ * The shape of the emitter.
19
+ */
20
+ get shape(): BaseShape;
21
+ set shape(value: BaseShape);
18
22
  /**
19
23
  * Gets the burst array.
20
24
  */
@@ -21,18 +21,6 @@ export declare class MainModule implements ICustomClone {
21
21
  isLoop: boolean;
22
22
  /** Start delay in seconds. */
23
23
  startDelay: ParticleCompositeCurve;
24
- /** The initial lifetime of particles when emitted. */
25
- startLifetime: ParticleCompositeCurve;
26
- /** The initial speed of particles when the Particle Generator first spawns them. */
27
- startSpeed: ParticleCompositeCurve;
28
- /** A flag to enable specifying particle size individually for each axis. */
29
- startSize3D: boolean;
30
- /** The initial size of particles along the x-axis when the Particle Generator first spawns them. */
31
- startSizeX: ParticleCompositeCurve;
32
- /** The initial size of particles along the y-axis when the Particle Generator first spawns them. */
33
- startSizeY: ParticleCompositeCurve;
34
- /** The initial size of particles along the z-axis when the Particle Generator first spawns them. */
35
- startSizeZ: ParticleCompositeCurve;
36
24
  /** A flag to enable 3D particle rotation, when disabled, only `startRotationZ` is used. */
37
25
  startRotation3D: boolean;
38
26
  /** The initial rotation of particles around the x-axis when emitted.*/
@@ -46,9 +34,6 @@ export declare class MainModule implements ICustomClone {
46
34
  /** The mode of start color */
47
35
  startColor: ParticleCompositeGradient;
48
36
  /** A scale that this Particle Generator applies to gravity, defined by Physics.gravity. */
49
- gravityModifier: ParticleCompositeCurve;
50
- /** This selects the space in which to simulate particles. It can be either world or local space. */
51
- simulationSpace: ParticleSimulationSpace;
52
37
  /** Override the default playback speed of the Particle Generator. */
53
38
  simulationSpeed: number;
54
39
  /** Control how the Particle Generator applies its Transform component to the particles it emits. */
@@ -56,8 +41,56 @@ export declare class MainModule implements ICustomClone {
56
41
  /** If set to true, the Particle Generator automatically begins to play on startup. */
57
42
  playOnEnabled: boolean;
58
43
  readonly _gravityModifierRand: Rand;
44
+ private _startLifetime;
45
+ private _startSpeed;
46
+ private _startSize3D;
47
+ private _startSizeX;
48
+ private _startSizeY;
49
+ private _startSizeZ;
50
+ private _gravityModifier;
51
+ private _simulationSpace;
59
52
  private _generator;
60
53
  private _gravity;
54
+ /**
55
+ * The initial lifetime of particles when emitted.
56
+ */
57
+ get startLifetime(): ParticleCompositeCurve;
58
+ set startLifetime(value: ParticleCompositeCurve);
59
+ /**
60
+ * The initial speed of particles when the Particle Generator first spawns them.
61
+ */
62
+ get startSpeed(): ParticleCompositeCurve;
63
+ set startSpeed(value: ParticleCompositeCurve);
64
+ /**
65
+ * A flag to enable specifying particle size individually for each axis.
66
+ */
67
+ get startSize3D(): boolean;
68
+ set startSize3D(value: boolean);
69
+ /**
70
+ * The initial size of particles along the x-axis when the Particle Generator first spawns them.
71
+ */
72
+ get startSizeX(): ParticleCompositeCurve;
73
+ set startSizeX(value: ParticleCompositeCurve);
74
+ /**
75
+ * The initial size of particles along the y-axis when the Particle Generator first spawns them.
76
+ */
77
+ get startSizeY(): ParticleCompositeCurve;
78
+ set startSizeY(value: ParticleCompositeCurve);
79
+ /**
80
+ * The initial size of particles along the z-axis when the Particle Generator first spawns them.
81
+ */
82
+ get startSizeZ(): ParticleCompositeCurve;
83
+ set startSizeZ(value: ParticleCompositeCurve);
84
+ /**
85
+ * A scale that this Particle Generator applies to gravity, defined by Physics.gravity.
86
+ */
87
+ get gravityModifier(): ParticleCompositeCurve;
88
+ set gravityModifier(value: ParticleCompositeCurve);
89
+ /**
90
+ * This selects the space in which to simulate particles. It can be either world or local space.
91
+ */
92
+ get simulationSpace(): ParticleSimulationSpace;
93
+ set simulationSpace(value: ParticleSimulationSpace);
61
94
  /**
62
95
  * Max particles count.
63
96
  */
@@ -68,4 +101,5 @@ export declare class MainModule implements ICustomClone {
68
101
  */
69
102
  get startSize(): ParticleCompositeCurve;
70
103
  set startSize(value: ParticleCompositeCurve);
104
+ private _onCompositeCurveChange;
71
105
  }