@galacean/engine-core 1.0.0-beta.9 → 1.0.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 (186) hide show
  1. package/dist/main.js +11947 -11300
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +11947 -11300
  4. package/dist/module.js +11943 -11302
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/sprite/Sprite.d.ts +3 -0
  8. package/types/2d/sprite/SpriteMask.d.ts +1 -2
  9. package/types/2d/sprite/SpriteRenderer.d.ts +1 -2
  10. package/types/2d/text/TextRenderer.d.ts +1 -2
  11. package/types/Camera.d.ts +5 -2
  12. package/types/ComponentsManager.d.ts +3 -2
  13. package/types/DisorderedArray.d.ts +4 -3
  14. package/types/Engine.d.ts +5 -3
  15. package/types/Entity.d.ts +1 -1
  16. package/types/RenderPipeline/ClassPool.d.ts +3 -1
  17. package/types/RenderPipeline/CullingResults.d.ts +1 -0
  18. package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
  19. package/types/RenderPipeline/IPoolElement.d.ts +3 -0
  20. package/types/RenderPipeline/MeshRenderData.d.ts +3 -1
  21. package/types/RenderPipeline/PipelinePass.d.ts +16 -0
  22. package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
  23. package/types/RenderPipeline/RenderElement.d.ts +3 -1
  24. package/types/RenderPipeline/RenderElementX.d.ts +12 -0
  25. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +3 -1
  26. package/types/RenderPipeline/SpriteRenderData.d.ts +3 -1
  27. package/types/RenderPipeline/TextRenderData.d.ts +3 -1
  28. package/types/Renderer.d.ts +7 -3
  29. package/types/SafeLoopArray.d.ts +37 -0
  30. package/types/Scene.d.ts +10 -4
  31. package/types/Ticker.d.ts +30 -0
  32. package/types/Transform.d.ts +1 -0
  33. package/types/animation/Animator.d.ts +7 -4
  34. package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
  35. package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
  36. package/types/animation/enums/LayerState.d.ts +3 -1
  37. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
  38. package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
  39. package/types/asset/LoadItem.d.ts +16 -9
  40. package/types/asset/request.d.ts +7 -3
  41. package/types/base/EventDispatcher.d.ts +1 -1
  42. package/types/enums/ActiveChangeFlag.d.ts +6 -0
  43. package/types/enums/DepthTextureMode.d.ts +7 -0
  44. package/types/graphic/Primitive.d.ts +1 -0
  45. package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
  46. package/types/graphic/SubMesh.d.ts +3 -1
  47. package/types/graphic/SubPrimitive.d.ts +9 -0
  48. package/types/index.d.ts +1 -1
  49. package/types/lighting/AmbientLight.d.ts +4 -1
  50. package/types/lighting/LightManager.d.ts +1 -0
  51. package/types/material/Material.d.ts +9 -2
  52. package/types/mesh/MeshRenderer.d.ts +1 -2
  53. package/types/particle/ParticleBufferUtils.d.ts +1 -0
  54. package/types/particle/ParticleData.d.ts +1 -0
  55. package/types/particle/ParticleGenerator.d.ts +72 -0
  56. package/types/particle/ParticleMaterial.d.ts +28 -0
  57. package/types/particle/ParticleMesh.d.ts +289 -0
  58. package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
  59. package/types/particle/ParticleShaderMacro.d.ts +1 -0
  60. package/types/particle/ParticleShaderProperty.d.ts +1 -0
  61. package/types/particle/ParticleSystem.d.ts +41 -0
  62. package/types/particle/ParticleVertexElements.d.ts +1 -0
  63. package/types/particle/ParticleVertexUtils.d.ts +1 -0
  64. package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
  65. package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
  66. package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
  67. package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
  68. package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
  69. package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
  70. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
  71. package/types/particle/enum/ParticleShapeType.d.ts +15 -0
  72. package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
  73. package/types/particle/enum/index.d.ts +9 -0
  74. package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
  75. package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
  76. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
  77. package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
  78. package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
  79. package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
  80. package/types/particle/enums/ParticleStopMode.d.ts +6 -0
  81. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
  82. package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
  83. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
  84. package/types/particle/module/Burst.d.ts +38 -0
  85. package/types/particle/module/ColorGradient.d.ts +75 -0
  86. package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
  87. package/types/particle/module/EmissionModule.d.ts +63 -0
  88. package/types/particle/module/FrameOverTime.d.ts +73 -0
  89. package/types/particle/module/ParticleCurve.d.ts +37 -0
  90. package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
  91. package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
  92. package/types/particle/module/SizeGradient.d.ts +151 -0
  93. package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
  94. package/types/particle/module/StartFrame.d.ts +46 -0
  95. package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
  96. package/types/particle/module/VelocityGradient.d.ts +110 -0
  97. package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
  98. package/types/particle/module/index.d.ts +15 -0
  99. package/types/particle/module/shape/BaseShape.d.ts +26 -0
  100. package/types/particle/module/shape/BoxShape.d.ts +20 -0
  101. package/types/particle/module/shape/CircleShape.d.ts +27 -0
  102. package/types/particle/module/shape/ConeShape.d.ts +35 -0
  103. package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
  104. package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
  105. package/types/particle/module/shape/SphereShape.d.ts +23 -0
  106. package/types/particle/module/shape/index.d.ts +5 -0
  107. package/types/particle/modules/Burst.d.ts +14 -0
  108. package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
  109. package/types/particle/modules/EmissionModule.d.ts +45 -0
  110. package/types/particle/modules/MainModule.d.ts +68 -0
  111. package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
  112. package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
  113. package/types/particle/modules/ParticleCurve.d.ts +56 -0
  114. package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
  115. package/types/particle/modules/ParticleGradient.d.ts +94 -0
  116. package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
  117. package/types/particle/modules/ShapeModule.d.ts +9 -0
  118. package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
  119. package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
  120. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
  121. package/types/particle/modules/shape/BaseShape.d.ts +12 -0
  122. package/types/particle/modules/shape/BoxShape.d.ts +11 -0
  123. package/types/particle/modules/shape/CircleShape.d.ts +17 -0
  124. package/types/particle/modules/shape/ConeShape.d.ts +28 -0
  125. package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
  126. package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
  127. package/types/particle/modules/shape/SphereShape.d.ts +9 -0
  128. package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
  129. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  130. package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
  131. package/types/particle/modules/shape/index.d.ts +6 -0
  132. package/types/particle/moudules/Burst.d.ts +25 -0
  133. package/types/particle/moudules/Emission.d.ts +47 -0
  134. package/types/particle/moudules/EmissionModule.d.ts +49 -0
  135. package/types/particle/moudules/MainModule.d.ts +59 -0
  136. package/types/particle/moudules/ParticleCurve.d.ts +27 -0
  137. package/types/particle/moudules/ParticleGradient.d.ts +28 -0
  138. package/types/particle/moudules/ShapeModule.d.ts +7 -0
  139. package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
  140. package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
  141. package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
  142. package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
  143. package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
  144. package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
  145. package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
  146. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  147. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
  148. package/types/particle/moudules/shape/index.d.ts +5 -0
  149. package/types/physics/PhysicsManager.d.ts +4 -2
  150. package/types/physics/PhysicsScene.d.ts +79 -0
  151. package/types/shader/enums/RenderStateElementKey.d.ts +60 -0
  152. package/types/shader/index.d.ts +1 -0
  153. package/types/shader/state/index.d.ts +6 -0
  154. package/types/shaderlib/particle/index.d.ts +14 -0
  155. package/types/shadow/PipelinePass.d.ts +16 -0
  156. package/types/sky/Sky.d.ts +12 -4
  157. package/types/texture/Texture.d.ts +6 -0
  158. package/types/texture/Texture2D.d.ts +3 -1
  159. package/types/texture/enums/TextureUsage.d.ts +9 -0
  160. package/types/texture/index.d.ts +1 -0
  161. package/types/utils/BoolUpdateFlag.d.ts +12 -0
  162. package/types/utils/DisorderedArray.d.ts +18 -0
  163. package/types/utils/SafeLoopArray.d.ts +41 -0
  164. package/types/utils/UpdateFlag.d.ts +20 -0
  165. package/types/utils/UpdateFlagManager.d.ts +1 -0
  166. package/types/utils/Utils.d.ts +31 -0
  167. package/types/xr/XRManager.d.ts +31 -0
  168. package/types/xr/component/XRPoseDriver.d.ts +10 -0
  169. package/types/xr/data/XRCamera.d.ts +6 -0
  170. package/types/xr/data/XRDevice.d.ts +9 -0
  171. package/types/xr/data/XRHandle.d.ts +10 -0
  172. package/types/xr/enum/EnumXRButton.d.ts +5 -0
  173. package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
  174. package/types/xr/enum/EnumXRFeature.d.ts +9 -0
  175. package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
  176. package/types/xr/enum/EnumXRMode.d.ts +7 -0
  177. package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
  178. package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
  179. package/types/xr/feature/XRCameraManager.d.ts +21 -0
  180. package/types/xr/feature/XRFeature.d.ts +29 -0
  181. package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
  182. package/types/xr/feature/XRInputManager.d.ts +16 -0
  183. package/types/xr/index.d.ts +18 -0
  184. package/types/xr/provider/XRProvider.d.ts +19 -0
  185. package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
  186. package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "1.0.0-beta.9",
