@galacean/engine-core 2.0.0-alpha.5 → 2.0.0-alpha.50

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 (293) hide show
  1. package/dist/main.js +23868 -20447
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +23856 -20439
  4. package/dist/module.js.map +1 -1
  5. package/package.json +3 -3
  6. package/types/2d/assembler/ISpriteAssembler.d.ts +1 -0
  7. package/types/2d/assembler/ISpriteRenderer.d.ts +3 -2
  8. package/types/2d/assembler/SimpleSpriteAssembler.d.ts +1 -0
  9. package/types/2d/assembler/SlicedSpriteAssembler.d.ts +1 -0
  10. package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
  11. package/types/2d/atlas/FontAtlas.d.ts +23 -1
  12. package/types/2d/atlas/SpriteAtlas.d.ts +8 -0
  13. package/types/2d/sprite/Sprite.d.ts +30 -4
  14. package/types/2d/sprite/SpriteMask.d.ts +49 -1
  15. package/types/2d/sprite/SpriteRenderer.d.ts +35 -1
  16. package/types/2d/text/CharInfo.d.ts +20 -1
  17. package/types/2d/text/CharRenderInfo.d.ts +15 -1
  18. package/types/2d/text/Font.d.ts +11 -1
  19. package/types/2d/text/ITextRenderer.d.ts +3 -0
  20. package/types/2d/text/SubFont.d.ts +35 -1
  21. package/types/2d/text/TextRenderer.d.ts +54 -1
  22. package/types/2d/text/TextUtils.d.ts +89 -1
  23. package/types/Background.d.ts +19 -2
  24. package/types/BasicResources.d.ts +52 -0
  25. package/types/Camera.d.ts +73 -1
  26. package/types/Canvas.d.ts +36 -7
  27. package/types/Component.d.ts +35 -2
  28. package/types/ComponentsDependencies.d.ts +38 -1
  29. package/types/ComponentsManager.d.ts +17 -0
  30. package/types/Engine.d.ts +110 -4
  31. package/types/EngineEventType.d.ts +13 -0
  32. package/types/Entity.d.ts +112 -21
  33. package/types/Polyfill.d.ts +12 -1
  34. package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -1
  35. package/types/RenderPipeline/BatcherManager.d.ts +23 -1
  36. package/types/RenderPipeline/Blitter.d.ts +1 -1
  37. package/types/RenderPipeline/CullingResults.d.ts +17 -1
  38. package/types/RenderPipeline/DepthOnlyPass.d.ts +18 -1
  39. package/types/RenderPipeline/InstanceBuffer.d.ts +28 -0
  40. package/types/RenderPipeline/MaskManager.d.ts +36 -1
  41. package/types/RenderPipeline/OpaqueTexturePass.d.ts +16 -1
  42. package/types/RenderPipeline/PipelineUtils.d.ts +11 -1
  43. package/types/RenderPipeline/PrimitiveChunk.d.ts +27 -1
  44. package/types/RenderPipeline/PrimitiveChunkManager.d.ts +16 -1
  45. package/types/RenderPipeline/RenderContext.d.ts +46 -1
  46. package/types/RenderPipeline/RenderElement.d.ts +26 -6
  47. package/types/RenderPipeline/RenderQueue.d.ts +23 -1
  48. package/types/RenderPipeline/RenderTargetPool.d.ts +17 -1
  49. package/types/RenderPipeline/SubPrimitiveChunk.d.ts +14 -1
  50. package/types/RenderPipeline/VertexArea.d.ts +10 -1
  51. package/types/RenderPipeline/VertexMergeBatcher.d.ts +11 -0
  52. package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +9 -1
  53. package/types/RenderPipeline/index.d.ts +4 -1
  54. package/types/Renderer.d.ts +81 -18
  55. package/types/Scene.d.ts +34 -7
  56. package/types/SceneManager.d.ts +18 -6
  57. package/types/Script.d.ts +41 -0
  58. package/types/Signal.d.ts +69 -0
  59. package/types/SystemInfo.d.ts +13 -0
  60. package/types/Transform.d.ts +26 -1
  61. package/types/UpdateFlag.d.ts +4 -1
  62. package/types/UpdateFlagManager.d.ts +41 -1
  63. package/types/Utils.d.ts +20 -0
  64. package/types/VirtualCamera.d.ts +16 -1
  65. package/types/animation/AnimationClip.d.ts +13 -2
  66. package/types/animation/AnimationClipCurveBinding.d.ts +17 -2
  67. package/types/animation/AnimationEvent.d.ts +2 -2
  68. package/types/animation/Animator.d.ts +49 -10
  69. package/types/animation/AnimatorController.d.ts +20 -2
  70. package/types/animation/AnimatorControllerLayer.d.ts +17 -2
  71. package/types/animation/AnimatorControllerParameter.d.ts +4 -0
  72. package/types/animation/AnimatorState.d.ts +46 -2
  73. package/types/animation/AnimatorStateInstance.d.ts +46 -0
  74. package/types/animation/AnimatorStateMachine.d.ts +17 -2
  75. package/types/animation/AnimatorStateTransition.d.ts +9 -0
  76. package/types/animation/AnimatorStateTransitionCollection.d.ts +23 -1
  77. package/types/animation/Keyframe.d.ts +1 -1
  78. package/types/animation/StateMachineScript.d.ts +2 -0
  79. package/types/animation/animationCurve/AnimationArrayCurve.d.ts +39 -0
  80. package/types/animation/animationCurve/AnimationBoolCurve.d.ts +39 -0
  81. package/types/animation/animationCurve/AnimationColorCurve.d.ts +39 -0
  82. package/types/animation/animationCurve/AnimationCurve.d.ts +9 -1
  83. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +38 -0
  84. package/types/animation/animationCurve/AnimationFloatCurve.d.ts +39 -0
  85. package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +41 -0
  86. package/types/animation/animationCurve/AnimationRectCurve.d.ts +18 -0
  87. package/types/animation/animationCurve/AnimationRefCurve.d.ts +20 -2
  88. package/types/animation/animationCurve/AnimationStringCurve.d.ts +39 -0
  89. package/types/animation/animationCurve/AnimationVector2Curve.d.ts +39 -0
  90. package/types/animation/animationCurve/AnimationVector3Curve.d.ts +43 -0
  91. package/types/animation/animationCurve/AnimationVector4Curve.d.ts +39 -0
  92. package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +18 -1
  93. package/types/animation/enums/AnimatorStatePlayState.d.ts +8 -1
  94. package/types/animation/index.d.ts +1 -0
  95. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +15 -1
  96. package/types/animation/internal/AnimationEventHandler.d.ts +8 -1
  97. package/types/animation/internal/AnimatorLayerData.d.ts +28 -1
  98. package/types/animation/internal/AnimatorStateData.d.ts +14 -1
  99. package/types/animation/internal/AnimatorStatePlayData.d.ts +27 -1
  100. package/types/animation/internal/AnimatorTempValue.d.ts +12 -1
  101. package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +39 -0
  102. package/types/animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +12 -1
  103. package/types/animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts +10 -1
  104. package/types/animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts +13 -1
  105. package/types/animation/internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts +13 -1
  106. package/types/animation/internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts +13 -1
  107. package/types/animation/internal/animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts +23 -1
  108. package/types/asset/AssetPromise.d.ts +4 -4
  109. package/types/asset/AssetType.d.ts +7 -9
  110. package/types/asset/GraphicsResource.d.ts +10 -0
  111. package/types/asset/IReferable.d.ts +8 -0
  112. package/types/asset/JSONAsset.d.ts +1 -1
  113. package/types/asset/LoadItem.d.ts +1 -1
  114. package/types/asset/Loader.d.ts +2 -2
  115. package/types/asset/ReferResource.d.ts +28 -0
  116. package/types/asset/RenderingStatistics.d.ts +8 -0
  117. package/types/asset/ResourceManager.d.ts +117 -9
  118. package/types/audio/AudioClip.d.ts +8 -0
  119. package/types/audio/AudioManager.d.ts +18 -0
  120. package/types/audio/AudioSource.d.ts +20 -2
  121. package/types/base/DataObject.d.ts +6 -0
  122. package/types/base/EngineObject.d.ts +4 -0
  123. package/types/base/Time.d.ts +13 -0
  124. package/types/base/index.d.ts +1 -0
  125. package/types/clone/CloneDecorators.d.ts +37 -0
  126. package/types/clone/CloneUtil.d.ts +30 -0
  127. package/types/clone/ComponentCloner.d.ts +4 -10
  128. package/types/clone/ICloneHook.d.ts +12 -0
  129. package/types/enums/CameraType.d.ts +9 -1
  130. package/types/env-probe/CubeProbe.d.ts +2 -0
  131. package/types/env-probe/Probe.d.ts +1 -1
  132. package/types/graphic/Buffer.d.ts +23 -3
  133. package/types/graphic/BufferUtil.d.ts +8 -0
  134. package/types/graphic/IndexBufferBinding.d.ts +4 -0
  135. package/types/graphic/Mesh.d.ts +58 -1
  136. package/types/graphic/Primitive.d.ts +50 -1
  137. package/types/graphic/TransformFeedback.d.ts +46 -0
  138. package/types/graphic/TransformFeedbackPrimitive.d.ts +67 -0
  139. package/types/graphic/TransformFeedbackSimulator.d.ts +55 -0
  140. package/types/graphic/VertexBufferBinding.d.ts +4 -0
  141. package/types/graphic/VertexElement.d.ts +1 -0
  142. package/types/graphic/enums/BufferBindFlag.d.ts +5 -3
  143. package/types/index.d.ts +7 -4
  144. package/types/input/InputManager.d.ts +25 -6
  145. package/types/input/enums/PointerButton.d.ts +8 -0
  146. package/types/input/keyboard/KeyboardManager.d.ts +41 -1
  147. package/types/input/pointer/Pointer.d.ts +37 -1
  148. package/types/input/pointer/PointerEventData.d.ts +4 -0
  149. package/types/input/pointer/PointerManager.d.ts +58 -0
  150. package/types/input/pointer/emitter/IHitResult.d.ts +11 -1
  151. package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +20 -1
  152. package/types/input/wheel/WheelManager.d.ts +34 -1
  153. package/types/lighting/AmbientLight.d.ts +9 -8
  154. package/types/lighting/DirectLight.d.ts +17 -0
  155. package/types/lighting/KHR_lights.d.ts +13 -1
  156. package/types/lighting/Light.d.ts +2 -0
  157. package/types/lighting/LightManager.d.ts +57 -0
  158. package/types/lighting/PointLight.d.ts +17 -0
  159. package/types/lighting/SpotLight.d.ts +17 -0
  160. package/types/lighting/ambientOcclusion/AmbientOcclusion.d.ts +4 -0
  161. package/types/lighting/ambientOcclusion/ScalableAmbientObscurancePass.d.ts +38 -1
  162. package/types/material/BaseMaterial.d.ts +15 -11
  163. package/types/material/Material.d.ts +5 -9
  164. package/types/mesh/BlendShape.d.ts +14 -1
  165. package/types/mesh/BlendShapeFrame.d.ts +11 -4
  166. package/types/mesh/BlendShapeManager.d.ts +101 -1
  167. package/types/mesh/BufferMesh.d.ts +2 -2
  168. package/types/mesh/MeshRenderer.d.ts +42 -0
  169. package/types/mesh/ModelMesh.d.ts +23 -4
  170. package/types/mesh/PrimitiveMesh.d.ts +38 -4
  171. package/types/mesh/PrimitiveMeshRestorer.d.ts +107 -0
  172. package/types/mesh/Skin.d.ts +12 -3
  173. package/types/mesh/SkinnedMeshRenderer.d.ts +27 -1
  174. package/types/particle/ParticleBufferUtils.d.ts +26 -1
  175. package/types/particle/ParticleGenerator.d.ts +147 -2
  176. package/types/particle/ParticleMaterial.d.ts +3 -1
  177. package/types/particle/ParticleRenderer.d.ts +61 -1
  178. package/types/particle/ParticleTransformFeedbackSimulator.d.ts +52 -0
  179. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +25 -1
  180. package/types/particle/enums/ParticleScaleMode.d.ts +5 -5
  181. package/types/particle/enums/ParticleSubEmitterInheritProperty.d.ts +17 -0
  182. package/types/particle/enums/ParticleSubEmitterType.d.ts +9 -0
  183. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +6 -1
  184. package/types/particle/enums/attributes/ParticleFeedbackVertexAttribute.d.ts +8 -0
  185. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +17 -1
  186. package/types/particle/index.d.ts +7 -0
  187. package/types/particle/modules/Burst.d.ts +23 -2
  188. package/types/particle/modules/ColorOverLifetimeModule.d.ts +19 -0
  189. package/types/particle/modules/CustomDataModule.d.ts +90 -0
  190. package/types/particle/modules/EmissionModule.d.ts +36 -0
  191. package/types/particle/modules/ForceOverLifetimeModule.d.ts +16 -1
  192. package/types/particle/modules/LimitVelocityOverLifetimeModule.d.ts +164 -0
  193. package/types/particle/modules/MainModule.d.ts +45 -6
  194. package/types/particle/modules/NoiseModule.d.ts +114 -0
  195. package/types/particle/modules/ParticleCompositeCurve.d.ts +42 -4
  196. package/types/particle/modules/ParticleCompositeGradient.d.ts +8 -2
  197. package/types/particle/modules/ParticleCurve.d.ts +31 -2
  198. package/types/particle/modules/ParticleGeneratorModule.d.ts +9 -3
  199. package/types/particle/modules/ParticleGradient.d.ts +22 -5
  200. package/types/particle/modules/RotationOverLifetimeModule.d.ts +27 -3
  201. package/types/particle/modules/SizeOverLifetimeModule.d.ts +25 -0
  202. package/types/particle/modules/SubEmitter.d.ts +31 -0
  203. package/types/particle/modules/SubEmittersModule.d.ts +57 -0
  204. package/types/particle/modules/TextureSheetAnimationModule.d.ts +14 -1
  205. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +120 -0
  206. package/types/particle/modules/shape/BaseShape.d.ts +65 -2
  207. package/types/particle/modules/shape/BoxShape.d.ts +13 -2
  208. package/types/particle/modules/shape/CircleShape.d.ts +13 -1
  209. package/types/particle/modules/shape/ConeShape.d.ts +13 -4
  210. package/types/particle/modules/shape/HemisphereShape.d.ts +13 -0
  211. package/types/particle/modules/shape/MeshShape.d.ts +26 -3
  212. package/types/particle/modules/shape/ShapeUtils.d.ts +13 -1
  213. package/types/particle/modules/shape/SphereShape.d.ts +13 -0
  214. package/types/physics/CharacterController.d.ts +21 -0
  215. package/types/physics/Collider.d.ts +47 -2
  216. package/types/physics/Collision.d.ts +3 -0
  217. package/types/physics/DynamicCollider.d.ts +28 -1
  218. package/types/physics/HitResult.d.ts +2 -2
  219. package/types/physics/PhysicsMaterial.d.ts +3 -0
  220. package/types/physics/PhysicsScene.d.ts +56 -6
  221. package/types/physics/StaticCollider.d.ts +5 -0
  222. package/types/physics/enums/ColliderShapeChangeFlag.d.ts +8 -1
  223. package/types/physics/enums/HingeJointFlag.d.ts +14 -1
  224. package/types/physics/joint/HingeJoint.d.ts +4 -0
  225. package/types/physics/joint/Joint.d.ts +22 -2
  226. package/types/physics/joint/JointLimits.d.ts +2 -1
  227. package/types/physics/joint/JointMotor.d.ts +2 -1
  228. package/types/physics/shape/ColliderShape.d.ts +26 -3
  229. package/types/physics/shape/MeshColliderShape.d.ts +11 -5
  230. package/types/postProcess/FinalPass.d.ts +19 -1
  231. package/types/postProcess/PostProcess.d.ts +11 -6
  232. package/types/postProcess/PostProcessEffect.d.ts +6 -1
  233. package/types/postProcess/PostProcessEffectParameter.d.ts +23 -3
  234. package/types/postProcess/PostProcessManager.d.ts +43 -0
  235. package/types/postProcess/PostProcessPass.d.ts +3 -2
  236. package/types/postProcess/PostProcessUberPass.d.ts +2 -1
  237. package/types/postProcess/effects/BloomEffect.d.ts +26 -1
  238. package/types/postProcess/effects/TonemappingEffect.d.ts +3 -0
  239. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
  240. package/types/renderingHardwareInterface/IPlatformTransformFeedback.d.ts +36 -0
  241. package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +40 -0
  242. package/types/renderingHardwareInterface/index.d.ts +2 -0
  243. package/types/shader/Shader.d.ts +38 -22
  244. package/types/shader/ShaderBlockProperty.d.ts +19 -0
  245. package/types/shader/ShaderData.d.ts +43 -4
  246. package/types/shader/ShaderFactory.d.ts +78 -0
  247. package/types/shader/ShaderMacro.d.ts +17 -2
  248. package/types/shader/ShaderMacroCollection.d.ts +57 -1
  249. package/types/shader/ShaderMacroProcessor.d.ts +72 -0
  250. package/types/shader/ShaderPass.d.ts +46 -13
  251. package/types/shader/ShaderProgram.d.ts +91 -1
  252. package/types/shader/ShaderProgramMap.d.ts +20 -0
  253. package/types/shader/ShaderProperty.d.ts +17 -0
  254. package/types/shader/ShaderTagKey.d.ts +2 -0
  255. package/types/shader/ShaderUniform.d.ts +49 -1
  256. package/types/shader/ShaderUniformBlock.d.ts +9 -1
  257. package/types/shader/enums/ConstantBufferBindingPoint.d.ts +7 -0
  258. package/types/shader/enums/ShaderPreprocessorDirective.d.ts +16 -0
  259. package/types/shader/index.d.ts +1 -1
  260. package/types/shader/state/BlendState.d.ts +16 -1
  261. package/types/shader/state/DepthState.d.ts +16 -1
  262. package/types/shader/state/RasterState.d.ts +19 -1
  263. package/types/shader/state/RenderState.d.ts +13 -2
  264. package/types/shader/state/RenderTargetBlendState.d.ts +2 -1
  265. package/types/shader/state/StencilState.d.ts +15 -1
  266. package/types/shadow/CascadedShadowCasterPass.d.ts +5 -0
  267. package/types/shadow/ShadowSliceData.d.ts +13 -1
  268. package/types/shadow/ShadowUtils.d.ts +43 -1
  269. package/types/sky/Sky.d.ts +13 -4
  270. package/types/sky/SkyBoxMaterial.d.ts +0 -7
  271. package/types/texture/RenderTarget.d.ts +28 -3
  272. package/types/texture/Texture.d.ts +21 -0
  273. package/types/texture/Texture2D.d.ts +4 -0
  274. package/types/texture/Texture2DArray.d.ts +4 -0
  275. package/types/texture/TextureCube.d.ts +4 -0
  276. package/types/texture/TextureUtils.d.ts +16 -1
  277. package/types/trail/TrailRenderer.d.ts +13 -8
  278. package/types/ui/IUICanvas.d.ts +16 -1
  279. package/types/utils/DisorderedArray.d.ts +3 -1
  280. package/types/xr/XRManager.d.ts +28 -0
  281. package/types/RenderPipeline/BatchUtils.d.ts +0 -1
  282. package/types/RenderPipeline/SubRenderElement.d.ts +0 -22
  283. package/types/clone/CloneManager.d.ts +0 -31
  284. package/types/clone/enums/CloneMode.d.ts +0 -13
  285. package/types/shader/ShaderPool.d.ts +0 -1
  286. package/types/shader/ShaderProgramPool.d.ts +0 -1
  287. package/types/shader/state/index.d.ts +0 -6
  288. package/types/shaderlib/ShaderFactory.d.ts +0 -20
  289. package/types/shaderlib/ShaderLib.d.ts +0 -73
  290. package/types/shaderlib/index.d.ts +0 -1
  291. package/types/shaderlib/particle/index.d.ts +0 -15
  292. package/types/shaderlib/pbr/index.d.ts +0 -11
  293. package/types/shaderlib/shadow/index.d.ts +0 -8
