@galacean/engine-core 0.9.0-beta.80

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 (314) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/main.js +24255 -0
  4. package/dist/main.js.map +1 -0
  5. package/dist/miniprogram.js +24255 -0
  6. package/dist/module.js +24138 -0
  7. package/dist/module.js.map +1 -0
  8. package/package.json +26 -0
  9. package/types/2d/assembler/IAssembler.d.ts +1 -0
  10. package/types/2d/assembler/SimpleSpriteAssembler.d.ts +1 -0
  11. package/types/2d/assembler/SlicedSpriteAssembler.d.ts +1 -0
  12. package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
  13. package/types/2d/atlas/FontAtlas.d.ts +1 -0
  14. package/types/2d/atlas/SpriteAtlas.d.ts +36 -0
  15. package/types/2d/atlas/types.d.ts +53 -0
  16. package/types/2d/data/RenderData2D.d.ts +1 -0
  17. package/types/2d/data/VertexData2D.d.ts +1 -0
  18. package/types/2d/enums/FontStyle.d.ts +11 -0
  19. package/types/2d/enums/SpriteDrawMode.d.ts +9 -0
  20. package/types/2d/enums/SpriteMaskInteraction.d.ts +11 -0
  21. package/types/2d/enums/SpriteMaskLayer.d.ts +71 -0
  22. package/types/2d/enums/SpriteModifyFlags.d.ts +13 -0
  23. package/types/2d/enums/SpriteTileMode.d.ts +11 -0
  24. package/types/2d/enums/TextAlignment.d.ts +22 -0
  25. package/types/2d/enums/TextOverflow.d.ts +9 -0
  26. package/types/2d/index.d.ts +9 -0
  27. package/types/2d/sprite/Sprite.d.ts +97 -0
  28. package/types/2d/sprite/SpriteMask.d.ts +63 -0
  29. package/types/2d/sprite/SpriteRenderer.d.ts +77 -0
  30. package/types/2d/sprite/index.d.ts +3 -0
  31. package/types/2d/text/CharInfo.d.ts +1 -0
  32. package/types/2d/text/CharRenderData.d.ts +1 -0
  33. package/types/2d/text/CharRenderDataPool.d.ts +1 -0
  34. package/types/2d/text/Font.d.ts +26 -0
  35. package/types/2d/text/SubFont.d.ts +1 -0
  36. package/types/2d/text/TextRenderer.d.ts +123 -0
  37. package/types/2d/text/TextUtils.d.ts +1 -0
  38. package/types/2d/text/index.d.ts +2 -0
  39. package/types/Background.d.ts +43 -0
  40. package/types/BoolUpdateFlag.d.ts +12 -0
  41. package/types/Camera.d.ts +206 -0
  42. package/types/Canvas.d.ts +9 -0
  43. package/types/Component.d.ts +32 -0
  44. package/types/ComponentsDependencies.d.ts +17 -0
  45. package/types/ComponentsManager.d.ts +46 -0
  46. package/types/DisorderedArray.d.ts +18 -0
  47. package/types/Engine.d.ts +140 -0
  48. package/types/EngineSettings.d.ts +8 -0
  49. package/types/Entity.d.ts +151 -0
  50. package/types/Layer.d.ts +73 -0
  51. package/types/Platform.d.ts +15 -0
  52. package/types/RenderPipeline/Basic2DBatcher.d.ts +20 -0
  53. package/types/RenderPipeline/BasicRenderPipeline.d.ts +66 -0
  54. package/types/RenderPipeline/ClassPool.d.ts +17 -0
  55. package/types/RenderPipeline/MeshRenderData.d.ts +15 -0
  56. package/types/RenderPipeline/MeshRenderElement.d.ts +17 -0
  57. package/types/RenderPipeline/RenderContext.d.ts +1 -0
  58. package/types/RenderPipeline/RenderData.d.ts +7 -0
  59. package/types/RenderPipeline/RenderElement.d.ts +11 -0
  60. package/types/RenderPipeline/RenderPass.d.ts +55 -0
  61. package/types/RenderPipeline/RenderQueue.d.ts +38 -0
  62. package/types/RenderPipeline/SpriteBatcher.d.ts +1 -0
  63. package/types/RenderPipeline/SpriteElement.d.ts +13 -0
  64. package/types/RenderPipeline/SpriteMaskBatcher.d.ts +10 -0
  65. package/types/RenderPipeline/SpriteMaskElement.d.ts +10 -0
  66. package/types/RenderPipeline/SpriteMaskManager.d.ts +1 -0
  67. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +10 -0
  68. package/types/RenderPipeline/SpriteRenderData.d.ts +12 -0
  69. package/types/RenderPipeline/TextRenderData.d.ts +6 -0
  70. package/types/RenderPipeline/TextRenderElement.d.ts +6 -0
  71. package/types/RenderPipeline/enums/PipelineStage.d.ts +9 -0
  72. package/types/RenderPipeline/index.d.ts +4 -0
  73. package/types/Renderer.d.ts +119 -0
  74. package/types/Scene.d.ts +142 -0
  75. package/types/SceneManager.d.ts +28 -0
  76. package/types/Script.d.ts +118 -0
  77. package/types/SystemInfo.d.ts +14 -0
  78. package/types/Transform.d.ts +258 -0
  79. package/types/UpdateFlag.d.ts +20 -0
  80. package/types/UpdateFlagManager.d.ts +1 -0
  81. package/types/Utils.d.ts +3 -0
  82. package/types/VirtualCamera.d.ts +1 -0
  83. package/types/animation/AnimationClip.d.ts +58 -0
  84. package/types/animation/AnimationClipCurveBinding.d.ts +21 -0
  85. package/types/animation/AnimationEvent.d.ts +11 -0
  86. package/types/animation/Animator.d.ts +86 -0
  87. package/types/animation/AnimatorController.d.ts +32 -0
  88. package/types/animation/AnimatorControllerLayer.d.ts +18 -0
  89. package/types/animation/AnimatorState.d.ts +60 -0
  90. package/types/animation/AnimatorStateMachine.d.ts +37 -0
  91. package/types/animation/AnimatorTransition.d.ts +14 -0
  92. package/types/animation/Keyframe.d.ts +19 -0
  93. package/types/animation/StateMachineScript.d.ts +32 -0
  94. package/types/animation/animationCurve/AnimationArrayCurve.d.ts +7 -0
  95. package/types/animation/animationCurve/AnimationBoolCurve.d.ts +7 -0
  96. package/types/animation/animationCurve/AnimationColorCurve.d.ts +8 -0
  97. package/types/animation/animationCurve/AnimationCurve.d.ts +39 -0
  98. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +12 -0
  99. package/types/animation/animationCurve/AnimationFloatCurve.d.ts +7 -0
  100. package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +8 -0
  101. package/types/animation/animationCurve/AnimationVector2Curve.d.ts +8 -0
  102. package/types/animation/animationCurve/AnimationVector3Curve.d.ts +8 -0
  103. package/types/animation/animationCurve/AnimationVector4Curve.d.ts +8 -0
  104. package/types/animation/animationCurve/index.d.ts +10 -0
  105. package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +1 -0
  106. package/types/animation/enums/AnimatorConditionMode.d.ts +8 -0
  107. package/types/animation/enums/AnimatorCullingMode.d.ts +9 -0
  108. package/types/animation/enums/AnimatorLayerBlendingMode.d.ts +4 -0
  109. package/types/animation/enums/AnimatorStatePlayState.d.ts +1 -0
  110. package/types/animation/enums/InterpolationType.d.ts +13 -0
  111. package/types/animation/enums/LayerState.d.ts +13 -0
  112. package/types/animation/enums/PlayState.d.ts +13 -0
  113. package/types/animation/enums/WrapMode.d.ts +9 -0
  114. package/types/animation/index.d.ts +21 -0
  115. package/types/animation/internal/AnimationEventHandler.d.ts +1 -0
  116. package/types/animation/internal/AnimatorLayerData.d.ts +1 -0
  117. package/types/animation/internal/AnimatorStateData.d.ts +1 -0
  118. package/types/animation/internal/AnimatorStatePlayData.d.ts +1 -0
  119. package/types/animation/internal/AnimatorTempValue.d.ts +1 -0
  120. package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +5 -0
  121. package/types/animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +1 -0
  122. package/types/animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts +1 -0
  123. package/types/animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts +1 -0
  124. package/types/animation/internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts +1 -0
  125. package/types/animation/internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts +1 -0
  126. package/types/animation/internal/animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts +1 -0
  127. package/types/asset/AssetPromise.d.ts +56 -0
  128. package/types/asset/AssetType.d.ts +52 -0
  129. package/types/asset/ContentRestorer.d.ts +17 -0
  130. package/types/asset/GraphicsResource.d.ts +9 -0
  131. package/types/asset/IRefObject.d.ts +2 -0
  132. package/types/asset/IReferable.d.ts +2 -0
  133. package/types/asset/LoadItem.d.ts +33 -0
  134. package/types/asset/Loader.d.ts +30 -0
  135. package/types/asset/RefObject.d.ts +27 -0
  136. package/types/asset/ReferResource.d.ts +27 -0
  137. package/types/asset/ResourceManager.d.ts +95 -0
  138. package/types/asset/request.d.ts +25 -0
  139. package/types/base/Constant.d.ts +110 -0
  140. package/types/base/EngineObject.d.ts +24 -0
  141. package/types/base/Event.d.ts +24 -0
  142. package/types/base/EventDispatcher.d.ts +79 -0
  143. package/types/base/Logger.d.ts +11 -0
  144. package/types/base/StaticInterfaceImplement.d.ts +5 -0
  145. package/types/base/Time.d.ts +41 -0
  146. package/types/base/Util.d.ts +14 -0
  147. package/types/base/index.d.ts +7 -0
  148. package/types/clone/CloneManager.d.ts +31 -0
  149. package/types/clone/ComponentCloner.d.ts +14 -0
  150. package/types/clone/enums/CloneMode.d.ts +13 -0
  151. package/types/enums/BackgroundMode.d.ts +9 -0
  152. package/types/enums/BackgroundTextureFillMode.d.ts +8 -0
  153. package/types/enums/CameraClearFlags.d.ts +13 -0
  154. package/types/enums/ColorSpace.d.ts +9 -0
  155. package/types/enums/FogMode.d.ts +13 -0
  156. package/types/env-probe/CubeProbe.d.ts +34 -0
  157. package/types/env-probe/Probe.d.ts +58 -0
  158. package/types/env-probe/index.d.ts +2 -0
  159. package/types/graphic/Buffer.d.ts +105 -0
  160. package/types/graphic/BufferUtil.d.ts +11 -0
  161. package/types/graphic/IndexBufferBinding.d.ts +21 -0
  162. package/types/graphic/Mesh.d.ts +70 -0
  163. package/types/graphic/SubMesh.d.ts +19 -0
  164. package/types/graphic/VertexBufferBinding.d.ts +20 -0
  165. package/types/graphic/VertexElement.d.ts +44 -0
  166. package/types/graphic/enums/BufferBindFlag.d.ts +9 -0
  167. package/types/graphic/enums/BufferUsage.d.ts +11 -0
  168. package/types/graphic/enums/IndexFormat.d.ts +11 -0
  169. package/types/graphic/enums/MeshTopology.d.ts +19 -0
  170. package/types/graphic/enums/SetDataOptions.d.ts +9 -0
  171. package/types/graphic/enums/VertexElementFormat.d.ts +37 -0
  172. package/types/graphic/index.d.ts +13 -0
  173. package/types/index.d.ts +53 -0
  174. package/types/input/InputManager.d.ts +67 -0
  175. package/types/input/enums/Keys.d.ts +398 -0
  176. package/types/input/enums/PointerButton.d.ts +33 -0
  177. package/types/input/enums/PointerPhase.d.ts +15 -0
  178. package/types/input/index.d.ts +5 -0
  179. package/types/input/interface/IInput.d.ts +18 -0
  180. package/types/input/keyboard/KeyboardManager.d.ts +1 -0
  181. package/types/input/pointer/Pointer.d.ts +25 -0
  182. package/types/input/pointer/PointerManager.d.ts +1 -0
  183. package/types/input/wheel/WheelManager.d.ts +1 -0
  184. package/types/lighting/AmbientLight.d.ts +67 -0
  185. package/types/lighting/DirectLight.d.ts +21 -0
  186. package/types/lighting/KHR_lights.d.ts +4 -0
  187. package/types/lighting/Light.d.ts +48 -0
  188. package/types/lighting/LightManager.d.ts +5 -0
  189. package/types/lighting/PointLight.d.ts +18 -0
  190. package/types/lighting/SpotLight.d.ts +36 -0
  191. package/types/lighting/enums/DiffuseMode.d.ts +13 -0
  192. package/types/lighting/index.d.ts +6 -0
  193. package/types/material/BaseMaterial.d.ts +88 -0
  194. package/types/material/BlinnPhongMaterial.d.ts +71 -0
  195. package/types/material/Material.d.ts +51 -0
  196. package/types/material/PBRBaseMaterial.d.ts +101 -0
  197. package/types/material/PBRMaterial.d.ts +36 -0
  198. package/types/material/PBRSpecularMaterial.d.ts +38 -0
  199. package/types/material/UnlitMaterial.d.ts +33 -0
  200. package/types/material/enums/BlendMode.d.ts +9 -0
  201. package/types/material/enums/RenderFace.d.ts +11 -0
  202. package/types/material/enums/TextureCoordinate.d.ts +13 -0
  203. package/types/material/index.d.ts +10 -0
  204. package/types/mesh/BlendShape.d.ts +39 -0
  205. package/types/mesh/BlendShapeFrame.d.ts +22 -0
  206. package/types/mesh/BlendShapeManager.d.ts +1 -0
  207. package/types/mesh/BufferMesh.d.ts +59 -0
  208. package/types/mesh/MeshRenderer.d.ts +30 -0
  209. package/types/mesh/ModelMesh.d.ts +226 -0
  210. package/types/mesh/PrimitiveMesh.d.ts +86 -0
  211. package/types/mesh/PrimitiveMeshRestorer.d.ts +1 -0
  212. package/types/mesh/Skin.d.ts +16 -0
  213. package/types/mesh/SkinnedMeshRenderer.d.ts +62 -0
  214. package/types/mesh/enums/VertexAttribute.d.ts +33 -0
  215. package/types/mesh/index.d.ts +8 -0
  216. package/types/particle/ParticleRenderer.d.ts +235 -0
  217. package/types/particle/index.d.ts +1 -0
  218. package/types/physics/CharacterController.d.ts +53 -0
  219. package/types/physics/Collider.d.ts +29 -0
  220. package/types/physics/Collision.d.ts +4 -0
  221. package/types/physics/DynamicCollider.d.ts +161 -0
  222. package/types/physics/HitResult.d.ts +15 -0
  223. package/types/physics/PhysicsManager.d.ts +95 -0
  224. package/types/physics/PhysicsMaterial.d.ts +37 -0
  225. package/types/physics/StaticCollider.d.ts +7 -0
  226. package/types/physics/enums/ColliderShapeUpAxis.d.ts +11 -0
  227. package/types/physics/enums/ControllerCollisionFlag.d.ts +11 -0
  228. package/types/physics/enums/ControllerNonWalkableMode.d.ts +9 -0
  229. package/types/physics/enums/HingeJointFlag.d.ts +1 -0
  230. package/types/physics/enums/PhysicsMaterialCombineMode.d.ts +13 -0
  231. package/types/physics/enums/index.d.ts +4 -0
  232. package/types/physics/index.d.ts +10 -0
  233. package/types/physics/joint/FixedJoint.d.ts +3 -0
  234. package/types/physics/joint/HingeJoint.d.ts +57 -0
  235. package/types/physics/joint/Joint.d.ts +58 -0
  236. package/types/physics/joint/JointLimits.d.ts +15 -0
  237. package/types/physics/joint/JointMotor.d.ts +13 -0
  238. package/types/physics/joint/SpringJoint.d.ts +42 -0
  239. package/types/physics/joint/index.d.ts +6 -0
  240. package/types/physics/shape/BoxColliderShape.d.ts +15 -0
  241. package/types/physics/shape/CapsuleColliderShape.d.ts +26 -0
  242. package/types/physics/shape/ColliderShape.d.ts +51 -0
  243. package/types/physics/shape/PlaneColliderShape.d.ts +7 -0
  244. package/types/physics/shape/SphereColliderShape.d.ts +13 -0
  245. package/types/physics/shape/index.d.ts +5 -0
  246. package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +6 -0
  247. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +8 -0
  248. package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +20 -0
  249. package/types/renderingHardwareInterface/IPlatformTexture.d.ts +36 -0
  250. package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +37 -0
  251. package/types/renderingHardwareInterface/IPlatformTexture2DArray.d.ts +40 -0
  252. package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +41 -0
  253. package/types/renderingHardwareInterface/index.d.ts +6 -0
  254. package/types/shader/Shader.d.ts +72 -0
  255. package/types/shader/ShaderData.d.ts +350 -0
  256. package/types/shader/ShaderMacro.d.ts +10 -0
  257. package/types/shader/ShaderMacroCollection.d.ts +1 -0
  258. package/types/shader/ShaderPart.d.ts +41 -0
  259. package/types/shader/ShaderPass.d.ts +9 -0
  260. package/types/shader/ShaderPool.d.ts +1 -0
  261. package/types/shader/ShaderProgram.d.ts +1 -0
  262. package/types/shader/ShaderProgramPool.d.ts +1 -0
  263. package/types/shader/ShaderProperty.d.ts +13 -0
  264. package/types/shader/ShaderTagKey.d.ts +16 -0
  265. package/types/shader/ShaderUniform.d.ts +1 -0
  266. package/types/shader/ShaderUniformBlock.d.ts +1 -0
  267. package/types/shader/SubShader.d.ts +19 -0
  268. package/types/shader/enums/BlendFactor.d.ts +32 -0
  269. package/types/shader/enums/BlendOperation.d.ts +16 -0
  270. package/types/shader/enums/ColorWriteMask.d.ts +18 -0
  271. package/types/shader/enums/CompareFunction.d.ts +22 -0
  272. package/types/shader/enums/CullMode.d.ts +12 -0
  273. package/types/shader/enums/RenderQueueType.d.ts +11 -0
  274. package/types/shader/enums/ShaderDataGroup.d.ts +13 -0
  275. package/types/shader/enums/ShaderPropertyType.d.ts +27 -0
  276. package/types/shader/enums/StencilOperation.d.ts +22 -0
  277. package/types/shader/index.d.ts +12 -0
  278. package/types/shader/state/BlendState.d.ts +16 -0
  279. package/types/shader/state/DepthState.d.ts +14 -0
  280. package/types/shader/state/RasterState.d.ts +13 -0
  281. package/types/shader/state/RenderState.d.ts +20 -0
  282. package/types/shader/state/RenderTargetBlendState.d.ts +24 -0
  283. package/types/shader/state/StencilState.d.ts +34 -0
  284. package/types/shaderlib/ShaderFactory.d.ts +17 -0
  285. package/types/shaderlib/ShaderLib.d.ts +58 -0
  286. package/types/shaderlib/index.d.ts +1 -0
  287. package/types/shaderlib/pbr/index.d.ts +9 -0
  288. package/types/shaderlib/shadow/index.d.ts +8 -0
  289. package/types/shadow/CascadedShadowCasterPass.d.ts +47 -0
  290. package/types/shadow/ShadowSliceData.d.ts +1 -0
  291. package/types/shadow/ShadowUtils.d.ts +1 -0
  292. package/types/shadow/enum/ShadowCascadesMode.d.ts +11 -0
  293. package/types/shadow/enum/ShadowResolution.d.ts +13 -0
  294. package/types/shadow/enum/ShadowType.d.ts +13 -0
  295. package/types/shadow/index.d.ts +3 -0
  296. package/types/sky/Sky.d.ts +14 -0
  297. package/types/sky/SkyBoxMaterial.d.ts +25 -0
  298. package/types/sky/SkyProceduralMaterial.d.ts +72 -0
  299. package/types/sky/index.d.ts +2 -0
  300. package/types/texture/RenderTarget.d.ts +95 -0
  301. package/types/texture/Texture.d.ts +77 -0
  302. package/types/texture/Texture2D.d.ts +68 -0
  303. package/types/texture/Texture2DArray.d.ts +81 -0
  304. package/types/texture/TextureCube.d.ts +70 -0
  305. package/types/texture/enums/RenderBufferDepthFormat.d.ts +21 -0
  306. package/types/texture/enums/TextureCubeFace.d.ts +17 -0
  307. package/types/texture/enums/TextureDepthCompareFunction.d.ts +21 -0
  308. package/types/texture/enums/TextureFilterMode.d.ts +11 -0
  309. package/types/texture/enums/TextureFormat.d.ts +69 -0
  310. package/types/texture/enums/TextureWrapMode.d.ts +11 -0
  311. package/types/texture/index.d.ts +11 -0
  312. package/types/trail/TrailMaterial.d.ts +5 -0
  313. package/types/trail/TrailRenderer.d.ts +40 -0
  314. package/types/trail/index.d.ts +2 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Used to update tags.
