@galacean/engine-core 0.0.0-experimental-animator-additive.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 (325) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/main.js +24671 -0
  4. package/dist/main.js.map +1 -0
  5. package/dist/miniprogram.js +24671 -0
  6. package/dist/module.js +24554 -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/atlas/FontAtlas.d.ts +1 -0
  13. package/types/2d/atlas/SpriteAtlas.d.ts +36 -0
  14. package/types/2d/atlas/types.d.ts +64 -0
  15. package/types/2d/data/RenderData2D.d.ts +1 -0
  16. package/types/2d/data/VertexData2D.d.ts +1 -0
  17. package/types/2d/enums/FontStyle.d.ts +11 -0
  18. package/types/2d/enums/SpriteDirtyFlag.d.ts +13 -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/TextAlignment.d.ts +22 -0
  24. package/types/2d/enums/TextOverflow.d.ts +9 -0
  25. package/types/2d/index.d.ts +9 -0
  26. package/types/2d/sprite/Sprite.d.ts +97 -0
  27. package/types/2d/sprite/SpriteMask.d.ts +63 -0
  28. package/types/2d/sprite/SpriteRenderer.d.ts +77 -0
  29. package/types/2d/sprite/index.d.ts +3 -0
  30. package/types/2d/text/CharInfo.d.ts +1 -0
  31. package/types/2d/text/CharRenderData.d.ts +1 -0
  32. package/types/2d/text/CharRenderDataPool.d.ts +1 -0
  33. package/types/2d/text/Font.d.ts +26 -0
  34. package/types/2d/text/SubFont.d.ts +1 -0
  35. package/types/2d/text/TextRenderer.d.ts +123 -0
  36. package/types/2d/text/TextUtils.d.ts +1 -0
  37. package/types/2d/text/index.d.ts +2 -0
  38. package/types/Background.d.ts +43 -0
  39. package/types/BoolUpdateFlag.d.ts +12 -0
  40. package/types/Camera.d.ts +206 -0
  41. package/types/Canvas.d.ts +9 -0
  42. package/types/Component.d.ts +32 -0
  43. package/types/ComponentsDependencies.d.ts +17 -0
  44. package/types/ComponentsManager.d.ts +46 -0
  45. package/types/DisorderedArray.d.ts +18 -0
  46. package/types/Engine.d.ts +140 -0
  47. package/types/EngineSettings.d.ts +8 -0
  48. package/types/Entity.d.ts +151 -0
  49. package/types/Layer.d.ts +73 -0
  50. package/types/ListenerUpdateFlag.d.ts +12 -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/AnimatorStatePlayData.d.ts +1 -0
  92. package/types/animation/AnimatorStateTransition.d.ts +12 -0
  93. package/types/animation/AnimatorTransition.d.ts +14 -0
  94. package/types/animation/AnimatorTransitionBase.d.ts +10 -0
  95. package/types/animation/Keyframe.d.ts +19 -0
  96. package/types/animation/StateMachineScript.d.ts +32 -0
  97. package/types/animation/animationCurve/AnimationArrayCurve.d.ts +7 -0
  98. package/types/animation/animationCurve/AnimationBoolCurve.d.ts +7 -0
  99. package/types/animation/animationCurve/AnimationColorCurve.d.ts +8 -0
  100. package/types/animation/animationCurve/AnimationCurve.d.ts +39 -0
  101. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +12 -0
  102. package/types/animation/animationCurve/AnimationFloatCurve.d.ts +7 -0
  103. package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +8 -0
  104. package/types/animation/animationCurve/AnimationVector2Curve.d.ts +8 -0
  105. package/types/animation/animationCurve/AnimationVector3Curve.d.ts +8 -0
  106. package/types/animation/animationCurve/AnimationVector4Curve.d.ts +8 -0
  107. package/types/animation/animationCurve/index.d.ts +10 -0
  108. package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +1 -0
  109. package/types/animation/enums/AnimatorConditionMode.d.ts +8 -0
  110. package/types/animation/enums/AnimatorCullingMode.d.ts +9 -0
  111. package/types/animation/enums/AnimatorLayerBlendingMode.d.ts +4 -0
  112. package/types/animation/enums/AnimatorStatePlayState.d.ts +1 -0
  113. package/types/animation/enums/InterpolationType.d.ts +13 -0
  114. package/types/animation/enums/LayerState.d.ts +13 -0
  115. package/types/animation/enums/PlayState.d.ts +13 -0
  116. package/types/animation/enums/StateMachineState.d.ts +13 -0
  117. package/types/animation/enums/WrapMode.d.ts +9 -0
  118. package/types/animation/index.d.ts +21 -0
  119. package/types/animation/internal/AnimationEventHandler.d.ts +1 -0
  120. package/types/animation/internal/AnimatorLayerData.d.ts +1 -0
  121. package/types/animation/internal/AnimatorPlayableObject.d.ts +23 -0
  122. package/types/animation/internal/AnimatorStateData.d.ts +1 -0
  123. package/types/animation/internal/AnimatorStateInfo.d.ts +1 -0
  124. package/types/animation/internal/AnimatorStateMachineData.d.ts +1 -0
  125. package/types/animation/internal/AnimatorStatePlayData.d.ts +1 -0
  126. package/types/animation/internal/AnimatorTempValue.d.ts +1 -0
  127. package/types/animation/internal/CrossCurveData.d.ts +1 -0
  128. package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +5 -0
  129. package/types/animation/internal/animationCurveOwner/Assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +1 -0
  130. package/types/animation/internal/animationCurveOwner/Assembler/IAnimationCurveOwnerAssembler.d.ts +1 -0
  131. package/types/animation/internal/animationCurveOwner/Assembler/PositionAnimationCurveOwnerAssembler.d.ts +1 -0
  132. package/types/animation/internal/animationCurveOwner/Assembler/RotationAnimationCurveOwnerAssembler.d.ts +1 -0
  133. package/types/animation/internal/animationCurveOwner/Assembler/ScaleAnimationCurveOwnerAssembler.d.ts +1 -0
  134. package/types/animation/internal/animationCurveOwner/Assembler/UniversalAnimationCurveOwnerAssembler.d.ts +1 -0
  135. package/types/asset/AssetPromise.d.ts +56 -0
  136. package/types/asset/AssetType.d.ts +52 -0
  137. package/types/asset/ContentRestorer.d.ts +17 -0
  138. package/types/asset/GraphicsResource.d.ts +9 -0
  139. package/types/asset/IRefObject.d.ts +2 -0
  140. package/types/asset/IReferable.d.ts +2 -0
  141. package/types/asset/LoadItem.d.ts +33 -0
  142. package/types/asset/Loader.d.ts +30 -0
  143. package/types/asset/RefObject.d.ts +27 -0
  144. package/types/asset/ReferResource.d.ts +27 -0
  145. package/types/asset/ResourceManager.d.ts +101 -0
  146. package/types/asset/request.d.ts +25 -0
  147. package/types/base/Constant.d.ts +110 -0
  148. package/types/base/EngineObject.d.ts +24 -0
  149. package/types/base/Event.d.ts +24 -0
  150. package/types/base/EventDispatcher.d.ts +79 -0
  151. package/types/base/Logger.d.ts +11 -0
  152. package/types/base/StaticInterfaceImplement.d.ts +5 -0
  153. package/types/base/Time.d.ts +41 -0
  154. package/types/base/Util.d.ts +14 -0
  155. package/types/base/index.d.ts +7 -0
  156. package/types/clone/CloneManager.d.ts +31 -0
  157. package/types/clone/ComponentCloner.d.ts +14 -0
  158. package/types/clone/enums/CloneMode.d.ts +13 -0
  159. package/types/enums/BackgroundMode.d.ts +9 -0
  160. package/types/enums/BackgroundTextureFillMode.d.ts +8 -0
  161. package/types/enums/CameraClearFlags.d.ts +13 -0
  162. package/types/enums/ColorSpace.d.ts +9 -0
  163. package/types/enums/FogMode.d.ts +13 -0
  164. package/types/env-probe/CubeProbe.d.ts +34 -0
  165. package/types/env-probe/Probe.d.ts +58 -0
  166. package/types/env-probe/index.d.ts +2 -0
  167. package/types/fog/EXP2Fog.d.ts +15 -0
  168. package/types/fog/Fog.d.ts +14 -0
  169. package/types/fog/LinearFog.d.ts +22 -0
  170. package/types/fog/index.d.ts +3 -0
  171. package/types/graphic/Buffer.d.ts +105 -0
  172. package/types/graphic/BufferUtil.d.ts +11 -0
  173. package/types/graphic/IndexBufferBinding.d.ts +21 -0
  174. package/types/graphic/Mesh.d.ts +70 -0
  175. package/types/graphic/SubMesh.d.ts +19 -0
  176. package/types/graphic/VertexBufferBinding.d.ts +20 -0
  177. package/types/graphic/VertexElement.d.ts +44 -0
  178. package/types/graphic/enums/BufferBindFlag.d.ts +9 -0
  179. package/types/graphic/enums/BufferUsage.d.ts +11 -0
  180. package/types/graphic/enums/IndexFormat.d.ts +11 -0
  181. package/types/graphic/enums/MeshTopology.d.ts +19 -0
  182. package/types/graphic/enums/SetDataOptions.d.ts +9 -0
  183. package/types/graphic/enums/VertexElementFormat.d.ts +37 -0
  184. package/types/graphic/index.d.ts +13 -0
  185. package/types/index.d.ts +53 -0
  186. package/types/input/InputManager.d.ts +67 -0
  187. package/types/input/enums/Keys.d.ts +398 -0
  188. package/types/input/enums/PointerButton.d.ts +33 -0
  189. package/types/input/enums/PointerPhase.d.ts +15 -0
  190. package/types/input/index.d.ts +5 -0
  191. package/types/input/interface/IInput.d.ts +18 -0
  192. package/types/input/keyboard/KeyboardManager.d.ts +1 -0
  193. package/types/input/pointer/Pointer.d.ts +25 -0
  194. package/types/input/pointer/PointerManager.d.ts +1 -0
  195. package/types/input/wheel/WheelManager.d.ts +1 -0
  196. package/types/lighting/AmbientLight.d.ts +67 -0
  197. package/types/lighting/DirectLight.d.ts +21 -0
  198. package/types/lighting/KHR_lights.d.ts +4 -0
  199. package/types/lighting/Light.d.ts +48 -0
  200. package/types/lighting/LightManager.d.ts +5 -0
  201. package/types/lighting/PointLight.d.ts +18 -0
  202. package/types/lighting/SpotLight.d.ts +36 -0
  203. package/types/lighting/enums/DiffuseMode.d.ts +13 -0
  204. package/types/lighting/index.d.ts +6 -0
  205. package/types/material/BaseMaterial.d.ts +88 -0
  206. package/types/material/BlinnPhongMaterial.d.ts +71 -0
  207. package/types/material/Material.d.ts +51 -0
  208. package/types/material/PBRBaseMaterial.d.ts +101 -0
  209. package/types/material/PBRMaterial.d.ts +36 -0
  210. package/types/material/PBRSpecularMaterial.d.ts +38 -0
  211. package/types/material/UnlitMaterial.d.ts +33 -0
  212. package/types/material/enums/BlendMode.d.ts +9 -0
  213. package/types/material/enums/RenderFace.d.ts +11 -0
  214. package/types/material/enums/TextureCoordinate.d.ts +13 -0
  215. package/types/material/index.d.ts +10 -0
  216. package/types/mesh/BlendShape.d.ts +39 -0
  217. package/types/mesh/BlendShapeFrame.d.ts +22 -0
  218. package/types/mesh/BlendShapeManager.d.ts +1 -0
  219. package/types/mesh/BufferMesh.d.ts +59 -0
  220. package/types/mesh/MeshRenderer.d.ts +30 -0
  221. package/types/mesh/ModelMesh.d.ts +226 -0
  222. package/types/mesh/PrimitiveMesh.d.ts +86 -0
  223. package/types/mesh/PrimitiveMeshRestorer.d.ts +1 -0
  224. package/types/mesh/Skin.d.ts +16 -0
  225. package/types/mesh/SkinnedMeshRenderer.d.ts +62 -0
  226. package/types/mesh/enums/VertexAttribute.d.ts +33 -0
  227. package/types/mesh/index.d.ts +8 -0
  228. package/types/particle/ParticleRenderer.d.ts +235 -0
  229. package/types/particle/index.d.ts +1 -0
  230. package/types/physics/CharacterController.d.ts +53 -0
  231. package/types/physics/Collider.d.ts +29 -0
  232. package/types/physics/DynamicCollider.d.ts +161 -0
  233. package/types/physics/HitResult.d.ts +15 -0
  234. package/types/physics/PhysicsManager.d.ts +95 -0
  235. package/types/physics/PhysicsMaterial.d.ts +37 -0
  236. package/types/physics/StaticCollider.d.ts +7 -0
  237. package/types/physics/enums/ColliderShapeUpAxis.d.ts +11 -0
  238. package/types/physics/enums/ControllerCollisionFlag.d.ts +11 -0
  239. package/types/physics/enums/ControllerNonWalkableMode.d.ts +9 -0
  240. package/types/physics/enums/HingeJointFlag.d.ts +1 -0
  241. package/types/physics/enums/PhysicsMaterialCombineMode.d.ts +13 -0
  242. package/types/physics/enums/index.d.ts +4 -0
  243. package/types/physics/index.d.ts +10 -0
  244. package/types/physics/joint/FixedJoint.d.ts +3 -0
  245. package/types/physics/joint/HingeJoint.d.ts +57 -0
  246. package/types/physics/joint/Joint.d.ts +58 -0
  247. package/types/physics/joint/JointLimits.d.ts +15 -0
  248. package/types/physics/joint/JointMotor.d.ts +13 -0
  249. package/types/physics/joint/SpringJoint.d.ts +42 -0
  250. package/types/physics/joint/index.d.ts +6 -0
  251. package/types/physics/shape/BoxColliderShape.d.ts +15 -0
  252. package/types/physics/shape/CapsuleColliderShape.d.ts +26 -0
  253. package/types/physics/shape/ColliderShape.d.ts +51 -0
  254. package/types/physics/shape/PlaneColliderShape.d.ts +7 -0
  255. package/types/physics/shape/SphereColliderShape.d.ts +13 -0
  256. package/types/physics/shape/index.d.ts +5 -0
  257. package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +6 -0
  258. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +8 -0
  259. package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +20 -0
  260. package/types/renderingHardwareInterface/IPlatformTexture.d.ts +36 -0
  261. package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +37 -0
  262. package/types/renderingHardwareInterface/IPlatformTexture2DArray.d.ts +40 -0
  263. package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +41 -0
  264. package/types/renderingHardwareInterface/index.d.ts +6 -0
  265. package/types/shader/Shader.d.ts +72 -0
  266. package/types/shader/ShaderData.d.ts +350 -0
  267. package/types/shader/ShaderMacro.d.ts +10 -0
  268. package/types/shader/ShaderMacroCollection.d.ts +1 -0
  269. package/types/shader/ShaderPart.d.ts +41 -0
  270. package/types/shader/ShaderPass.d.ts +9 -0
  271. package/types/shader/ShaderPool.d.ts +1 -0
  272. package/types/shader/ShaderProgram.d.ts +1 -0
  273. package/types/shader/ShaderProgramPool.d.ts +1 -0
  274. package/types/shader/ShaderProperty.d.ts +13 -0
  275. package/types/shader/ShaderTagKey.d.ts +16 -0
  276. package/types/shader/ShaderUniform.d.ts +1 -0
  277. package/types/shader/ShaderUniformBlock.d.ts +1 -0
  278. package/types/shader/SubShader.d.ts +19 -0
  279. package/types/shader/enums/BlendFactor.d.ts +32 -0
  280. package/types/shader/enums/BlendOperation.d.ts +16 -0
  281. package/types/shader/enums/ColorWriteMask.d.ts +18 -0
  282. package/types/shader/enums/CompareFunction.d.ts +22 -0
  283. package/types/shader/enums/CullMode.d.ts +12 -0
  284. package/types/shader/enums/RenderQueueType.d.ts +11 -0
  285. package/types/shader/enums/ShaderDataGroup.d.ts +13 -0
  286. package/types/shader/enums/ShaderPropertyType.d.ts +27 -0
  287. package/types/shader/enums/StencilOperation.d.ts +22 -0
  288. package/types/shader/index.d.ts +12 -0
  289. package/types/shader/state/BlendState.d.ts +16 -0
  290. package/types/shader/state/DepthState.d.ts +14 -0
  291. package/types/shader/state/RasterState.d.ts +13 -0
  292. package/types/shader/state/RenderState.d.ts +20 -0
  293. package/types/shader/state/RenderTargetBlendState.d.ts +24 -0
  294. package/types/shader/state/StencilState.d.ts +34 -0
  295. package/types/shaderlib/ShaderFactory.d.ts +17 -0
  296. package/types/shaderlib/ShaderLib.d.ts +57 -0
  297. package/types/shaderlib/index.d.ts +1 -0
  298. package/types/shaderlib/pbr/index.d.ts +9 -0
  299. package/types/shaderlib/shadow/index.d.ts +8 -0
  300. package/types/shadow/CascadedShadowCasterPass.d.ts +47 -0
  301. package/types/shadow/ShadowSliceData.d.ts +1 -0
  302. package/types/shadow/ShadowUtils.d.ts +1 -0
  303. package/types/shadow/enum/ShadowCascadesMode.d.ts +11 -0
  304. package/types/shadow/enum/ShadowMode.d.ts +13 -0
  305. package/types/shadow/enum/ShadowResolution.d.ts +13 -0
  306. package/types/shadow/enum/ShadowType.d.ts +13 -0
  307. package/types/shadow/index.d.ts +3 -0
  308. package/types/sky/Sky.d.ts +14 -0
  309. package/types/sky/SkyBoxMaterial.d.ts +25 -0
  310. package/types/sky/index.d.ts +2 -0
  311. package/types/texture/RenderTarget.d.ts +95 -0
  312. package/types/texture/Texture.d.ts +77 -0
  313. package/types/texture/Texture2D.d.ts +68 -0
  314. package/types/texture/Texture2DArray.d.ts +81 -0
  315. package/types/texture/TextureCube.d.ts +70 -0
  316. package/types/texture/enums/RenderBufferDepthFormat.d.ts +21 -0
  317. package/types/texture/enums/TextureCubeFace.d.ts +17 -0
  318. package/types/texture/enums/TextureDepthCompareFunction.d.ts +21 -0
  319. package/types/texture/enums/TextureFilterMode.d.ts +11 -0
  320. package/types/texture/enums/TextureFormat.d.ts +69 -0
  321. package/types/texture/enums/TextureWrapMode.d.ts +11 -0
  322. package/types/texture/index.d.ts +11 -0
  323. package/types/trail/TrailMaterial.d.ts +5 -0
  324. package/types/trail/TrailRenderer.d.ts +40 -0
  325. package/types/trail/index.d.ts +2 -0