3
+ "version": "1.0.1",
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.0.0-beta.9"
18
+ "@galacean/engine-math": "1.0.1"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "1.0.0-beta.9"
21
+ "@galacean/engine-design": "1.0.1"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
@@ -100,4 +100,7 @@ export declare class Sprite extends ReferResource {
100
100
  private _updatePositions;
101
101
  private _updateUVs;
102
102
  private _dispatchSpriteChange;
103
+ private _onRegionChange;
104
+ private _onPivotChange;
105
+ private _onBorderChange;
103
106
  }
@@ -1,10 +1,9 @@
1
1
  import { Renderer } from "../../Renderer";
2
- import { ICustomClone } from "../../clone/ComponentCloner";
3
2
  import { Sprite } from "./Sprite";
4
3
  /**
5
4
  * A component for masking Sprites.
6
5
  */
7
- export declare class SpriteMask extends Renderer implements ICustomClone {
6
+ export declare class SpriteMask extends Renderer {
8
7
  /** The mask layers the sprite mask influence to. */
9
8
  influenceLayers: number;
10
9
  private _sprite;
@@ -1,6 +1,5 @@
1
1
  import { Color } from "@galacean/engine-math";
2
2
  import { Renderer } from "../../Renderer";
3
- import { ICustomClone } from "../../clone/ComponentCloner";
4
3
  import { SpriteDrawMode } from "../enums/SpriteDrawMode";
5
4
  import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
6
5
  import { SpriteTileMode } from "../enums/SpriteTileMode";
@@ -8,7 +7,7 @@ import { Sprite } from "./Sprite";
8
7
  /**
9
8
  * Renders a Sprite for 2D graphics.
10
9
  */
11
- export declare class SpriteRenderer extends Renderer implements ICustomClone {
10
+ export declare class SpriteRenderer extends Renderer {
12
11
  private _drawMode;
13
12
  private _assembler;
14
13
  private _tileMode;
@@ -1,7 +1,6 @@
1
1
  import { BoundingBox, Color } from "@galacean/engine-math";
2
2
  import { Entity } from "../../Entity";
3
3
  import { Renderer } from "../../Renderer";
4
- import { ICustomClone } from "../../clone/ComponentCloner";
5
4
  import { FontStyle } from "../enums/FontStyle";
6
5
  import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
7
6
  import { TextHorizontalAlignment, TextVerticalAlignment } from "../enums/TextAlignment";
@@ -10,7 +9,7 @@ import { Font } from "./Font";
10
9
  /**
11
10
  * Renders a text for 2D graphics.
12
11
  */
13
- export declare class TextRenderer extends Renderer implements ICustomClone {
12
+ export declare class TextRenderer extends Renderer {
14
13
  private static _charRenderDataPool;
15
14
  private static _tempVec30;
16
15
  private static _tempVec31;
package/types/Camera.d.ts CHANGED
@@ -12,8 +12,6 @@ import { RenderTarget } from "./texture/RenderTarget";
12
12
  * @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
13
13
  */
14
14
  export declare class Camera extends Component {
15
- /** Shader data. */
16
- readonly shaderData: ShaderData;
17
15
  /** Rendering priority - A Camera with higher priority will be rendered on top of a camera with lower priority. */
18
16
  priority: number;
19
17
  /** Whether to enable frustum culling, it is enabled by default. */
@@ -28,6 +26,7 @@ export declare class Camera extends Component {
28
26
  * @remarks Support bit manipulation, corresponding to `Layer`.
29
27
  */
30
28
  cullingMask: Layer;
29
+ private _shaderData;
31
30
  private _isProjMatSetting;
32
31
  private _nearClipPlane;
33
32
  private _farClipPlane;
@@ -46,6 +45,10 @@ export declare class Camera extends Component {
46
45
  private _inverseProjectionMatrix;
47
46
  private _lastAspectSize;
48
47
  private _invViewProjMat;
48
+ /**
49
+ * Shader data.
50
+ */
51
+ get shaderData(): ShaderData;
49
52
  /**
50
53
  * Near clip plane - the closest point to the camera when rendering occurs.
51
54
  */
@@ -2,6 +2,7 @@ import { Camera } from "./Camera";
2
2
  import { Component } from "./Component";
3
3
  import { Renderer } from "./Renderer";
4
4
  import { Script } from "./Script";
5
+ import { Animator } from "./animation";
5
6
  /**
6
7
  * The manager of the components.
7
8
  */
@@ -26,8 +27,8 @@ export declare class ComponentsManager {
26
27
  removeOnLateUpdateScript(script: Script): void;
27
28
  addOnPhysicsUpdateScript(script: Script): void;
28
29
  removeOnPhysicsUpdateScript(script: Script): void;
29
- addOnUpdateAnimations(animation: Component): void;
30
- removeOnUpdateAnimations(animation: Component): void;
30
+ addOnUpdateAnimations(animation: Animator): void;
31
+ removeOnUpdateAnimations(animation: Animator): void;
31
32
  addOnUpdateRenderers(renderer: Renderer): void;
32
33
  removeOnUpdateRenderers(renderer: Renderer): void;
33
34
  addDisableScript(component: Script): void;
@@ -7,11 +7,12 @@ export declare class DisorderedArray<T> {
7
7
  constructor(count?: number);
8
8
  add(element: T): void;
9
9
  delete(element: T): void;
10
+ set(index: number, element: T): void;
10
11
  get(index: number): T;
11
12
  /**
12
- *
13
- * @param index
14
- * @returns The replaced item is used to reset its index.
13
+ * Delete the element at the specified index.
14
+ * @param index - The index of the element to be deleted
15
+ * @returns The replaced item is used to reset its index
15
16
  */
16
17
  deleteByIndex(index: number): T;
17
18
  garbageCollection(): void;
package/types/Engine.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { IPhysics } from "@galacean/engine-design";
2
- import { ResourceManager } from "./asset/ResourceManager";
3
- import { EventDispatcher, Time } from "./base";
4
2
  import { Canvas } from "./Canvas";
5
3
  import { EngineSettings } from "./EngineSettings";
6
4
  import { Entity } from "./Entity";
5
+ import { SceneManager } from "./SceneManager";
6
+ import { ResourceManager } from "./asset/ResourceManager";
7
+ import { EventDispatcher, Time } from "./base";
7
8
  import { ColorSpace } from "./enums/ColorSpace";
8
9
  import { InputManager } from "./input";
9
10
  import { PhysicsManager } from "./physics";
10
11
  import { IHardwareRenderer } from "./renderingHardwareInterface";
11
- import { SceneManager } from "./SceneManager";
12
12
  /**
13
13
  * Engine.
14
14
  */
@@ -32,6 +32,7 @@ export declare class Engine extends EventDispatcher {
32
32
  private _frameInProcess;
33
33
  private _waitingDestroy;
34
34
  private _isDeviceLost;
35
+ private _waitingGC;
35
36
  private _animate;
36
37
  /**
37
38
  * Settings of Engine.
@@ -118,6 +119,7 @@ export declare class Engine extends EventDispatcher {
118
119
  private _createSpriteMaskMaterial;
119
120
  private _onDeviceLost;
120
121
  private _onDeviceRestored;
122
+ private _gc;
121
123
  }
122
124
  /**
123
125
  * Engine configuration.
package/types/Entity.d.ts CHANGED
@@ -65,7 +65,7 @@ export declare class Entity extends EngineObject {
65
65
  * @param type - The type of the component
66
66
  * @returns The first component which match type
67
67
  */
68
- getComponent<T extends Component>(type: new (entity: Entity) => T): T;
68
+ getComponent<T extends Component>(type: new (entity: Entity) => T): T | null;
69
69
  /**
70
70
  * Get components which match the type.
71
71
  * @param type - The type of the component
@@ -1,7 +1,8 @@
1
+ import { IPoolElement } from "./IPoolElement";
1
2
  /**
2
3
  * Class pool utils.
3
4
  */
4
- export declare class ClassPool<T> {
5
+ export declare class ClassPool<T extends IPoolElement> {
5
6
  private _elementPoolIndex;
6
7
  private _elementPool;
7
8
  private _type;
@@ -14,4 +15,5 @@ export declare class ClassPool<T> {
14
15
  * Reset pool.
15
16
  */
16
17
  resetPool(): void;
18
+ garbageCollection(): void;
17
19
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export interface IPoolElement {
2
+ dispose?(): void;
3
+ }
@@ -2,14 +2,16 @@ import { Mesh } from "../graphic/Mesh";
2
2
  import { SubMesh } from "../graphic/SubMesh";
3
3
  import { Material } from "../material/Material";
4
4
  import { Renderer } from "../Renderer";
5
+ import { IPoolElement } from "./IPoolElement";
5
6
  import { RenderData } from "./RenderData";
6
7
  /**
7
8
  * Render element.
8
9
  */
9
- export declare class MeshRenderData extends RenderData {
10
+ export declare class MeshRenderData extends RenderData implements IPoolElement {
10
11
  /** Mesh. */
11
12
  mesh: Mesh;
12
13
  /** Sub mesh. */
13
14
  subMesh: SubMesh;
14
15
  set(component: Renderer, material: Material, mesh: Mesh, subMesh: SubMesh): void;
16
+ dispose(): void;
15
17
  }
@@ -0,0 +1,16 @@
1
+ import { Engine } from "../Engine";
2
+ import { CullingResults } from "../RenderPipeline/CullingResults";
3
+ import { RenderContext } from "../RenderPipeline/RenderContext";
4
+ /**
5
+ * PipelinePass is a base class for all pipeline passes.
6
+ */
7
+ export declare abstract class PipelinePass {
8
+ protected _engine: Engine;
9
+ constructor(engine: Engine);
10
+ /**
11
+ * Called before rendering a camera, override this method to configure the camera If you need to configure the camera clear flag or render target.
12
+ * @param context - Rendering context
13
+ * @param cullingResults - Culling results
14
+ */
15
+ abstract onRender(context: RenderContext, cullingResults: CullingResults): void;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,11 @@
1
1
  import { ShaderPass } from "../shader/ShaderPass";
2
2
  import { RenderState } from "../shader/state/RenderState";
3
+ import { IPoolElement } from "./IPoolElement";
3
4
  import { RenderData } from "./RenderData";
4
- export declare class RenderElement {
5
+ export declare class RenderElement implements IPoolElement {
5
6
  data: RenderData;
6
7
  shaderPass: ShaderPass;
7
8
  renderState: RenderState;
8
9
  set(data: RenderData, shaderPass: ShaderPass, renderState: RenderState): void;
10
+ dispose(): void;
9
11
  }
@@ -0,0 +1,12 @@
1
+ import { Renderer } from "../Renderer";
2
+ import { Primitive } from "../graphic/Primitive";
3
+ import { Material } from "../material/Material";
4
+ import { ShaderPass } from "../shader/ShaderPass";
5
+ import { IPoolElement } from "./IPoolElement";
6
+ export declare class RenderElementX implements IPoolElement {
7
+ shaderPasses: ReadonlyArray<ShaderPass>;
8
+ component: Renderer;
9
+ material: Material;
10
+ primitive: Primitive;
11
+ dispose(): void;
12
+ }
@@ -1,10 +1,12 @@
1
1
  import { VertexData2D } from "../2d/data/VertexData2D";
2
2
  import { Material } from "../material/Material";
3
3
  import { Renderer } from "../Renderer";
4
+ import { IPoolElement } from "./IPoolElement";
4
5
  import { RenderData } from "./RenderData";
5
- export declare class SpriteMaskRenderData extends RenderData {
6
+ export declare class SpriteMaskRenderData extends RenderData implements IPoolElement {
6
7
  isAdd: boolean;
7
8
  verticesData: VertexData2D;
8
9
  constructor();
9
10
  set(component: Renderer, material: Material, verticesData: VertexData2D): void;
11
+ dispose(): void;
10
12
  }
@@ -2,11 +2,13 @@ import { VertexData2D } from "../2d/data/VertexData2D";
2
2
  import { Material } from "../material/Material";
3
3
  import { Renderer } from "../Renderer";
4
4
  import { Texture2D } from "../texture";
5
+ import { IPoolElement } from "./IPoolElement";
5
6
  import { RenderData } from "./RenderData";
6
- export declare class SpriteRenderData extends RenderData {
7
+ export declare class SpriteRenderData extends RenderData implements IPoolElement {
7
8
  verticesData: VertexData2D;
8
9
  texture: Texture2D;
9
10
  dataIndex: number;
10
11
  constructor();
11
12
  set(component: Renderer, material: Material, verticesData: VertexData2D, texture: Texture2D, dataIndex?: number): void;
13
+ dispose(): void;
12
14
  }
@@ -1,6 +1,8 @@
1
+ import { IPoolElement } from "./IPoolElement";
1
2
  import { RenderData } from "./RenderData";
2
3
  import { SpriteRenderData } from "./SpriteRenderData";
3
- export declare class TextRenderData extends RenderData {
4
+ export declare class TextRenderData extends RenderData implements IPoolElement {
4
5
  charsData: SpriteRenderData[];
5
6
  constructor();
7
+ dispose(): void;
6
8
  }
@@ -1,12 +1,13 @@
1
1
  import { BoundingBox, Vector4 } from "@galacean/engine-math";
2
2
  import { Component } from "./Component";
3
+ import { ICustomClone } from "./clone/ComponentCloner";
3
4
  import { Material } from "./material";
4
5
  import { ShaderData } from "./shader/ShaderData";
5
6
  /**
6
7
  * Basis for all renderers.
7
8
  * @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
8
9
  */
9
- export declare class Renderer extends Component {
10
+ export declare class Renderer extends Component implements ICustomClone {
10
11
  private static _tempVector0;
11
12
  private static _receiveShadowMacro;
12
13
  private static _localMatrixProperty;
@@ -16,12 +17,11 @@ export declare class Renderer extends Component {
16
17
  private static _mvInvMatrixProperty;
17
18
  private static _normalMatrixProperty;
18
19
  private static _rendererLayerProperty;
19
- /** ShaderData related to renderer. */
20
- readonly shaderData: ShaderData;
21
20
  _renderFrameCount: number;
22
21
  protected _overrideUpdate: boolean;
23
22
  protected _materials: Material[];
24
23
  protected _dirtyUpdateFlag: number;
24
+ private _shaderData;
25
25
  private _mvMatrix;
26
26
  private _mvpMatrix;
27
27
  private _mvInvMatrix;
@@ -30,6 +30,10 @@ export declare class Renderer extends Component {
30
30
  private _priority;
31
31
  private _receiveShadows;
32
32
  protected _rendererLayer: Vector4;
33
+ /**
34
+ * ShaderData related to renderer.
35
+ */
36
+ get shaderData(): ShaderData;
33
37
  /**
34
38
  * Whether it is culled in the current frame and does not participate in rendering.
35
39
  */
@@ -0,0 +1,37 @@
1
+ export declare class SafeLoopArray<T> {
2
+ private _array;
3
+ private _loopArray;
4
+ private _loopArrayDirty;
5
+ /**
6
+ * Get the length of the array.
7
+ */
8
+ get length(): number;
9
+ /**
10
+ * Push item to the array.
11
+ * @param item - The item which want to be pushed
12
+ */
13
+ push(item: T): void;
14
+ /**
15
+ * Splice the array.
16
+ * @param index - The index of the array
17
+ * @param deleteCount - The count of the array which want to be deleted
18
+ * @param item - The item which want to be added
19
+ */
20
+ splice(index: number, deleteCount: number, item?: T): void;
21
+ /**
22
+ * The index of the item.
23
+ * @param item - The item which want to get the index
24
+ * @returns Index of the item
25
+ */
26
+ indexOf(item: T): number;
27
+ /**
28
+ * Get the array.
29
+ * @returns The array
30
+ */
31
+ getArray(): ReadonlyArray<T>;
32
+ /**
33
+ * Get the array use for loop.
34
+ * @returns The array use for loop
35
+ */
36
+ getLoopArray(): ReadonlyArray<T>;
37
+ }
package/types/Scene.d.ts CHANGED
@@ -18,10 +18,6 @@ export declare class Scene extends EngineObject {
18
18
  private static _sunlightDirectionProperty;
19
19
  /** Scene name. */
20
20
  name: string;
21
- /** The background of the scene. */
22
- readonly background: Background;
23
- /** Scene-related shader data. */
24
- readonly shaderData: ShaderData;
25
21
  /** If cast shadows. */
26
22
  castShadows: boolean;
27
23
  /** The resolution of the shadow maps. */
@@ -32,6 +28,8 @@ export declare class Scene extends EngineObject {
32
28
  shadowFourCascadeSplits: Vector3;
33
29
  /** Max Shadow distance. */
34
30
  shadowDistance: number;
31
+ private _background;
32
+ private _shaderData;
35
33
  private _shadowCascades;
36
34
  private _ambientLight;
37
35
  private _fogMode;
@@ -40,6 +38,14 @@ export declare class Scene extends EngineObject {
40
38
  private _fogEnd;
41
39
  private _fogDensity;
42
40
  private _fogParams;
41
+ /**
42
+ * Scene-related shader data.
43
+ */
44
+ get shaderData(): ShaderData;
45
+ /**
46
+ * The background of the scene.
47
+ */
48
+ get background(): Background;
43
49
  /**
44
50
  * Number of cascades to use for directional light shadows.
45
51
  */
@@ -0,0 +1,30 @@
1
+ export declare class Ticker {
2
+ private _vSyncCount;
3
+ private _vSyncCounter;
4
+ private _requestId;
5
+ private _animationLoop;
6
+ private _requestAnimationFrame;
7
+ private _cancelAnimationFrame;
8
+ /**
9
+ * The number of vertical synchronization means the number of vertical blanking for one frame.
10
+ * @remarks 0 means that the vertical synchronization is turned off.
11
+ */
12
+ get vSyncCount(): number;
13
+ set vSyncCount(value: number);
14
+ get requestAnimationFrame(): (...params: any[]) => any;
15
+ set requestAnimationFrame(func: (...params: any[]) => any);
16
+ get cancelAnimationFrame(): (...params: any[]) => any;
17
+ set cancelAnimationFrame(func: (...params: any[]) => any);
18
+ get animationLoop(): (...params: any[]) => any;
19
+ set animationLoop(func: (...params: any[]) => any);
20
+ /**
21
+ * Pause the engine.
22
+ */
23
+ pause(): void;
24
+ /**
25
+ * Resume the engine.
26
+ */
27
+ resume(): void;
28
+ private _onAnimationFrame;
29
+ constructor();
30
+ }
@@ -195,6 +195,7 @@ export declare class Transform extends Component {
195
195
  * @returns Change flag
196
196
  */
197
197
  registerWorldChangeFlag(): BoolUpdateFlag;
198
+ protected _onDestroy(): void;
198
199
  /**
199
200
  * Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
200
201
  * Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
@@ -13,9 +13,9 @@ export declare class Animator extends Component {
13
13
  speed: number;
14
14
  protected _animatorController: AnimatorController;
15
15
  protected _controllerUpdateFlag: BoolUpdateFlag;
16
+ protected _updateMark: number;
16
17
  private _animatorLayersData;
17
- private _crossOwnerCollection;
18
- private _animationCurveOwners;
18
+ private _curveOwnerPool;
19
19
  private _animationEventHandlerPool;
20
20
  private _tempAnimatorStateInfo;
21
21
  private _controlledRenderers;
@@ -56,12 +56,11 @@ export declare class Animator extends Component {
56
56
  */
57
57
  findAnimatorState(stateName: string, layerIndex?: number): AnimatorState;
58
58
  private _getAnimatorStateInfo;
59
- private _saveDefaultValues;
60
59
  private _getAnimatorStateData;
61
60
  private _saveAnimatorStateData;
62
61
  private _saveAnimatorEventHandlers;
63
62
  private _clearCrossData;
64
- private _addCrossCurveData;
63
+ private _addCrossOwner;
65
64
  private _prepareCrossFading;
66
65
  private _prepareStandbyCrossFading;
67
66
  private _prepareFixedPoseCrossFading;
@@ -72,9 +71,12 @@ export declare class Animator extends Component {
72
71
  private _updatePlayingState;
73
72
  private _updateCrossFade;
74
73
  private _updateCrossFadeFromPose;
74
+ private _updateFinishedState;
75
75
  private _updateCrossFadeData;
76
76
  private _preparePlay;
77
77
  private _checkTransition;
78
+ private _checkSubTransition;
79
+ private _checkBackwardsSubTransition;
78
80
  private _crossFadeByTransition;
79
81
  private _fireAnimationEvents;
80
82
  private _fireSubAnimationEvents;
@@ -83,4 +85,5 @@ export declare class Animator extends Component {
83
85
  private _callAnimatorScriptOnUpdate;
84
86
  private _callAnimatorScriptOnExit;
85
87
  private _checkAutoPlay;
88
+ private _checkRevertOwner;
86
89
  }
@@ -0,0 +1,8 @@
1
+ import { Rect } from "@galacean/engine-math";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationRectCurve extends AnimationCurve<Rect> {
7
+ constructor();
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ReferResource } from "../../asset/ReferResource";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationRefCurve extends AnimationCurve<ReferResource> {
7
+ constructor();
8
+ }
@@ -9,5 +9,7 @@ export declare enum LayerState {
9
9
  /** CrossFading state. */
10
10
  CrossFading = 2,
11
11
  /** FixedCrossFading state. */
12
- FixedCrossFading = 3
12
+ FixedCrossFading = 3,
13
+ /** Finished state. */
14
+ Finished = 4
13
15
  }
@@ -1,15 +1,12 @@
1
+ type PickOnlyOne<T extends {}, Keys extends keyof T = keyof T> = Keys extends unknown ? {
2
+ [K in Keys]: T[Keys];
3
+ } & {
4
+ [K in Exclude<keyof T, Keys>]?: never;
5
+ } : never;
1
6
  /**
2
7
  * Used to describe loading asset.
3
8
  */
4
9
  export type LoadItem = {
5
- /**
6
- * Loading url.
7
- */
8
- url?: string;
9
- /**
10
- * Available when AssetType is TextureCube.
11
- */
12
- urls?: string[];
13
10
  /**
14
11
  * Asset Type.
15
12
  */
@@ -30,4 +27,14 @@ export type LoadItem = {
30
27
  * Additional parameters for specified loader.
31
28
  */
32
29
  params?: Record<string, any>;
33
- };
30
+ } & PickOnlyOne<{
31
+ /**
32
+ * Loading url.
33
+ */
34
+ url: string;
35
+ /**
36
+ * Available when AssetType is TextureCube.
37
+ */
38
+ urls: string[];
39
+ }>;
40
+ export {};
@@ -17,9 +17,13 @@ export declare class MultiExecutor {
17
17
  private interval;
18
18
  private _timeoutId;
19
19
  private _currentCount;
20
+ private _onComplete;
21
+ private _onError;
22
+ private _error;
20
23
  constructor(execFunc: (count?: number) => Promise<any>, totalCount: number, interval: number);
21
- private done;
22
- start(done?: Function): void;
23
- stop(): void;
24
+ start(): this;
25
+ onComplete(func: Function): this;
26
+ onError(func: Function): this;
27
+ cancel(): void;
24
28
  private exec;
25
29
  }
@@ -2,9 +2,9 @@
2
2
  * EventDispatcher, which can be inherited as a base class.
3
3
  */
4
4
  export declare class EventDispatcher {
5
+ private static _dispatchingListenersPool;
5
6
  private _events;
6
7
  private _eventCount;
7
- private _dispatchingListeners;
8
8
  /**
9
9
  * Determine whether there is event listening.
10
10
  * @param event - Event name
@@ -0,0 +1,6 @@
1
+ export declare enum ActiveChangeFlag {
2
+ None = 0,
3
+ Scene = 1,
4
+ Hierarchy = 2,
5
+ All = 3
6
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Depth texture mode.
3
+ */
4
+ export declare enum DepthTextureMode {
5
+ None = 0,
6
+ PrePass = 1
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};