@galacean/engine-core 2.0.0-alpha.37 → 2.0.0-alpha.38

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": "2.0.0-alpha.37",
3
+ "version": "2.0.0-alpha.38",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -18,10 +18,10 @@
18
18
  "types/**/*"
19
19
  ],
20
20
  "dependencies": {
21
- "@galacean/engine-math": "2.0.0-alpha.37"
21
+ "@galacean/engine-math": "2.0.0-alpha.38"
22
22
  },
23
23
  "devDependencies": {
24
- "@galacean/engine-design": "2.0.0-alpha.37"
24
+ "@galacean/engine-design": "2.0.0-alpha.38"
25
25
  },
26
26
  "scripts": {
27
27
  "b:types": "tsc"
package/types/Engine.d.ts CHANGED
@@ -35,6 +35,7 @@ export declare class Engine extends EventDispatcher {
35
35
  private _waitingGC;
36
36
  private _postProcessPasses;
37
37
  private _activePostProcessPasses;
38
+ private _onCanvasResize;
38
39
  private _animate;
39
40
  /**
40
41
  * Settings of Engine.
package/types/Entity.d.ts CHANGED
@@ -84,9 +84,10 @@ export declare class Entity extends EngineObject {
84
84
  getComponents<T extends Component>(type: ComponentConstructor<T>, results: T[]): T[];
85
85
  /**
86
86
  * Get the components which match the type of the entity and it's children.
87
+ * @remarks The components are returned in depth-first pre-order: the entity itself first, then each child's subtree in sibling order.
87
88
  * @param type - The component type
88
89
  * @param results - The components collection
89
- * @returns The components collection which match the type
90
+ * @returns The components collection which match the type
90
91
  */
91
92
  getComponentsIncludeChildren<T extends Component>(type: ComponentConstructor<T>, results: T[]): T[];
92
93
  /**
package/types/Signal.d.ts CHANGED
@@ -13,9 +13,11 @@ export declare class Signal<T extends any[] = []> {
13
13
  on(fn: (...args: T) => void, target?: any): void;
14
14
  /**
15
15
  * Add a structured binding listener. Structured bindings support clone remapping.
16
+ * The target method will be invoked as `method(...signalArgs, ...args)` —
17
+ * runtime signal arguments come first, bound arguments are appended.
16
18
  * @param target - The target component
17
19
  * @param methodName - The method name to invoke on the target
18
- * @param args - Pre-resolved arguments
20
+ * @param args - Pre-resolved arguments appended after the runtime signal arguments
19
21
  */
20
22
  on(target: Component, methodName: string, ...args: any[]): void;
21
23
  /**
@@ -26,9 +28,11 @@ export declare class Signal<T extends any[] = []> {
26
28
  once(fn: (...args: T) => void, target?: any): void;
27
29
  /**
28
30
  * Add a one-time structured binding listener.
31
+ * The target method will be invoked as `method(...signalArgs, ...args)` —
32
+ * runtime signal arguments come first, bound arguments are appended.
29
33
  * @param target - The target component
30
34
  * @param methodName - The method name to invoke on the target
31
- * @param args - Pre-resolved arguments
35
+ * @param args - Pre-resolved arguments appended after the runtime signal arguments
32
36
  */
33
37
  once(target: Component, methodName: string, ...args: any[]): void;
34
38
  /**
@@ -1,6 +1,6 @@
1
1
  import { EngineObject } from "../base/EngineObject";
2
2
  import { Component } from "../Component";
3
- import { ComponentConstructor } from "../Entity";
3
+ import { ComponentConstructor, Entity } from "../Entity";
4
4
  import { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
5
5
  import { AnimationCurve } from "./animationCurve/AnimationCurve";
6
6
  import { AnimationEvent } from "./AnimationEvent";
@@ -84,4 +84,10 @@ export declare class AnimationClip extends EngineObject {
84
84
  * Clears all curve bindings from the clip.
85
85
  */
86
86
  clearCurveBindings(): void;
87
+ /**
88
+ * Samples an animation at a given time.
89
+ * @param entity - The animated entity
90
+ * @param time - The time to sample an animation
91
+ */
92
+ sampleAnimation(entity: Entity, time: number): void;
87
93
  }
@@ -15,6 +15,8 @@ export declare class Animator extends Component {
15
15
  cullingMode: AnimatorCullingMode;
16
16
  /** The playback speed of the Animator, 1.0 is normal playback speed. */
17
17
  speed: number;
18
+ /** Whether the Animator sends AnimationEvent callbacks. */
19
+ fireEvents: boolean;
18
20
  protected _animatorController: AnimatorController;
19
21
  protected _controllerUpdateFlag: BoolUpdateFlag;
20
22
  protected _updateMark: number;
@@ -7,6 +7,7 @@ import { Engine } from "../Engine";
7
7
  */
8
8
  export declare class AnimatorController extends ReferResource {
9
9
  private _updateFlagManager;
10
+ private _onStatesInvalidate;
10
11
  /**
11
12
  * The layers in the controller.
12
13
  */
@@ -10,10 +10,16 @@ export declare class AnimatorControllerLayer {
10
10
  weight: number;
11
11
  /** The blending mode used by the layer. It is not taken into account for the first layer. */
12
12
  blendingMode: AnimatorLayerBlendingMode;
13
- /** The state machine for the layer. */
14
- stateMachine: AnimatorStateMachine;
15
13
  /** The AnimatorLayerMask is used to mask out certain entities from being animated by an AnimatorLayer. */
16
14
  mask: AnimatorLayerMask;
15
+ private _stateMachine;
16
+ private _engine;
17
+ private _onStatesInvalidate;
18
+ /**
19
+ * The state machine for the layer.
20
+ */
21
+ get stateMachine(): AnimatorStateMachine;
22
+ set stateMachine(value: AnimatorStateMachine);
17
23
  /**
18
24
  * @param name - The layer's name
19
25
  */
@@ -10,6 +10,7 @@ export declare class AnimatorStateMachine {
10
10
  /** The list of states. */
11
11
  readonly states: AnimatorState[];
12
12
  private _engine;
13
+ private _onStatesInvalidate;
13
14
  /**
14
15
  * The state will be played automatically.
15
16
  * @remarks When the Animator's AnimatorController changed or the Animator's onEnable be triggered. Cleared to `null` if the state is removed via `removeState`.
@@ -100,7 +100,7 @@ export declare class ResourceManager {
100
100
  * @param restorer - The restorer
101
101
  */
102
102
  addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
103
- private _assignDefaultOptions;
103
+ private _resolveLoadItemOptions;
104
104
  private _loadSingleItem;
105
105
  private _loadSubpackageAndMainAsset;
106
106
  private _loadMainAsset;
@@ -6,6 +6,8 @@ export declare class AudioManager {
6
6
  private static _gainNode;
7
7
  private static _resumePromise;
8
8
  private static _needsUserGestureResume;
9
+ private static _suspendedByCaller;
10
+ private static _recovering;
9
11
  /**
10
12
  * Suspend the audio context.
11
13
  * @returns A promise that resolves when the audio context is suspended
@@ -18,5 +20,7 @@ export declare class AudioManager {
18
20
  */
19
21
  static resume(): Promise<void>;
20
22
  private static _onVisibilityChange;
23
+ private static _recoverPlaybackContext;
24
+ private static _onPageShow;
21
25
  private static _resumeAfterInterruption;
22
26
  }
@@ -67,6 +67,7 @@ export declare class AudioSource extends Component {
67
67
  */
68
68
  pause(): void;
69
69
  private _onPlayEnd;
70
+ private _ensureGainNode;
70
71
  private _startPlayback;
71
72
  private _initSourceNode;
72
73
  private _clearSourceNode;
@@ -21,6 +21,7 @@ export declare class ParticleGenerator {
21
21
  private static _tempVector30;
22
22
  private static _tempVector31;
23
23
  private static _tempVector32;
24
+ private static _tempVector33;
24
25
  private static _tempMat;
25
26
  private static _tempColor;
26
27
  private static _tempQuat0;
@@ -118,6 +119,12 @@ export declare class ParticleGenerator {
118
119
  private _calculateGeneratorBounds;
119
120
  private _mergeTransformedBounds;
120
121
  private _calculateTransformedBounds;
122
+ private _useOrbitalBounds;
123
+ private _getNoiseBoundsExtents;
124
+ private _getGravityBoundsReach;
125
+ private _getRangeReach;
126
+ private _getVectorReach;
127
+ private _getCurveMagnitudeFromZero;
121
128
  private _addGravityToBounds;
122
129
  private _getExtremeValueFromZero;
123
130
  }
@@ -4,6 +4,7 @@ import { ParticleCurve } from "./ParticleCurve";
4
4
  * Particle composite curve.
5
5
  */
6
6
  export declare class ParticleCompositeCurve {
7
+ private static _minMaxRange;
7
8
  private _updateManager;
8
9
  private _mode;
9
10
  private _constantMin;
@@ -75,7 +76,6 @@ export declare class ParticleCompositeCurve {
75
76
  * @returns - The result curve value
76
77
  */
77
78
  evaluate(time: number, lerpFactor: number): number;
78
- private _getMaxKeyValue;
79
- private _getMinKeyValue;
79
+ private _getKeyMinMax;
80
80
  private _onCurveChange;
81
81
  }
@@ -1,3 +1,4 @@
1
+ import { Vector3 } from "@galacean/engine-math";
1
2
  import { ShaderMacro } from "../../shader";
2
3
  import { ShaderProperty } from "../../shader/ShaderProperty";
3
4
  import { ParticleSimulationSpace } from "../enums/ParticleSimulationSpace";
@@ -20,14 +21,45 @@ export declare class VelocityOverLifetimeModule extends ParticleGeneratorModule
20
21
  static readonly _maxGradientYProperty: ShaderProperty;
21
22
  static readonly _maxGradientZProperty: ShaderProperty;
22
23
  static readonly _spaceProperty: ShaderProperty;
24
+ static readonly _orbitalConstantModeMacro: ShaderMacro;
25
+ static readonly _orbitalCurveModeMacro: ShaderMacro;
26
+ static readonly _orbitalRandomModeMacro: ShaderMacro;
27
+ static readonly _radialConstantModeMacro: ShaderMacro;
28
+ static readonly _radialCurveModeMacro: ShaderMacro;
29
+ static readonly _radialRandomModeMacro: ShaderMacro;
30
+ static readonly _orbitalMinConstantProperty: ShaderProperty;
31
+ static readonly _orbitalMaxConstantProperty: ShaderProperty;
32
+ static readonly _orbitalMinCurveXProperty: ShaderProperty;
33
+ static readonly _orbitalMinCurveYProperty: ShaderProperty;
34
+ static readonly _orbitalMinCurveZProperty: ShaderProperty;
35
+ static readonly _orbitalMaxCurveXProperty: ShaderProperty;
36
+ static readonly _orbitalMaxCurveYProperty: ShaderProperty;
37
+ static readonly _orbitalMaxCurveZProperty: ShaderProperty;
38
+ static readonly _radialMinConstantProperty: ShaderProperty;
39
+ static readonly _radialMaxConstantProperty: ShaderProperty;
40
+ static readonly _radialMinCurveProperty: ShaderProperty;
41
+ static readonly _radialMaxCurveProperty: ShaderProperty;
42
+ static readonly _offsetProperty: ShaderProperty;
23
43
  private _velocityMinConstant;
24
44
  private _velocityMaxConstant;
25
45
  private _velocityMacro;
26
46
  private _randomModeMacro;
47
+ private _orbitalMinConstant;
48
+ private _orbitalConstant;
49
+ private _orbitalMacro;
50
+ private _orbitalRandomModeMacro;
51
+ private _radialMacro;
52
+ private _radialRandomModeMacro;
27
53
  private _velocityX;
28
54
  private _velocityY;
29
55
  private _velocityZ;
56
+ private _orbitalX;
57
+ private _orbitalY;
58
+ private _orbitalZ;
59
+ private _radial;
60
+ private _offset;
30
61
  private _space;
62
+ private readonly _onTransformFeedbackDirty;
31
63
  /**
32
64
  * Velocity over lifetime for x axis.
33
65
  */
@@ -43,6 +75,35 @@ export declare class VelocityOverLifetimeModule extends ParticleGeneratorModule
43
75
  */
44
76
  get velocityZ(): ParticleCompositeCurve;
45
77
  set velocityZ(value: ParticleCompositeCurve);
78
+ /**
79
+ * Orbital velocity (radians/second) around the x axis of the system.
80
+ * @remarks Requires WebGL2.
81
+ */
82
+ get orbitalX(): ParticleCompositeCurve;
83
+ set orbitalX(value: ParticleCompositeCurve);
84
+ /**
85
+ * Orbital velocity (radians/second) around the y axis of the system.
86
+ * @remarks Requires WebGL2.
87
+ */
88
+ get orbitalY(): ParticleCompositeCurve;
89
+ set orbitalY(value: ParticleCompositeCurve);
90
+ /**
91
+ * Orbital velocity (radians/second) around the z axis of the system.
92
+ * @remarks Requires WebGL2.
93
+ */
94
+ get orbitalZ(): ParticleCompositeCurve;
95
+ set orbitalZ(value: ParticleCompositeCurve);
96
+ /**
97
+ * Radial velocity moving particles away from (or towards) the center.
98
+ * @remarks Requires WebGL2.
99
+ */
100
+ get radial(): ParticleCompositeCurve;
101
+ set radial(value: ParticleCompositeCurve);
102
+ /**
103
+ * The center offset of orbital/radial motion from the particle system origin.
104
+ */
105
+ get centerOffset(): Vector3;
106
+ set centerOffset(value: Vector3);
46
107
  /**
47
108
  * Velocity space.
48
109
  */
@@ -51,4 +112,5 @@ export declare class VelocityOverLifetimeModule extends ParticleGeneratorModule
51
112
  get enabled(): boolean;
52
113
  set enabled(value: boolean);
53
114
  constructor(generator: ParticleGenerator);
115
+ private _onOrbitalRadialChange;
54
116
  }
@@ -118,6 +118,12 @@ export declare class DynamicCollider extends Collider {
118
118
  * @param force - The force make the collider move
119
119
  */
120
120
  applyForce(force: Vector3): void;
121
+ /**
122
+ * Apply a force to the DynamicCollider at a given position in world space.
123
+ * @param force - The force to apply, in world space
124
+ * @param position - The position where the force is applied, in world space
125
+ */
126
+ applyForceAtPosition(force: Vector3, position: Vector3): void;
121
127
  /**
122
128
  * Apply a torque to the DynamicCollider.
123
129
  * @param torque - The force make the collider rotate