@@ -0,0 +1,123 @@
1
+ import { BoundingBox, Color } from "@galacean/engine-math";
2
+ import { ICustomClone } from "../../clone/ComponentCloner";
3
+ import { Entity } from "../../Entity";
4
+ import { Renderer } from "../../Renderer";
5
+ import { RenderContext } from "../../RenderPipeline/RenderContext";
6
+ import { TransformModifyFlags } from "../../Transform";
7
+ import { FontStyle } from "../enums/FontStyle";
8
+ import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
9
+ import { TextHorizontalAlignment, TextVerticalAlignment } from "../enums/TextAlignment";
10
+ import { OverflowMode } from "../enums/TextOverflow";
11
+ import { Font } from "./Font";
12
+ /**
13
+ * Renders a text for 2D graphics.
14
+ */
15
+ export declare class TextRenderer extends Renderer implements ICustomClone {
16
+ private static _charRenderDataPool;
17
+ private static _tempVec30;
18
+ private static _tempVec31;
19
+ _dirtyFlag: number;
20
+ private _color;
21
+ private _text;
22
+ private _width;
23
+ private _height;
24
+ private _localBounds;
25
+ private _font;
26
+ private _fontSize;
27
+ private _fontStyle;
28
+ private _lineSpacing;
29
+ private _horizontalAlignment;
30
+ private _verticalAlignment;
31
+ private _enableWrapping;
32
+ private _overflowMode;
33
+ private _maskInteraction;
34
+ private _maskLayer;
35
+ /**
36
+ * Rendering color for the Text.
37
+ */
38
+ get color(): Color;
39
+ set color(value: Color);
40
+ /**
41
+ * Rendering string for the Text.
42
+ */
43
+ get text(): string;
44
+ set text(value: string);
45
+ /**
46
+ * The width of the TextRenderer (in 3D world coordinates).
47
+ */
48
+ get width(): number;
49
+ set width(value: number);
50
+ /**
51
+ * The height of the TextRenderer (in 3D world coordinates).
52
+ */
53
+ get height(): number;
54
+ set height(value: number);
55
+ /**
56
+ * The font of the Text.
57
+ */
58
+ get font(): Font;
59
+ set font(value: Font);
60
+ /**
61
+ * The font size of the Text.
62
+ */
63
+ get fontSize(): number;
64
+ set fontSize(value: number);
65
+ /**
66
+ * The style of the font.
67
+ */
68
+ get fontStyle(): FontStyle;
69
+ set fontStyle(value: FontStyle);
70
+ /**
71
+ * The space between two lines (in pixels).
72
+ */
73
+ get lineSpacing(): number;
74
+ set lineSpacing(value: number);
75
+ /**
76
+ * The horizontal alignment.
77
+ */
78
+ get horizontalAlignment(): TextHorizontalAlignment;
79
+ set horizontalAlignment(value: TextHorizontalAlignment);
80
+ /**
81
+ * The vertical alignment.
82
+ */
83
+ get verticalAlignment(): TextVerticalAlignment;
84
+ set verticalAlignment(value: TextVerticalAlignment);
85
+ /**
86
+ * Whether wrap text to next line when exceeds the width of the container.
87
+ */
88
+ get enableWrapping(): boolean;
89
+ set enableWrapping(value: boolean);
90
+ /**
91
+ * The overflow mode.
92
+ */
93
+ get overflowMode(): OverflowMode;
94
+ set overflowMode(value: OverflowMode);
95
+ /**
96
+ * Interacts with the masks.
97
+ */
98
+ get maskInteraction(): SpriteMaskInteraction;
99
+ set maskInteraction(value: SpriteMaskInteraction);
100
+ /**
101
+ * The mask layer the sprite renderer belongs to.
102
+ */
103
+ get maskLayer(): number;
104
+ set maskLayer(value: number);
105
+ /**
106
+ * The bounding volume of the TextRenderer.
107
+ */
108
+ get bounds(): BoundingBox;
109
+ constructor(entity: Entity);
110
+ /**
111
+ * @override
112
+ */
113
+ protected _updateBounds(worldBounds: BoundingBox): void;
114
+ /**
115
+ * @override
116
+ */
117
+ protected _render(context: RenderContext): void;
118
+ private _updateStencilState;
119
+ private _resetSubFont;
120
+ private _updatePosition;
121
+ private _updateLocalData;
122
+ protected _onTransformChanged(bit: TransformModifyFlags): void;
123
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Font } from "./Font";
2
+ export { TextRenderer } from "./TextRenderer";
@@ -0,0 +1,43 @@
1
+ import { Color } from "@galacean/engine-math";
2
+ import { Engine } from "./Engine";
3
+ import { BackgroundMode } from "./enums/BackgroundMode";
4
+ import { BackgroundTextureFillMode } from "./enums/BackgroundTextureFillMode";
5
+ import { Sky } from "./sky/Sky";
6
+ import { Texture2D } from "./texture";
7
+ /**
8
+ * Background of scene.
9
+ */
10
+ export declare class Background {
11
+ private _engine;
12
+ /**
13
+ * Background mode.
14
+ * @defaultValue `BackgroundMode.SolidColor`
15
+ * @remarks If using `BackgroundMode.Sky` mode and material or mesh of the `sky` is not defined, it will downgrade to `BackgroundMode.SolidColor`.
16
+ */
17
+ mode: BackgroundMode;
18
+ /**
19
+ * Background solid color.
20
+ * @defaultValue `new Color(0.25, 0.25, 0.25, 1.0)`
21
+ * @remarks When `mode` is `BackgroundMode.SolidColor`, the property will take effects.
22
+ */
23
+ solidColor: Color;
24
+ /**
25
+ * Background sky.
26
+ * @remarks When `mode` is `BackgroundMode.Sky`, the property will take effects.
27
+ */
28
+ readonly sky: Sky;
29
+ private _texture;
30
+ /**
31
+ * Background texture.
32
+ * @remarks When `mode` is `BackgroundMode.Texture`, the property will take effects.
33
+ */
34
+ get texture(): Texture2D;
35
+ set texture(value: Texture2D);
36
+ set textureFillMode(value: BackgroundTextureFillMode);
37
+ /**
38
+ * Constructor of Background.
39
+ * @param _engine Engine Which the background belongs to.
40
+ */
41
+ constructor(_engine: Engine);
42
+ private _createPlane;
43
+ }
@@ -0,0 +1,12 @@
1
+ import { UpdateFlag } from "./UpdateFlag";
2
+ /**
3
+ * Bool update flag.
4
+ */
5
+ export declare class BoolUpdateFlag extends UpdateFlag {
6
+ /** Bool flag. */
7
+ flag: boolean;
8
+ /**
9
+ * @inheritdoc
10
+ */
11
+ dispatch(): void;
12
+ }
@@ -0,0 +1,206 @@
1
+ import { Matrix, Ray, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
2
+ import { Component } from "./Component";
3
+ import { CameraClearFlags } from "./enums/CameraClearFlags";
4
+ import { Layer } from "./Layer";
5
+ import { ShaderData } from "./shader/ShaderData";
6
+ import { TextureCubeFace } from "./texture/enums/TextureCubeFace";
7
+ import { RenderTarget } from "./texture/RenderTarget";
8
+ /**
9
+ * Camera component, as the entrance to the three-dimensional world.
10
+ * @decorator `@dependentComponents(Transform)`
11
+ */
12
+ export declare class Camera extends Component {
13
+ /** Shader data. */
14
+ readonly shaderData: ShaderData;
15
+ /** Rendering priority - A Camera with higher priority will be rendered on top of a camera with lower priority. */
16
+ priority: number;
17
+ /** Whether to enable frustum culling, it is enabled by default. */
18
+ enableFrustumCulling: boolean;
19
+ /**
20
+ * Determining what to clear when rendering by a Camera.
21
+ * @defaultValue `CameraClearFlags.All`
22
+ */
23
+ clearFlags: CameraClearFlags;
24
+ /**
25
+ * Culling mask - which layers the camera renders.
26
+ * @remarks Support bit manipulation, corresponding to `Layer`.
27
+ */
28
+ cullingMask: Layer;
29
+ private _isProjMatSetting;
30
+ private _nearClipPlane;
31
+ private _farClipPlane;
32
+ private _fieldOfView;
33
+ private _orthographicSize;
34
+ private _isProjectionDirty;
35
+ private _isInvProjMatDirty;
36
+ private _isFrustumProjectDirty;
37
+ private _customAspectRatio;
38
+ private _renderTarget;
39
+ private _frustumViewChangeFlag;
40
+ private _transform;
41
+ private _isViewMatrixDirty;
42
+ private _isInvViewProjDirty;
43
+ private _viewport;
44
+ private _inverseProjectionMatrix;
45
+ private _lastAspectSize;
46
+ private _invViewProjMat;
47
+ /**
48
+ * Near clip plane - the closest point to the camera when rendering occurs.
49
+ */
50
+ get nearClipPlane(): number;
51
+ set nearClipPlane(value: number);
52
+ /**
53
+ * Far clip plane - the furthest point to the camera when rendering occurs.
54
+ */
55
+ get farClipPlane(): number;
56
+ set farClipPlane(value: number);
57
+ /**
58
+ * The camera's view angle. activating when camera use perspective projection.
59
+ */
60
+ get fieldOfView(): number;
61
+ set fieldOfView(value: number);
62
+ /**
63
+ * Aspect ratio. The default is automatically calculated by the viewport's aspect ratio. If it is manually set,
64
+ * the manual value will be kept. Call resetAspectRatio() to restore it.
65
+ */
66
+ get aspectRatio(): number;
67
+ set aspectRatio(value: number);
68
+ /**
69
+ * Viewport, normalized expression, the upper left corner is (0, 0), and the lower right corner is (1, 1).
70
+ * @remarks Re-assignment is required after modification to ensure that the modification takes effect.
71
+ */
72
+ get viewport(): Vector4;
73
+ set viewport(value: Vector4);
74
+ /**
75
+ * Whether it is orthogonal, the default is false. True will use orthographic projection, false will use perspective projection.
76
+ */
77
+ get isOrthographic(): boolean;
78
+ set isOrthographic(value: boolean);
79
+ /**
80
+ * Half the size of the camera in orthographic mode.
81
+ */
82
+ get orthographicSize(): number;
83
+ set orthographicSize(value: number);
84
+ /**
85
+ * View matrix.
86
+ */
87
+ get viewMatrix(): Readonly<Matrix>;
88
+ /**
89
+ * The projection matrix is ​​calculated by the relevant parameters of the camera by default.
90
+ * If it is manually set, the manual value will be maintained. Call resetProjectionMatrix() to restore it.
91
+ */
92
+ set projectionMatrix(value: Matrix);
93
+ get projectionMatrix(): Matrix;
94
+ /**
95
+ * Whether to enable HDR.
96
+ * @todo When render pipeline modification
97
+ */
98
+ get enableHDR(): boolean;
99
+ set enableHDR(value: boolean);
100
+ /**
101
+ * RenderTarget. After setting, it will be rendered to the renderTarget. If it is empty, it will be rendered to the main canvas.
102
+ */
103
+ get renderTarget(): RenderTarget | null;
104
+ set renderTarget(value: RenderTarget | null);
105
+ /**
106
+ * Restore the automatic calculation of projection matrix through fieldOfView, nearClipPlane and farClipPlane.
107
+ */
108
+ resetProjectionMatrix(): void;
109
+ /**
110
+ * Restore the automatic calculation of the aspect ratio through the viewport aspect ratio.
111
+ */
112
+ resetAspectRatio(): void;
113
+ /**
114
+ * Transform a point from world space to viewport space.
115
+ * @param point - Point in world space
116
+ * @param out - Point in viewport space, X and Y are the camera viewport space coordinates, Z is in world space units from the plane that camera forward is normal to
117
+ * @returns Point in viewport space
118
+ */
119
+ worldToViewportPoint(point: Vector3, out: Vector3): Vector3;
120
+ /**
121
+ * Transform a point from viewport space to world space.
122
+ * @param point - Point in viewport space, X and Y are the camera viewport space coordinates, Z is in world space units from the plane that camera forward is normal to
123
+ * @param out - Point in world space
124
+ * @returns Point in world space
125
+ */
126
+ viewportToWorldPoint(point: Vector3, out: Vector3): Vector3;
127
+ /**
128
+ * Generate a ray by a point in viewport.
129
+ * @param point - Point in viewport space, X and Y are the camera viewport space coordinates
130
+ * @param out - Ray
131
+ * @returns Ray
132
+ */
133
+ viewportPointToRay(point: Vector2, out: Ray): Ray;
134
+ /**
135
+ * Transform the X and Y coordinates of a point from screen space to viewport space
136
+ * @param point - Point in screen space
137
+ * @param out - Point in viewport space
138
+ * @returns Point in viewport space
139
+ */
140
+ screenToViewportPoint<T extends Vector2 | Vector3>(point: Vector3 | Vector2, out: T): T;
141
+ /**
142
+ * Transform the X and Y coordinates of a point from viewport space to screen space.
143
+ * @param point - Point in viewport space
144
+ * @param out - Point in screen space
145
+ * @returns Point in screen space
146
+ */
147
+ viewportToScreenPoint<T extends Vector2 | Vector3 | Vector4>(point: T, out: T): T;
148
+ /**
149
+ * Transform a point from world space to screen space.
150
+ *
151
+ * @remarks
152
+ * Screen space is defined in pixels, the left-top of the screen is (0,0), the right-top is (canvasPixelWidth,canvasPixelHeight).
153
+ *
154
+ * @param point - Point in world space
155
+ * @param out - The result will be stored
156
+ * @returns X and Y are the coordinates of the point in screen space, Z is the distance from the camera in world space
157
+ */
158
+ worldToScreenPoint(point: Vector3, out: Vector3): Vector3;
159
+ /**
160
+ * Transform a point from screen space to world space.
161
+ *
162
+ * @param point - Screen space point, the top-left of the screen is (0,0), the right-bottom is (pixelWidth,pixelHeight), The z position is in world units from the camera
163
+ * @param out - Point in world space
164
+ * @returns Point in world space
165
+ */
166
+ screenToWorldPoint(point: Vector3, out: Vector3): Vector3;
167
+ /**
168
+ * Generate a ray by a point in screen.
169
+ * @param point - Point in screen space, the top-left of the screen is (0,0), the right-bottom is (pixelWidth,pixelHeight)
170
+ * @param out - Ray
171
+ * @returns Ray
172
+ */
173
+ screenPointToRay(point: Vector2, out: Ray): Ray;
174
+ /**
175
+ * Manually call the rendering of the camera.
176
+ * @param cubeFace - Cube rendering surface collection
177
+ * @param mipLevel - Set mip level the data want to write, only take effect in webgl2.0
178
+ */
179
+ render(cubeFace?: TextureCubeFace, mipLevel?: number): void;
180
+ /**
181
+ * @override
182
+ * @inheritdoc
183
+ */
184
+ _onEnable(): void;
185
+ /**
186
+ * @override
187
+ * @inheritdoc
188
+ */
189
+ _onDisable(): void;
190
+ /**
191
+ * @override
192
+ * @inheritdoc
193
+ */
194
+ _onDestroy(): void;
195
+ private _projMatChange;
196
+ private _innerViewportToWorldPoint;
197
+ private _updateShaderData;
198
+ /**
199
+ * The inverse matrix of view projection matrix.
200
+ */
201
+ private _getInvViewProjMat;
202
+ /**
203
+ * The inverse of the projection matrix.
204
+ */
205
+ private _getInverseProjectionMatrix;
206
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Canvas.
3
+ */
4
+ export interface Canvas {
5
+ /** The width of the canvas. */
6
+ width: number;
7
+ /** The height of the canvas. */
8
+ height: number;
9
+ }
@@ -0,0 +1,32 @@
1
+ import { EngineObject } from "./base";
2
+ import { Entity } from "./Entity";
3
+ import { Scene } from "./Scene";
4
+ /**
5
+ * The base class of the components.
6
+ */
7
+ export declare class Component extends EngineObject {
8
+ private _phasedActive;
9
+ private _enabled;
10
+ /**
11
+ * Indicates whether the component is enabled.
12
+ */
13
+ get enabled(): boolean;
14
+ set enabled(value: boolean);
15
+ /**
16
+ * Indicates whether the component is destroyed.
17
+ */
18
+ get destroyed(): boolean;
19
+ /**
20
+ * The entity which the component belongs to.
21
+ */
22
+ get entity(): Entity;
23
+ /**
24
+ * The scene which the component's entity belongs to.
25
+ */
26
+ get scene(): Scene;
27
+ constructor(entity: Entity);
28
+ /**
29
+ * Destroy this instance.
30
+ */
31
+ destroy(): void;
32
+ }
@@ -0,0 +1,17 @@
1
+ import { Component } from "./Component";
2
+ import { Entity } from "./Entity";
3
+ type ComponentConstructor = new (entity: Entity) => Component;
4
+ /**
5
+ * Used for component dependency registration.
6
+ */
7
+ export declare class ComponentsDependencies {
8
+ private static _invDependenciesMap;
9
+ private static _addDependency;
10
+ private constructor();
11
+ }
12
+ /**
13
+ * Dependent components, automatically added if they do not exist.
14
+ * @param components - Dependent components
15
+ */
16
+ export declare function dependentComponents(...components: ComponentConstructor[]): <T extends ComponentConstructor>(target: T) => void;
17
+ export {};
@@ -0,0 +1,46 @@
1
+ import { Camera } from "./Camera";
2
+ import { Component } from "./Component";
3
+ import { Renderer } from "./Renderer";
4
+ import { Script } from "./Script";
5
+ /**
6
+ * The manager of the components.
7
+ */
8
+ export declare class ComponentsManager {
9
+ private _onStartScripts;
10
+ private _onUpdateScripts;
11
+ private _onLateUpdateScripts;
12
+ private _onPhysicsUpdateScripts;
13
+ private _disableScripts;
14
+ private _pendingDestroyScripts;
15
+ private _disposeDestroyScripts;
16
+ private _onUpdateAnimations;
17
+ private _onUpdateRenderers;
18
+ private _componentsContainerPool;
19
+ addRenderer(renderer: Renderer): void;
20
+ removeRenderer(renderer: Renderer): void;
21
+ addOnStartScript(script: Script): void;
22
+ removeOnStartScript(script: Script): void;
23
+ addOnUpdateScript(script: Script): void;
24
+ removeOnUpdateScript(script: Script): void;
25
+ addOnLateUpdateScript(script: Script): void;
26
+ removeOnLateUpdateScript(script: Script): void;
27
+ addOnPhysicsUpdateScript(script: Script): void;
28
+ removeOnPhysicsUpdateScript(script: Script): void;
29
+ addOnUpdateAnimations(animation: Component): void;
30
+ removeOnUpdateAnimations(animation: Component): void;
31
+ addOnUpdateRenderers(renderer: Renderer): void;
32
+ removeOnUpdateRenderers(renderer: Renderer): void;
33
+ addDisableScript(component: Script): void;
34
+ addPendingDestroyScript(component: Script): void;
35
+ callScriptOnStart(): void;
36
+ callScriptOnUpdate(deltaTime: number): void;
37
+ callScriptOnLateUpdate(deltaTime: number): void;
38
+ callScriptOnPhysicsUpdate(): void;
39
+ callAnimationUpdate(deltaTime: number): void;
40
+ callRendererOnUpdate(deltaTime: number): void;
41
+ handlingInvalidScripts(): void;
42
+ callCameraOnBeginRender(camera: Camera): void;
43
+ callCameraOnEndRender(camera: Camera): void;
44
+ getActiveChangedTempList(): Component[];
45
+ putActiveChangedTempList(componentContainer: Component[]): void;
46
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * High-performance unordered array, delete uses exchange method to improve performance, internal capacity only increases.
3
+ */
4
+ export declare class DisorderedArray<T> {
5
+ _elements: T[];
6
+ length: number;
7
+ constructor(count?: number);
8
+ add(element: T): void;
9
+ delete(element: T): void;
10
+ get(index: number): T;
11
+ /**
12
+ *
13
+ * @param index
14
+ * @returns The replaced item is used to reset its index.
15
+ */
16
+ deleteByIndex(index: number): T;
17
+ garbageCollection(): void;
18
+ }
@@ -0,0 +1,140 @@
1
+ import { Font } from "./2d/text/Font";
2
+ import { ResourceManager } from "./asset/ResourceManager";
3
+ import { EventDispatcher, Time } from "./base";
4
+ import { Canvas } from "./Canvas";
5
+ import { ComponentsManager } from "./ComponentsManager";
6
+ import { EngineSettings } from "./EngineSettings";
7
+ import { Entity } from "./Entity";
8
+ import { InputManager } from "./input";
9
+ import { LightManager } from "./lighting/LightManager";
10
+ import { Material } from "./material/Material";
11
+ import { PhysicsManager } from "./physics";
12
+ import { IHardwareRenderer } from "./renderingHardwareInterface";
13
+ import { ClassPool } from "./RenderPipeline/ClassPool";
14
+ import { MeshRenderElement } from "./RenderPipeline/MeshRenderElement";
15
+ import { RenderContext } from "./RenderPipeline/RenderContext";
16
+ import { SpriteElement } from "./RenderPipeline/SpriteElement";
17
+ import { SpriteMaskElement } from "./RenderPipeline/SpriteMaskElement";
18
+ import { TextRenderElement } from "./RenderPipeline/TextRenderElement";
19
+ import { Scene } from "./Scene";
20
+ import { SceneManager } from "./SceneManager";
21
+ import { RenderState } from "./shader/state/RenderState";
22
+ /**
23
+ * Engine.
24
+ */
25
+ export declare class Engine extends EventDispatcher {
26
+ /** Physics manager of Engine. */
27
+ readonly physicsManager: PhysicsManager;
28
+ readonly inputManager: InputManager;
29
+ _lightManager: LightManager;
30
+ _componentsManager: ComponentsManager;
31
+ _hardwareRenderer: IHardwareRenderer;
32
+ _lastRenderState: RenderState;
33
+ _renderElementPool: ClassPool<MeshRenderElement>;
34
+ _spriteElementPool: ClassPool<SpriteElement>;
35
+ _spriteMaskElementPool: ClassPool<SpriteMaskElement>;
36
+ _textElementPool: ClassPool<TextRenderElement>;
37
+ _spriteDefaultMaterial: Material;
38
+ _spriteMaskDefaultMaterial: Material;
39
+ _textDefaultFont: Font;
40
+ _renderContext: RenderContext;
41
+ protected _canvas: Canvas;
42
+ private _settings;
43
+ private _resourceManager;
44
+ private _sceneManager;
45
+ private _vSyncCount;
46
+ private _targetFrameRate;
47
+ private _time;
48
+ private _isPaused;
49
+ private _requestId;
50
+ private _timeoutId;
51
+ private _vSyncCounter;
52
+ private _targetFrameInterval;
53
+ private _destroyed;
54
+ private _frameInProcess;
55
+ private _waittingDestroy;
56
+ private _animate;
57
+ /**
58
+ * Settings of Engine.
59
+ */
60
+ get settings(): EngineSettings;
61
+ /**
62
+ * The canvas to use for rendering.
63
+ */
64
+ get canvas(): Canvas;
65
+ /**
66
+ * Get the resource manager.
67
+ */
68
+ get resourceManager(): ResourceManager;
69
+ /**
70
+ * Get the scene manager.
71
+ */
72
+ get sceneManager(): SceneManager;
73
+ /**
74
+ * Get the Time class.
75
+ */
76
+ get time(): Time;
77
+ /**
78
+ * Whether the engine is paused.
79
+ */
80
+ get isPaused(): boolean;
81
+ /**
82
+ * The number of vertical synchronization means the number of vertical blanking for one frame.
83
+ * @remarks 0 means that the vertical synchronization is turned off.
84
+ */
85
+ get vSyncCount(): number;
86
+ set vSyncCount(value: number);
87
+ /**
88
+ * Set the target frame rate you want to achieve.
89
+ * @remarks
90
+ * It only takes effect when vSyncCount = 0 (ie, vertical synchronization is turned off).
91
+ * The larger the value, the higher the target frame rate, Number.POSITIVE_INFINITY represents the infinite target frame rate.
92
+ */
93
+ get targetFrameRate(): number;
94
+ set targetFrameRate(value: number);
95
+ /**
96
+ * Indicates whether the engine is destroyed.
97
+ */
98
+ get destroyed(): boolean;
99
+ /**
100
+ * Create engine.
101
+ * @param canvas - The canvas to use for rendering
102
+ * @param hardwareRenderer - Graphics API renderer
103
+ * @param settings - Engine Settings
104
+ */
105
+ constructor(canvas: Canvas, hardwareRenderer: IHardwareRenderer, settings?: EngineSettings);
106
+ /**
107
+ * Create an entity.
108
+ * @param name - The name of the entity
109
+ * @returns Entity
110
+ */
111
+ createEntity(name?: string): Entity;
112
+ /**
113
+ * Pause the engine.
114
+ */
115
+ pause(): void;
116
+ /**
117
+ * Resume the engine.
118
+ */
119
+ resume(): void;
120
+ /**
121
+ * Update the engine loop manually. If you call engine.run(), you generally don't need to call this function.
122
+ */
123
+ update(): void;
124
+ /**
125
+ * Execution engine loop.
126
+ */
127
+ run(): void;
128
+ private _destroy;
129
+ /**
130
+ * Destroy engine.
131
+ * @remarks If call during frame execution will delay until the end of the frame
132
+ */
133
+ destroy(): void;
134
+ /**
135
+ * @intenral
136
+ */
137
+ _render(scene: Scene): void;
138
+ private _createSpriteMaterial;
139
+ private _createSpriteMaskMaterial;
140
+ }
@@ -0,0 +1,8 @@
1
+ import { ColorSpace } from "./enums/ColorSpace";
2
+ /**
3
+ * Render settings.
4
+ */
5
+ export interface EngineSettings {
6
+ /** Color space.*/
7
+ colorSpace?: ColorSpace;
8
+ }