3
+ */
4
+ export declare abstract class UpdateFlag {
5
+ /**
6
+ * Dispatch.
7
+ * @param bit - Bit
8
+ * @param param - Parameter
9
+ */
10
+ abstract dispatch(bit?: number, param?: Object): void;
11
+ /**
12
+ * Clear.
13
+ */
14
+ clearFromManagers(): void;
15
+ /**
16
+ * Destroy.
17
+ */
18
+ destroy(): void;
19
+ private _removeFromManagers;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare class Utils {
2
+ private static _stringToPath;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,58 @@
1
+ import { Component } from "../Component";
2
+ import { Entity } from "../Entity";
3
+ import { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
4
+ import { AnimationCurve } from "./animationCurve/AnimationCurve";
5
+ import { AnimationEvent } from "./AnimationEvent";
6
+ import { KeyframeValueType } from "./Keyframe";
7
+ /**
8
+ * Stores keyframe based animations.
9
+ */
10
+ export declare class AnimationClip {
11
+ readonly name: string;
12
+ private _length;
13
+ private _events;
14
+ /**
15
+ * Animation events for this animation clip.
16
+ */
17
+ get events(): Readonly<AnimationEvent[]>;
18
+ /**
19
+ * Animation curve bindings for this animation clip.
20
+ */
21
+ get curveBindings(): Readonly<AnimationClipCurveBinding[]>;
22
+ /**
23
+ * Animation length in seconds.
24
+ */
25
+ get length(): number;
26
+ /**
27
+ * @param name - The AnimationClip's name
28
+ */
29
+ constructor(name: string);
30
+ /**
31
+ * Adds an animation event to the clip.
32
+ * @param functionName - The name of the method called in the script
33
+ * @param time - The time when the event be triggered
34
+ * @param parameter - The parameter that is stored in the event and will be sent to the function
35
+ */
36
+ addEvent(functionName: string, time: number, parameter: Object): void;
37
+ /**
38
+ * Adds an animation event to the clip.
39
+ * @param event - The animation event
40
+ */
41
+ addEvent(event: AnimationEvent): void;
42
+ /**
43
+ * Clears all events from the clip.
44
+ */
45
+ clearEvents(): void;
46
+ /**
47
+ * Add curve binding for the clip.
48
+ * @param relativePath - Path to the game object this curve applies to. The relativePath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
49
+ * @param type- The class type of the component that is animated
50
+ * @param propertyName - The name or path to the property being animated
51
+ * @param curve - The animation curve
52
+ */
53
+ addCurveBinding<T extends Component>(relativePath: string, type: new (entity: Entity) => T, propertyName: string, curve: AnimationCurve<KeyframeValueType>): void;
54
+ /**
55
+ * Clears all curve bindings from the clip.
56
+ */
57
+ clearCurveBindings(): void;
58
+ }
@@ -0,0 +1,21 @@
1
+ import { Component } from "../Component";
2
+ import { Entity } from "../Entity";
3
+ import { AnimationCurve } from "./animationCurve";
4
+ import { KeyframeValueType } from "./Keyframe";
5
+ /**
6
+ * Associate AnimationCurve and the Entity
7
+ */
8
+ export declare class AnimationClipCurveBinding {
9
+ /**
10
+ * Path to the entity this curve applies to. The relativePath is formatted similar to a pathname,
11
+ * e.g. "root/spine/leftArm". If relativePath is empty it refers to the entity the animation clip is attached to.
12
+ */
13
+ relativePath: string;
14
+ /** The class type of the component that is animated. */
15
+ type: new (entity: Entity) => Component;
16
+ /** The name or path to the property being animated. */
17
+ property: string;
18
+ /** The animation curve. */
19
+ curve: AnimationCurve<KeyframeValueType>;
20
+ private _tempCurveOwner;
21
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * AnimationEvent lets you call a script function similar to SendMessage as part of playing back an animation.
3
+ */
4
+ export declare class AnimationEvent {
5
+ /** The time when the event be triggered. */
6
+ time: number;
7
+ /** The name of the method called in the script. */
8
+ functionName: string;
9
+ /** The parameter that is stored in the event and will be sent to the function. */
10
+ parameter: Object;
11
+ }
@@ -0,0 +1,86 @@
1
+ import { BoolUpdateFlag } from "../BoolUpdateFlag";
2
+ import { Component } from "../Component";
3
+ import { AnimatorController } from "./AnimatorController";
4
+ import { AnimatorState } from "./AnimatorState";
5
+ import { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
6
+ /**
7
+ * The controller of the animation system.
8
+ */
9
+ export declare class Animator extends Component {
10
+ /** Culling mode of this Animator. */
11
+ cullingMode: AnimatorCullingMode;
12
+ /** The playback speed of the Animator, 1.0 is normal playback speed. */
13
+ speed: number;
14
+ protected _animatorController: AnimatorController;
15
+ protected _controllerUpdateFlag: BoolUpdateFlag;
16
+ private _animatorLayersData;
17
+ private _crossOwnerCollection;
18
+ private _animationCurveOwners;
19
+ private _animationEventHandlerPool;
20
+ private _tempAnimatorStateInfo;
21
+ private _controlledRenderers;
22
+ /**
23
+ * All layers from the AnimatorController which belongs this Animator.
24
+ */
25
+ get animatorController(): AnimatorController;
26
+ set animatorController(animatorController: AnimatorController);
27
+ /**
28
+ * Play a state by name.
29
+ * @param stateName - The state name
30
+ * @param layerIndex - The layer index(default -1). If layer is -1, play the first state with the given state name
31
+ * @param normalizedTimeOffset - The time offset between 0 and 1(default 0)
32
+ */
33
+ play(stateName: string, layerIndex?: number, normalizedTimeOffset?: number): void;
34
+ /**
35
+ * Create a cross fade from the current state to another state.
36
+ * @param stateName - The state name
37
+ * @param normalizedTransitionDuration - The duration of the transition (normalized)
38
+ * @param layerIndex - The layer index(default -1). If layer is -1, play the first state with the given state name
39
+ * @param normalizedTimeOffset - The time offset between 0 and 1(default 0)
40
+ */
41
+ crossFade(stateName: string, normalizedTransitionDuration: number, layerIndex?: number, normalizedTimeOffset?: number): void;
42
+ /**
43
+ * Evaluates the animator component based on deltaTime.
44
+ * @param deltaTime - The deltaTime when the animation update
45
+ */
46
+ update(deltaTime: number): void;
47
+ /**
48
+ * Get the playing state from the target layerIndex.
49
+ * @param layerIndex - The layer index
50
+ */
51
+ getCurrentAnimatorState(layerIndex: number): AnimatorState;
52
+ /**
53
+ * Get the state by name.
54
+ * @param stateName - The state name
55
+ * @param layerIndex - The layer index(default -1). If layer is -1, find the first state with the given state name
56
+ */
57
+ findAnimatorState(stateName: string, layerIndex?: number): AnimatorState;
58
+ private _getAnimatorStateInfo;
59
+ private _saveDefaultValues;
60
+ private _getAnimatorStateData;
61
+ private _saveAnimatorStateData;
62
+ private _saveAnimatorEventHandlers;
63
+ private _clearCrossData;
64
+ private _addCrossCurveData;
65
+ private _prepareCrossFading;
66
+ private _prepareStandbyCrossFading;
67
+ private _prepareFixedPoseCrossFading;
68
+ private _prepareSrcCrossData;
69
+ private _prepareDestCrossData;
70
+ private _getAnimatorLayerData;
71
+ private _updateLayer;
72
+ private _updatePlayingState;
73
+ private _updateCrossFade;
74
+ private _updateCrossFadeFromPose;
75
+ private _updateCrossFadeData;
76
+ private _preparePlay;
77
+ private _checkTransition;
78
+ private _crossFadeByTransition;
79
+ private _fireAnimationEvents;
80
+ private _fireSubAnimationEvents;
81
+ private _fireBackwardSubAnimationEvents;
82
+ private _callAnimatorScriptOnEnter;
83
+ private _callAnimatorScriptOnUpdate;
84
+ private _callAnimatorScriptOnExit;
85
+ private _checkAutoPlay;
86
+ }
@@ -0,0 +1,32 @@
1
+ import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
2
+ /**
3
+ * Store the data for Animator playback.
4
+ */
5
+ export declare class AnimatorController {
6
+ private _updateFlagManager;
7
+ private _layers;
8
+ private _layersMap;
9
+ /**
10
+ * The layers in the controller.
11
+ */
12
+ get layers(): Readonly<AnimatorControllerLayer[]>;
13
+ /**
14
+ * Get the layer by name.
15
+ * @param name - The layer's name.
16
+ */
17
+ findLayerByName(name: string): AnimatorControllerLayer;
18
+ /**
19
+ * Add a layer to the controller.
20
+ * @param layer - The layer to add
21
+ */
22
+ addLayer(layer: AnimatorControllerLayer): void;
23
+ /**
24
+ * Remove a layer from the controller.
25
+ * @param layerIndex - The index of the AnimatorLayer
26
+ */
27
+ removeLayer(layerIndex: number): void;
28
+ /**
29
+ * Clear layers.
30
+ */
31
+ clearLayers(): void;
32
+ }
@@ -0,0 +1,18 @@
1
+ import { AnimatorStateMachine } from "./AnimatorStateMachine";
2
+ import { AnimatorLayerBlendingMode } from "./enums/AnimatorLayerBlendingMode";
3
+ /**
4
+ * The Animation Layer contains a state machine that controls animations of a model or part of it.
5
+ */
6
+ export declare class AnimatorControllerLayer {
7
+ readonly name: string;
8
+ /** The blending weight that the layers has. It is not taken into account for the first layer. */
9
+ weight: number;
10
+ /** The blending mode used by the layer. It is not taken into account for the first layer. */
11
+ blendingMode: AnimatorLayerBlendingMode;
12
+ /** The state machine for the layer. */
13
+ stateMachine: AnimatorStateMachine;
14
+ /**
15
+ * @param name - The layer's name
16
+ */
17
+ constructor(name: string);
18
+ }
@@ -0,0 +1,60 @@
1
+ import { AnimationClip } from "./AnimationClip";
2
+ import { AnimatorStateTransition } from "./AnimatorTransition";
3
+ import { WrapMode } from "./enums/WrapMode";
4
+ import { StateMachineScript } from "./StateMachineScript";
5
+ /**
6
+ * States are the basic building blocks of a state machine. Each state contains a AnimationClip which will play while the character is in that state.
7
+ */
8
+ export declare class AnimatorState {
9
+ readonly name: string;
10
+ /** The speed of the clip. 1 is normal speed, default 1. */
11
+ speed: number;
12
+ /** The wrap mode used in the state. */
13
+ wrapMode: WrapMode;
14
+ private _clipStartTime;
15
+ private _clipEndTime;
16
+ private _clip;
17
+ private _transitions;
18
+ /**
19
+ * The transitions that are going out of the state.
20
+ */
21
+ get transitions(): Readonly<AnimatorStateTransition[]>;
22
+ /**
23
+ * The clip that is being played by this animator state.
24
+ */
25
+ get clip(): AnimationClip;
26
+ set clip(clip: AnimationClip);
27
+ /**
28
+ * The start time of the clip, the range is 0 to 1, default is 0.
29
+ */
30
+ get clipStartTime(): number;
31
+ set clipStartTime(time: number);
32
+ /**
33
+ * The end time of the clip, the range is 0 to 1, default is 1.
34
+ */
35
+ get clipEndTime(): number;
36
+ set clipEndTime(time: number);
37
+ /**
38
+ * @param name - The state's name
39
+ */
40
+ constructor(name: string);
41
+ /**
42
+ * Add an outgoing transition to the destination state.
43
+ * @param transition - The transition
44
+ */
45
+ addTransition(transition: AnimatorStateTransition): void;
46
+ /**
47
+ * Remove a transition from the state.
48
+ * @param transition - The transition
49
+ */
50
+ removeTransition(transition: AnimatorStateTransition): void;
51
+ /**
52
+ * Adds a state machine script class of type T to the AnimatorState.
53
+ * @param scriptType - The state machine script class of type T
54
+ */
55
+ addStateMachineScript<T extends StateMachineScript>(scriptType: new () => T): T;
56
+ /**
57
+ * Clears all transitions from the state.
58
+ */
59
+ clearTransitions(): void;
60
+ }
@@ -0,0 +1,37 @@
1
+ import { AnimatorState } from "./AnimatorState";
2
+ export interface AnimatorStateMap {
3
+ [key: string]: AnimatorState;
4
+ }
5
+ /**
6
+ * A graph controlling the interaction of states. Each state references a motion.
7
+ */
8
+ export declare class AnimatorStateMachine {
9
+ /** The list of states. */
10
+ readonly states: AnimatorState[];
11
+ /**
12
+ * The state will be played automatically.
13
+ * @remarks When the Animator's AnimatorController changed or the Animator's onEnable be triggered.
14
+ */
15
+ defaultState: AnimatorState;
16
+ /**
17
+ * Add a state to the state machine.
18
+ * @param name - The name of the new state
19
+ */
20
+ addState(name: string): AnimatorState;
21
+ /**
22
+ * Remove a state from the state machine.
23
+ * @param state - The state
24
+ */
25
+ removeState(state: AnimatorState): void;
26
+ /**
27
+ * Get the state by name.
28
+ * @param name - The layer's name
29
+ */
30
+ findStateByName(name: string): AnimatorState;
31
+ /**
32
+ * Makes a unique state name in the state machine.
33
+ * @param name - Desired name for the state.
34
+ * @returns Unique name.
35
+ */
36
+ makeUniqueStateName(name: string): string;
37
+ }
@@ -0,0 +1,14 @@
1
+ import { AnimatorState } from "./AnimatorState";
2
+ /**
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.
4
+ */
5
+ export declare class AnimatorStateTransition {
6
+ /** The duration of the transition. This is represented in normalized time. */
7
+ duration: number;
8
+ /** The time at which the destination state will start. This is represented in normalized time. */
9
+ offset: number;
10
+ /** ExitTime represents the exact time at which the transition can take effect. This is represented in normalized time. */
11
+ exitTime: number;
12
+ /** The destination state of the transition. */
13
+ destinationState: AnimatorState;
14
+ }
@@ -0,0 +1,19 @@
1
+ import { Color, Quaternion, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
2
+ /**
3
+ * Keyframe.
4
+ * @typeParam V - Type of Keyframe value
5
+ */
6
+ export declare class Keyframe<V extends KeyframeValueType, T = V extends number ? number : V extends Vector2 ? Vector2 : V extends Vector3 ? Vector3 : V extends Vector4 | Color | Quaternion ? Vector4 : V extends number[] | Float32Array ? number[] : never> {
7
+ /** The time of the Keyframe. */
8
+ time: number;
9
+ /** The value of the Keyframe. */
10
+ value: V;
11
+ /** Sets the incoming tangent for this key. The incoming tangent affects the slope of the curve from the previous key to this key. */
12
+ inTangent?: T;
13
+ /** Sets the outgoing tangent for this key. The outgoing tangent affects the slope of the curve from this key to the next key. */
14
+ outTangent?: T;
15
+ }
16
+ /**
17
+ * Type of Keyframe value.
18
+ */
19
+ export type KeyframeValueType = number | Vector2 | Vector3 | Vector4 | number[] | Float32Array | Quaternion | Color | boolean;
@@ -0,0 +1,32 @@
1
+ import { Animator } from "../animation/Animator";
2
+ import { AnimatorState } from "../animation/AnimatorState";
3
+ /**
4
+ * StateMachineScript is a component that can be added to a animator state. It's the base class every script on a state derives from.
5
+ */
6
+ export declare class StateMachineScript {
7
+ /**
8
+ * onStateEnter is called when a transition starts and the state machine starts to evaluate this state.
9
+ * @param animator - The animator
10
+ * @param animatorState - The state be evaluated
11
+ * @param layerIndex - The index of the layer where the state is located
12
+ */
13
+ onStateEnter(animator: Animator, animatorState: AnimatorState, layerIndex: number): void;
14
+ /**
15
+ * onStateUpdate is called on each Update frame between onStateEnter and onStateExit callbacks.
16
+ * @param animator - The animator
17
+ * @param animatorState - The state be evaluated
18
+ * @param layerIndex - The index of the layer where the state is located
19
+ */
20
+ onStateUpdate(animator: Animator, animatorState: AnimatorState, layerIndex: number): void;
21
+ /**
22
+ * onStateExit is called when a transition ends and the state machine finishes evaluating this state.
23
+ * @param animator - The animator
24
+ * @param animatorState - The state be evaluated
25
+ * @param layerIndex - The index of the layer where the state is located
26
+ */
27
+ onStateExit(animator: Animator, animatorState: AnimatorState, layerIndex: number): void;
28
+ /**
29
+ * Destroy this instance.
30
+ */
31
+ destroy(): void;
32
+ }
@@ -0,0 +1,7 @@
1
+ import { AnimationCurve } from "./AnimationCurve";
2
+ /**
3
+ * Store a collection of Keyframes that can be evaluated over time.
4
+ */
5
+ export declare class AnimationArrayCurve extends AnimationCurve<number[]> {
6
+ constructor();
7
+ }
@@ -0,0 +1,7 @@
1
+ import { AnimationCurve } from "./AnimationCurve";
2
+ /**
3
+ * Store a collection of Keyframes that can be evaluated over time.
4
+ */
5
+ export declare class AnimationBoolCurve extends AnimationCurve<boolean> {
6
+ constructor();
7
+ }
@@ -0,0 +1,8 @@
1
+ import { Color } 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 AnimationColorCurve extends AnimationCurve<Color> {
7
+ constructor();
8
+ }
@@ -0,0 +1,39 @@
1
+ import { InterpolationType } from "../enums/InterpolationType";
2
+ import { IEvaluateData } from "../internal/animationCurveOwner/AnimationCurveOwner";
3
+ import { Keyframe, KeyframeValueType } from "../Keyframe";
4
+ /**
5
+ * Store a collection of Keyframes that can be evaluated over time.
6
+ */
7
+ export declare abstract class AnimationCurve<V extends KeyframeValueType> {
8
+ /** All keys defined in the animation curve. */
9
+ keys: Keyframe<V>[];
10
+ protected _evaluateData: IEvaluateData<V>;
11
+ protected _length: number;
12
+ protected _interpolation: InterpolationType;
13
+ private _type;
14
+ /**
15
+ * The interpolationType of the animation curve.
16
+ */
17
+ get interpolation(): InterpolationType;
18
+ set interpolation(value: InterpolationType);
19
+ /**
20
+ * Animation curve length in seconds.
21
+ */
22
+ get length(): number;
23
+ constructor();
24
+ /**
25
+ * Add a new key to the curve.
26
+ * @param key - The keyframe
27
+ */
28
+ addKey(key: Keyframe<V>): void;
29
+ /**
30
+ * Evaluate the curve at time.
31
+ * @param time - The time within the curve you want to evaluate
32
+ */
33
+ evaluate(time: number): V;
34
+ /**
35
+ * Removes a key.
36
+ * @param index - The index of the key to remove
37
+ */
38
+ removeKey(index: number): void;
39
+ }
@@ -0,0 +1,12 @@
1
+ import { Keyframe } from "../Keyframe";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationFloatArrayCurve extends AnimationCurve<Float32Array> {
7
+ /**
8
+ * @inheritdoc
9
+ * @override
10
+ */
11
+ addKey(key: Keyframe<Float32Array>): void;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { AnimationCurve } from "./AnimationCurve";
2
+ /**
3
+ * Store a collection of Keyframes that can be evaluated over time.
4
+ */
5
+ export declare class AnimationFloatCurve extends AnimationCurve<number> {
6
+ constructor();
7
+ }
@@ -0,0 +1,8 @@
1
+ import { Quaternion } 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 AnimationQuaternionCurve extends AnimationCurve<Quaternion> {
7
+ constructor();
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Vector2 } 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 AnimationVector2Curve extends AnimationCurve<Vector2> {
7
+ constructor();
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Vector3 } 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 AnimationVector3Curve extends AnimationCurve<Vector3> {
7
+ constructor();
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Vector4 } 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 AnimationVector4Curve extends AnimationCurve<Vector4> {
7
+ constructor();
8
+ }
@@ -0,0 +1,10 @@
1
+ export { AnimationArrayCurve } from "./AnimationArrayCurve";
2
+ export { AnimationBoolCurve } from "./AnimationBoolCurve";
3
+ export { AnimationColorCurve } from "./AnimationColorCurve";
4
+ export { AnimationCurve } from "./AnimationCurve";
5
+ export { AnimationFloatArrayCurve } from "./AnimationFloatArrayCurve";
6
+ export { AnimationFloatCurve } from "./AnimationFloatCurve";
7
+ export { AnimationQuaternionCurve } from "./AnimationQuaternionCurve";
8
+ export { AnimationVector2Curve } from "./AnimationVector2Curve";
9
+ export { AnimationVector3Curve } from "./AnimationVector3Curve";
10
+ export { AnimationVector4Curve } from "./AnimationVector4Curve";
@@ -0,0 +1,8 @@
1
+ export declare enum AnimatorConditionMode {
2
+ If = 0,
3
+ IfNot = 1,
4
+ Greater = 2,
5
+ Less = 3,
6
+ Equals = 4,
7
+ NotEquals = 5
8
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Animator culling mode.
3
+ */
4
+ export declare enum AnimatorCullingMode {
5
+ /** Disable Culling. */
6
+ None = 0,
7
+ /** Completely disabled when renderers are all culled. */
8
+ Complete = 1
9
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum AnimatorLayerBlendingMode {
2
+ Override = 0,
3
+ Additive = 1
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Animation interpolation method.
3
+ */
4
+ export declare enum InterpolationType {
5
+ /** Linear interpolation */
6
+ Linear = 0,
7
+ /** Cubic spline interpolation */
8
+ CubicSpine = 1,
9
+ /** Stepped interpolation */
10
+ Step = 2,
11
+ /** Hermite interpolation */
12
+ Hermite = 3
13
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Layer state.
3
+ */
4
+ export declare enum LayerState {
5
+ /** Standby state. */
6
+ Standby = 0,
7
+ /** Playing state. */
8
+ Playing = 1,
9
+ /** CrossFading state. */
10
+ CrossFading = 2,
11
+ /** FixedCrossFading state. */
12
+ FixedCrossFading = 3
13
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * State play state.
3
+ */
4
+ export declare enum PlayState {
5
+ /** Playing state. */
6
+ Playing = 0,
7
+ /** Crossing state. */
8
+ Crossing = 1,
9
+ /** Fading state. */
10
+ Fading = 2,
11
+ /** Finished state. */
12
+ Finished = 3
13
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Animation wrap mode.
3
+ */
4
+ export declare enum WrapMode {
5
+ /** Play once */
6
+ Once = 0,
7
+ /** Loop play */
8
+ Loop = 1
9
+ }