@@ -1,5 +1,8 @@
1
1
  export { BasicRenderPipeline, RenderQueueFlags } from "./BasicRenderPipeline";
2
- export { BatchUtils } from "./BatchUtils";
2
+ export { VertexMergeBatcher } from "./VertexMergeBatcher";
3
+ /** @internal */
4
+ export type { PrimitiveChunkManager } from "./PrimitiveChunkManager";
3
5
  export { Blitter } from "./Blitter";
6
+ export { RenderElement } from "./RenderElement";
4
7
  export { RenderQueue } from "./RenderQueue";
5
8
  export { PipelineStage } from "./enums/PipelineStage";
@@ -1,38 +1,53 @@
1
- import { BoundingBox, Matrix, Vector4 } from "@galacean/engine-math";
1
+ import { BoundingBox, Vector4 } from "@galacean/engine-math";
2
+ import { SpriteMaskInteraction } from "./2d/enums/SpriteMaskInteraction";
2
3
  import { Component } from "./Component";
3
4
  import { Entity } from "./Entity";
4
5
  import { RenderContext } from "./RenderPipeline/RenderContext";
6
+ import { RenderElement } from "./RenderPipeline/RenderElement";
5
7
  import { TransformModifyFlags } from "./Transform";
6
- import { IComponentCustomClone } from "./clone/ComponentCloner";
8
+ import type { ICloneHook } from "./clone/ICloneHook";
7
9
  import { SpriteMaskLayer } from "./enums/SpriteMaskLayer";
8
10
  import { Material } from "./material";
11
+ import { ShaderProperty } from "./shader";
9
12
  import { ShaderData } from "./shader/ShaderData";
13
+ import { ShaderMacroCollection } from "./shader/ShaderMacroCollection";
10
14
  /**
11
15
  * Basis for all renderers.
12
16
  * @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
13
17
  */
14
- export declare class Renderer extends Component implements IComponentCustomClone {
18
+ export declare class Renderer extends Component implements ICloneHook<Renderer> {
15
19
  private static _tempVector0;
20
+ /** @internal */
21
+ static _worldMatrixProperty: ShaderProperty;
22
+ /** @internal */
23
+ static _rendererLayerProperty: ShaderProperty;
16
24
  private static _receiveShadowMacro;
17
- private static _localMatrixProperty;
18
- private static _worldMatrixProperty;
19
25
  private static _mvMatrixProperty;
20
26
  private static _mvpMatrixProperty;
21
- private static _mvInvMatrixProperty;
22
27
  private static _normalMatrixProperty;
23
- private static _rendererLayerProperty;
28
+ /** @internal */
29
+ _distanceForSort: number;
30
+ /** @internal */
31
+ _onUpdateIndex: number;
32
+ /** @internal */
33
+ _rendererIndex: number;
34
+ /** @internal */
35
+ _globalShaderMacro: ShaderMacroCollection;
36
+ /** @internal */
24
37
  _renderFrameCount: number;
38
+ /** @internal */
39
+ _maskInteraction: SpriteMaskInteraction;
40
+ /** @internal */
25
41
  _maskLayer: SpriteMaskLayer;
26
42
  protected _overrideUpdate: boolean;
27
- protected _materials: Material[];
43
+ protected _materials: (Material | null)[];
28
44
  protected _dirtyUpdateFlag: number;
29
45
  protected _rendererLayer: Vector4;
30
46
  protected _bounds: BoundingBox;
31
- protected _transformEntity: Entity;
47
+ protected _transformEntity: Entity | null;
32
48
  private _shaderData;
33
49
  private _mvMatrix;
34
50
  private _mvpMatrix;
35
- private _mvInvMatrix;
36
51
  private _normalMatrix;
37
52
  private _materialsInstanced;
38
53
  private _priority;
@@ -66,6 +81,10 @@ export declare class Renderer extends Component implements IComponentCustomClone
66
81
  */
67
82
  get priority(): number;
68
83
  set priority(value: number);
84
+ /**
85
+ * @internal
86
+ */
87
+ constructor(entity: Entity);
69
88
  /**
70
89
  * Get the first instance material.
71
90
  * @returns The first instance material
@@ -93,36 +112,80 @@ export declare class Renderer extends Component implements IComponentCustomClone
93
112
  * Set the first material.
94
113
  * @param material - The first material
95
114
  */
96
- setMaterial(material: Material): void;
115
+ setMaterial(material: Material | null): void;
97
116
  /**
98
117
  * Set material by index.
99
118
  * @param index - Material index
100
119
  * @param material - The material
101
120
  */
102
- setMaterial(index: number, material: Material): void;
121
+ setMaterial(index: number, material: Material | null): void;
103
122
  /**
104
123
  * Get all instance materials.
105
124
  * @remarks Calling this function for the first time after the material is set will create an instance material to ensure that it is unique to the renderer.
106
125
  * @returns All instance materials
107
126
  */
108
- getInstanceMaterials(): Readonly<Material[]>;
127
+ getInstanceMaterials(): Readonly<(Material | null)[]>;
109
128
  /**
110
129
  * Get all materials.
111
130
  * @returns All materials
112
131
  */
113
- getMaterials(): Readonly<Material[]>;
132
+ getMaterials(): Readonly<(Material | null)[]>;
114
133
  /**
115
134
  * Set all materials.
116
135
  * @param materials - All materials
117
136
  */
118
- setMaterials(materials: Material[]): void;
137
+ setMaterials(materials: (Material | null)[]): void;
119
138
  update(deltaTime: number): void;
120
139
  /**
121
- * Update once per frame per renderer, not influenced by batched.
140
+ * @internal
141
+ */
142
+ _onEnableInScene(): void;
143
+ /**
144
+ * @internal
145
+ */
146
+ _onDisableInScene(): void;
147
+ /**
148
+ * @internal
149
+ */
150
+ _prepareRender(context: RenderContext): void;
151
+ /**
152
+ * @internal
153
+ * @inheritdoc
154
+ */
155
+ _onClone(target: Renderer): void;
156
+ /**
157
+ * @internal
158
+ */
159
+ _isFrontFaceInvert(): boolean;
160
+ /**
161
+ * @internal
162
+ */
163
+ protected _onDestroy(): void;
164
+ /**
165
+ * @internal
166
+ */
167
+ _updateTransformShaderData(context: RenderContext, onlyMVP: boolean): void;
168
+ /**
169
+ * @internal
170
+ */
171
+ _canBatch(preElement: RenderElement, curElement: RenderElement): boolean;
172
+ /**
173
+ * @internal
174
+ */
175
+ _batch(preElement: RenderElement | null, curElement: RenderElement): void;
176
+ /**
177
+ * Update once per frame per renderer.
122
178
  */
123
179
  protected _update(context: RenderContext): void;
124
- protected _updateWorldViewRelatedShaderData(context: RenderContext, worldMatrix: Matrix, batched: boolean): void;
125
- protected _updateProjectionRelatedShaderData(context: RenderContext, worldMatrix: Matrix, batched: boolean): void;
180
+ /**
181
+ * Update transform shader data for world-space vertices (2D renderers).
182
+ * Vertices are already in world space, so model matrix is identity.
183
+ */
184
+ protected _updateWorldSpaceTransformShaderData(context: RenderContext, onlyMVP: boolean): void;
185
+ /**
186
+ * @internal
187
+ */
188
+ protected _setTransformEntity(entity: Entity | null): void;
126
189
  protected _updateBounds(worldBounds: BoundingBox): void;
127
190
  protected _render(context: RenderContext): void;
128
191
  private _createInstanceMaterial;
package/types/Scene.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  import { Color, Vector3 } from "@galacean/engine-math";
2
2
  import { Background } from "./Background";
3
+ import { ComponentsManager } from "./ComponentsManager";
3
4
  import { Engine } from "./Engine";
4
5
  import { Entity } from "./Entity";
6
+ import { MaskManager } from "./RenderPipeline/MaskManager";
7
+ import { SceneManager } from "./SceneManager";
5
8
  import { EngineObject } from "./base";
6
9
  import { FogMode } from "./enums/FogMode";
7
10
  import { AmbientOcclusion, DirectLight } from "./lighting";
8
11
  import { AmbientLight } from "./lighting/AmbientLight";
12
+ import { LightManager } from "./lighting/LightManager";
9
13
  import { PhysicsScene } from "./physics/PhysicsScene";
10
14
  import { PostProcessManager } from "./postProcess";
11
15
  import { ShaderData } from "./shader/ShaderData";
@@ -46,6 +50,18 @@ export declare class Scene extends EngineObject {
46
50
  * such as corners, crevices, and contact points between surfaces.
47
51
  */
48
52
  readonly ambientOcclusion: AmbientOcclusion;
53
+ /** @internal */
54
+ _lightManager: LightManager;
55
+ /** @internal */
56
+ _componentsManager: ComponentsManager;
57
+ /** @internal */
58
+ _maskManager: MaskManager;
59
+ /** @internal */
60
+ _isActiveInEngine: boolean;
61
+ /** @internal */
62
+ _sceneManager: SceneManager | null;
63
+ /** @internal */
64
+ _rootEntities: Entity[];
49
65
  private _background;
50
66
  private _shaderData;
51
67
  private _shadowCascades;
@@ -121,10 +137,9 @@ export declare class Scene extends EngineObject {
121
137
  */
122
138
  get rootEntities(): Readonly<Entity[]>;
123
139
  /**
124
- * Sun light source.
125
- * @remarks If set this to null, scene will use the brightest directional light.
140
+ * The explicit sun light; null or undefined enables automatic selection.
126
141
  */
127
- get sun(): DirectLight | null;
142
+ get sun(): DirectLight | null | undefined;
128
143
  set sun(light: DirectLight | null);
129
144
  /**
130
145
  * Whether to enable transparent shadow.
@@ -160,11 +175,11 @@ export declare class Scene extends EngineObject {
160
175
  */
161
176
  removeRootEntity(entity: Entity): void;
162
177
  /**
163
- * Get root entity from index.
164
- * @param index - Index
165
- * @returns Entity
178
+ * Get a root entity by index.
179
+ * @param index - The zero-based root entity index
180
+ * @returns The root entity at the index, or undefined if none exists
166
181
  */
167
- getRootEntity(index?: number): Entity | null;
182
+ getRootEntity(index?: number): Entity | undefined;
168
183
  /**
169
184
  * Find entity globally by name.
170
185
  * @param name - Entity name
@@ -177,6 +192,18 @@ export declare class Scene extends EngineObject {
177
192
  * @returns Entity
178
193
  */
179
194
  findEntityByPath(path: string): Entity | null;
195
+ /**
196
+ * @internal
197
+ */
198
+ _processActive(active: boolean): void;
199
+ /**
200
+ * @internal
201
+ */
202
+ _updateShaderData(): void;
203
+ /**
204
+ * @internal
205
+ */
206
+ protected _onDestroy(): void;
180
207
  private _computeLinearFogParams;
181
208
  private _computeExponentialFogParams;
182
209
  private _getSunlight;
@@ -1,15 +1,24 @@
1
1
  import { Engine } from "./Engine";
2
2
  import { Scene } from "./Scene";
3
3
  import { AssetPromise } from "./asset/AssetPromise";
4
+ import { SafeLoopArray } from "./utils/SafeLoopArray";
4
5
  /**
5
6
  * Scene manager.
6
7
  */
7
8
  export declare class SceneManager {
8
9
  readonly engine: Engine;
10
+ /** @internal */
11
+ _allCreatedScenes: Scene[];
12
+ /** @internal */
13
+ _scenes: SafeLoopArray<Scene>;
9
14
  /**
10
15
  * Get the scene list.
11
16
  */
12
17
  get scenes(): ReadonlyArray<Scene>;
18
+ /**
19
+ * @internal
20
+ */
21
+ constructor(engine: Engine);
13
22
  /**
14
23
  * Add scene.
15
24
  * @param scene - The scene which want to be added
@@ -41,11 +50,14 @@ export declare class SceneManager {
41
50
  */
42
51
  mergeScenes(sourceScene: Scene, destScene: Scene): void;
43
52
  /**
44
- * @deprecated
45
- * Please use `scenes` instead.
46
- *
47
- * Get the first scene.
53
+ * @internal
54
+ */
55
+ _destroyAllScene(): void;
56
+ /**
57
+ * Get the first scene, or undefined if no scene is registered.
58
+ * @remarks Assigning null or undefined removes the first scene.
59
+ * @deprecated Please use `scenes` instead.
48
60
  */
49
- get activeScene(): Scene;
50
- set activeScene(scene: Scene);
61
+ get activeScene(): Scene | undefined;
62
+ set activeScene(scene: Scene | null | undefined);
51
63
  }
package/types/Script.d.ts CHANGED
@@ -7,6 +7,22 @@ import { Collision } from "./physics/Collision";
7
7
  * Script class, used for logic writing.
8
8
  */
9
9
  export declare class Script extends Component {
10
+ /** @internal */
11
+ _started: boolean;
12
+ /** @internal */
13
+ _onStartIndex: number;
14
+ /** @internal */
15
+ _onUpdateIndex: number;
16
+ /** @internal */
17
+ _onLateUpdateIndex: number;
18
+ /** @internal */
19
+ _onPhysicsUpdateIndex: number;
20
+ /** @internal */
21
+ _onPreRenderIndex: number;
22
+ /** @internal */
23
+ _onPostRenderIndex: number;
24
+ /** @internal */
25
+ _entityScriptsIndex: number;
10
26
  /**
11
27
  * Called when be enabled first time, only once.
12
28
  */
@@ -130,6 +146,31 @@ export declare class Script extends Component {
130
146
  * Called at the end of the destroyed frame.
131
147
  */
132
148
  onDestroy(): void;
149
+ /**
150
+ * @internal
151
+ */
152
+ _onAwake(): void;
153
+ /**
154
+ * @internal
155
+ */
156
+ _onEnable(): void;
157
+ /**
158
+ * @internal
159
+ */
160
+ _onDisable(): void;
161
+ /**
162
+ * @internal
163
+ */
164
+ _onEnableInScene(): void;
165
+ /**
166
+ * @internal
167
+ */
168
+ _onDisableInScene(): void;
169
+ /**
170
+ * @internal
171
+ */
172
+ protected _onDestroy(): void;
173
+ private _hasCollisionEventCallbacks;
133
174
  }
134
175
  export declare enum PointerMethods {
135
176
  onPointerDown = "onPointerDown",
@@ -0,0 +1,69 @@
1
+ import { DataObject } from "./base/DataObject";
2
+ import type { ICloneHook } from "./clone/ICloneHook";
3
+ import { Component } from "./Component";
4
+ /**
5
+ * Signal is a typed event mechanism for Galacean Engine.
6
+ * @typeParam T - Tuple type of the signal arguments
7
+ */
8
+ export declare class Signal<T extends any[] = []> extends DataObject implements ICloneHook<Signal<T>> {
9
+ private _listeners;
10
+ /**
11
+ * Add a listener for this signal.
12
+ * @param fn - The callback function
13
+ * @param target - The `this` context for the callback
14
+ */
15
+ on(fn: (...args: T) => void, target?: any): void;
16
+ /**
17
+ * Add a structured binding listener. Structured bindings support clone remapping.
18
+ * The target method will be invoked as `method(...signalArgs, ...args)` —
19
+ * runtime signal arguments come first, bound arguments are appended.
20
+ * @param target - The target component
21
+ * @param methodName - The method name to invoke on the target
22
+ * @param args - Pre-resolved arguments appended after the runtime signal arguments
23
+ */
24
+ on(target: Component, methodName: string, ...args: any[]): void;
25
+ /**
26
+ * Add a one-time listener that is automatically removed after first invocation.
27
+ * @param fn - The callback function
28
+ * @param target - The `this` context for the callback
29
+ */
30
+ once(fn: (...args: T) => void, target?: any): void;
31
+ /**
32
+ * Add a one-time structured binding listener.
33
+ * The target method will be invoked as `method(...signalArgs, ...args)` —
34
+ * runtime signal arguments come first, bound arguments are appended.
35
+ * @param target - The target component
36
+ * @param methodName - The method name to invoke on the target
37
+ * @param args - Pre-resolved arguments appended after the runtime signal arguments
38
+ */
39
+ once(target: Component, methodName: string, ...args: any[]): void;
40
+ /**
41
+ * Remove a listener. Both `fn` and `target` must match the values passed to `on`/`once`.
42
+ * @param fn - The callback function to remove
43
+ * @param target - The `this` context that was used when adding the listener
44
+ */
45
+ off(fn: (...args: T) => void, target?: any): void;
46
+ /**
47
+ * Remove a structured binding listener by target and method name.
48
+ * @param target - The target component
49
+ * @param methodName - The method name
50
+ */
51
+ off(target: Component, methodName: string): void;
52
+ /**
53
+ * Remove all listeners, or all listeners for a specific target.
54
+ * @param target - If provided, only remove listeners bound to this target
55
+ */
56
+ removeAll(target?: any): void;
57
+ /**
58
+ * Invoke the signal, calling all listeners in order.
59
+ * @param args - Arguments to pass to each listener
60
+ */
61
+ invoke(...args: T): void;
62
+ /**
63
+ * @internal
64
+ * @inheritdoc
65
+ */
66
+ _onClone(target: Signal<T>, cloneMap: ReadonlyMap<object, object>): void;
67
+ private _cloneArguments;
68
+ private _addListener;
69
+ }
@@ -10,6 +10,8 @@ export declare class SystemInfo {
10
10
  static platform: Platform;
11
11
  /** The operating system is running on. */
12
12
  static operatingSystem: string;
13
+ /** @internal */
14
+ static _isBrowser: boolean;
13
15
  /** Whether the system support SIMD. */
14
16
  private static _simdSupported;
15
17
  private static _webpSupported;
@@ -18,6 +20,17 @@ export declare class SystemInfo {
18
20
  */
19
21
  static get devicePixelRatio(): number;
20
22
  private static _parseAppleMobileOSVersion;
23
+ /**
24
+ * @internal
25
+ */
26
+ static _initialize(): void;
27
+ /**
28
+ * @internal
29
+ */
30
+ static _detectSIMDSupported(): boolean;
31
+ /**
32
+ * @internal
33
+ */
21
34
  static _checkWebpSupported(): AssetPromise<boolean>;
22
35
  /**
23
36
  * Checks whether the system supports the given texture format.
@@ -1,10 +1,13 @@
1
1
  import { Matrix, Quaternion, Vector3 } from "@galacean/engine-math";
2
2
  import { BoolUpdateFlag } from "./BoolUpdateFlag";
3
3
  import { Component } from "./Component";
4
+ import { Entity } from "./Entity";
5
+ import type { ICloneHook } from "./clone/ICloneHook";
4
6
  /**
5
7
  * Used to implement transformation related functions.
8
+ * @remarks A `Transform` subclass must not declare component dependencies.
6
9
  */
7
- export declare class Transform extends Component {
10
+ export declare class Transform extends Component implements ICloneHook<Transform> {
8
11
  private static _tempQuat0;
9
12
  private static _tempVec30;
10
13
  private static _tempVec31;
@@ -87,6 +90,11 @@ export declare class Transform extends Component {
87
90
  */
88
91
  get worldMatrix(): Matrix;
89
92
  set worldMatrix(value: Matrix);
93
+ /**
94
+ * @internal
95
+ */
96
+ constructor(entity: Entity);
97
+ destroy(): void;
90
98
  /**
91
99
  * Set local position by X, Y, Z value.
92
100
  * @param x - X coordinate
@@ -192,6 +200,23 @@ export declare class Transform extends Component {
192
200
  * @param worldUp - Up direction in world space, default is Vector3(0, 1, 0)
193
201
  */
194
202
  lookAt(targetPosition: Vector3, worldUp?: Vector3): void;
203
+ /**
204
+ * @internal
205
+ */
206
+ _parentChange(): void;
207
+ /**
208
+ * @internal
209
+ */
210
+ _isFrontFaceInvert(): boolean;
211
+ /**
212
+ * @internal
213
+ */
214
+ _copyLocalPoseFrom(source: Transform): void;
215
+ /**
216
+ * @internal
217
+ * @inheritdoc
218
+ */
219
+ _onClone(target: Transform): void;
195
220
  protected _onLocalMatrixChanging(): void;
196
221
  protected _onWorldMatrixChanging(): void;
197
222
  protected _isContainDirtyFlags(targetDirtyFlags: number): boolean;
@@ -1,13 +1,16 @@
1
+ import { UpdateFlagManager } from "./UpdateFlagManager";
1
2
  /**
2
3
  * Used to update tags.
3
4
  */
4
5
  export declare abstract class UpdateFlag {
6
+ /** @internal */
7
+ _flagManagers: UpdateFlagManager[];
5
8
  /**
6
9
  * Dispatch.
7
10
  * @param bit - Bit
8
11
  * @param param - Parameter
9
12
  */
10
- abstract dispatch(bit?: number, param?: Object): void;
13
+ abstract dispatch(bit?: number, param?: unknown): void;
11
14
  /**
12
15
  * Clear.
13
16
  */
@@ -1 +1,41 @@
1
- export {};
1
+ import { UpdateFlag } from "./UpdateFlag";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare class UpdateFlagManager {
6
+ /** Monotonic counter bumped on every `dispatch`; consumers can snapshot it for lazy pull-style cache invalidation. */
7
+ version: number;
8
+ _updateFlags: UpdateFlag[];
9
+ private _listeners;
10
+ /**
11
+ * Create a UpdateFlag.
12
+ * @returns - The UpdateFlag.
13
+ */
14
+ createFlag<T extends UpdateFlag>(type: new () => T): T;
15
+ /**
16
+ * Add a UpdateFlag.
17
+ * @param flag - The UpdateFlag.
18
+ */
19
+ addFlag(flag: UpdateFlag): void;
20
+ /**
21
+ * Remove a UpdateFlag.
22
+ * @param flag - The UpdateFlag.
23
+ */
24
+ removeFlag(flag: UpdateFlag): void;
25
+ /**
26
+ * Add a listener.
27
+ * @param listener - The listener
28
+ */
29
+ addListener(listener: (type?: number, param?: unknown) => void): void;
30
+ /**
31
+ * Remove a listener.
32
+ * @param listener - The listener
33
+ */
34
+ removeListener(listener: (type?: number, param?: unknown) => void): void;
35
+ /**
36
+ * Dispatch a event.
37
+ * @param type - Event type, usually in the form of enumeration
38
+ * @param param - Event param
39
+ */
40
+ dispatch(type?: number, param?: unknown): void;
41
+ }
package/types/Utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Matrix } from "@galacean/engine-math";
1
2
  export declare class Utils {
2
3
  /**
3
4
  * Fast remove an element from array.
@@ -32,6 +33,25 @@ export declare class Utils {
32
33
  * @returns The resolved url.
33
34
  */
34
35
  static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
36
+ /**
37
+ * @internal
38
+ */
39
+ static _floatMatrixMultiply(left: Matrix, re: Float32Array, rOffset: number, oe: Float32Array, offset: number): void;
40
+ /**
41
+ * @internal
42
+ * Simplify lodash get: https://github.com/lodash/lodash/blob/master/get.js.
43
+ * @param target - The object to query.
44
+ * @param path - The path of the property to get.
45
+ * @returns Returns the resolved value.
46
+ */
47
+ static _reflectGet(target: object, path: string): object | undefined;
48
+ /**
49
+ * @internal
50
+ * @remarks
51
+ * Modified based on v8.
52
+ * https://github.com/v8/v8/blob/7.2-lkgr/src/js/array.js
53
+ */
54
+ static _quickSort<T>(a: T[], from: number, to: number, compareFunc: Function): void;
35
55
  private static _stringToPath;
36
56
  private static _insertionSort;
37
57
  private static _encodePathComponents;
@@ -1 +1,16 @@
1
- export {};
1
+ import { DataObject } from "./base/DataObject";
2
+ import { Matrix, Vector3 } from "@galacean/engine-math";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare class VirtualCamera extends DataObject {
7
+ isOrthographic: boolean;
8
+ nearClipPlane: number;
9
+ farClipPlane: number;
10
+ position: Vector3;
11
+ viewMatrix: Matrix;
12
+ projectionMatrix: Matrix;
13
+ viewProjectionMatrix: Matrix;
14
+ /** Only orth mode use. */
15
+ forward: Vector3;
16
+ }
@@ -1,6 +1,7 @@
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
+ import { UpdateFlagManager } from "../UpdateFlagManager";
4
5
  import { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
5
6
  import { AnimationCurve } from "./animationCurve/AnimationCurve";
6
7
  import { AnimationEvent } from "./AnimationEvent";
@@ -10,6 +11,10 @@ import { KeyframeValueType } from "./Keyframe";
10
11
  */
11
12
  export declare class AnimationClip extends EngineObject {
12
13
  readonly name: string;
14
+ /** @internal */
15
+ _curveBindings: AnimationClipCurveBinding[];
16
+ /** @internal */
17
+ _updateFlagManager: UpdateFlagManager;
13
18
  private _length;
14
19
  private _events;
15
20
  /**
@@ -34,7 +39,7 @@ export declare class AnimationClip extends EngineObject {
34
39
  * @param time - The time when the event be triggered
35
40
  * @param parameter - The parameter that is stored in the event and will be sent to the function
36
41
  */
37
- addEvent(functionName: string, time: number, parameter: Object): void;
42
+ addEvent(functionName: string, time: number, parameter: object): void;
38
43
  /**
39
44
  * Adds an animation event to the clip.
40
45
  * @param event - The animation event
@@ -84,4 +89,10 @@ export declare class AnimationClip extends EngineObject {
84
89
  * Clears all curve bindings from the clip.
85
90
  */
86
91
  clearCurveBindings(): void;
92
+ /**
93
+ * Samples an animation at a given time.
94
+ * @param entity - The animated entity
95
+ * @param time - The time to sample an animation
96
+ */
97
+ sampleAnimation(entity: Entity, time: number): void;
87
98
  }