@galacean/engine-core 1.0.0 → 1.0.2

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 (265) hide show
  1. package/dist/main.js +15448 -13299
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +15448 -13299
  4. package/dist/module.js +15434 -13295
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
  8. package/types/2d/atlas/SpriteAtlas.d.ts +2 -6
  9. package/types/2d/data/VertexData2D.d.ts +1 -0
  10. package/types/2d/enums/SpriteDrawMode.d.ts +4 -2
  11. package/types/2d/enums/SpriteTileMode.d.ts +11 -0
  12. package/types/2d/index.d.ts +1 -0
  13. package/types/2d/sprite/Sprite.d.ts +17 -8
  14. package/types/2d/sprite/SpriteMask.d.ts +16 -22
  15. package/types/2d/sprite/SpriteRenderer.d.ts +31 -17
  16. package/types/2d/text/Font.d.ts +2 -7
  17. package/types/2d/text/TextRenderer.d.ts +1 -13
  18. package/types/2d/text/index.d.ts +1 -0
  19. package/types/Camera.d.ts +32 -10
  20. package/types/Component.d.ts +0 -8
  21. package/types/ComponentsDependencies.d.ts +17 -9
  22. package/types/ComponentsManager.d.ts +3 -2
  23. package/types/DisorderedArray.d.ts +4 -3
  24. package/types/Engine.d.ts +35 -43
  25. package/types/Entity.d.ts +2 -2
  26. package/types/RenderPipeline/Basic2DBatcher.d.ts +6 -7
  27. package/types/RenderPipeline/BasicRenderPipeline.d.ts +8 -6
  28. package/types/RenderPipeline/ClassPool.d.ts +3 -1
  29. package/types/RenderPipeline/CullingResults.d.ts +1 -0
  30. package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
  31. package/types/RenderPipeline/IPoolElement.d.ts +3 -0
  32. package/types/RenderPipeline/MeshRenderData.d.ts +17 -0
  33. package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
  34. package/types/RenderPipeline/PipelinePass.d.ts +16 -0
  35. package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
  36. package/types/RenderPipeline/RenderData.d.ts +7 -0
  37. package/types/RenderPipeline/RenderElement.d.ts +8 -8
  38. package/types/RenderPipeline/RenderElementX.d.ts +12 -0
  39. package/types/RenderPipeline/RenderPass.d.ts +1 -1
  40. package/types/RenderPipeline/RenderQueue.d.ts +3 -5
  41. package/types/RenderPipeline/SpriteElement.d.ts +3 -1
  42. package/types/RenderPipeline/SpriteMaskBatcher.d.ts +4 -3
  43. package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
  44. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +12 -0
  45. package/types/RenderPipeline/SpriteRenderData.d.ts +14 -0
  46. package/types/RenderPipeline/TextRenderData.d.ts +8 -0
  47. package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
  48. package/types/RenderPipeline/enums/PipelineStage.d.ts +9 -0
  49. package/types/RenderPipeline/index.d.ts +4 -0
  50. package/types/Renderer.d.ts +10 -15
  51. package/types/SafeLoopArray.d.ts +37 -0
  52. package/types/Scene.d.ts +13 -5
  53. package/types/Script.d.ts +18 -15
  54. package/types/Ticker.d.ts +30 -0
  55. package/types/Transform.d.ts +10 -12
  56. package/types/Utils.d.ts +28 -0
  57. package/types/animation/AnimationClip.d.ts +2 -1
  58. package/types/animation/Animator.d.ts +7 -4
  59. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +0 -1
  60. package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
  61. package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
  62. package/types/animation/enums/LayerState.d.ts +3 -1
  63. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
  64. package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
  65. package/types/asset/AssetType.d.ts +16 -16
  66. package/types/asset/ContentRestorer.d.ts +17 -0
  67. package/types/asset/GraphicsResource.d.ts +5 -0
  68. package/types/asset/IReferable.d.ts +2 -0
  69. package/types/asset/LoadItem.d.ts +16 -9
  70. package/types/asset/ReferResource.d.ts +22 -0
  71. package/types/asset/ResourceManager.d.ts +17 -9
  72. package/types/asset/request.d.ts +7 -3
  73. package/types/base/Constant.d.ts +2 -1
  74. package/types/base/EngineObject.d.ts +1 -0
  75. package/types/base/EventDispatcher.d.ts +2 -15
  76. package/types/base/Time.d.ts +27 -24
  77. package/types/base/index.d.ts +0 -2
  78. package/types/enums/ActiveChangeFlag.d.ts +6 -0
  79. package/types/enums/DepthTextureMode.d.ts +7 -0
  80. package/types/env-probe/CubeProbe.d.ts +0 -7
  81. package/types/env-probe/Probe.d.ts +0 -6
  82. package/types/graphic/Buffer.d.ts +5 -12
  83. package/types/graphic/Mesh.d.ts +5 -16
  84. package/types/graphic/Primitive.d.ts +1 -0
  85. package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
  86. package/types/graphic/SubMesh.d.ts +3 -1
  87. package/types/graphic/SubPrimitive.d.ts +9 -0
  88. package/types/index.d.ts +8 -7
  89. package/types/input/InputManager.d.ts +1 -1
  90. package/types/input/interface/IInput.d.ts +1 -1
  91. package/types/lighting/AmbientLight.d.ts +4 -1
  92. package/types/lighting/DirectLight.d.ts +0 -1
  93. package/types/lighting/Light.d.ts +0 -1
  94. package/types/lighting/LightManager.d.ts +1 -0
  95. package/types/lighting/SpotLight.d.ts +0 -1
  96. package/types/material/BaseMaterial.d.ts +8 -10
  97. package/types/material/BlinnPhongMaterial.d.ts +0 -3
  98. package/types/material/Material.d.ts +8 -8
  99. package/types/material/PBRMaterial.d.ts +12 -3
  100. package/types/material/PBRSpecularMaterial.d.ts +1 -1
  101. package/types/material/UnlitMaterial.d.ts +1 -1
  102. package/types/mesh/BlendShape.d.ts +1 -1
  103. package/types/mesh/BlendShapeFrame.d.ts +28 -6
  104. package/types/mesh/MeshRenderer.d.ts +7 -12
  105. package/types/mesh/ModelMesh.d.ts +5 -5
  106. package/types/mesh/PrimitiveMesh.d.ts +4 -2
  107. package/types/mesh/PrimitiveMeshRestorer.d.ts +1 -0
  108. package/types/mesh/SkinnedMeshRenderer.d.ts +0 -14
  109. package/types/particle/ParticleBufferUtils.d.ts +1 -0
  110. package/types/particle/ParticleData.d.ts +1 -0
  111. package/types/particle/ParticleGenerator.d.ts +72 -0
  112. package/types/particle/ParticleMaterial.d.ts +28 -0
  113. package/types/particle/ParticleMesh.d.ts +289 -0
  114. package/types/particle/ParticleRenderer.d.ts +2 -2
  115. package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
  116. package/types/particle/ParticleShaderMacro.d.ts +1 -0
  117. package/types/particle/ParticleShaderProperty.d.ts +1 -0
  118. package/types/particle/ParticleSystem.d.ts +41 -0
  119. package/types/particle/ParticleVertexElements.d.ts +1 -0
  120. package/types/particle/ParticleVertexUtils.d.ts +1 -0
  121. package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
  122. package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
  123. package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
  124. package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
  125. package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
  126. package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
  127. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
  128. package/types/particle/enum/ParticleShapeType.d.ts +15 -0
  129. package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
  130. package/types/particle/enum/index.d.ts +9 -0
  131. package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
  132. package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
  133. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
  134. package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
  135. package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
  136. package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
  137. package/types/particle/enums/ParticleStopMode.d.ts +6 -0
  138. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
  139. package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
  140. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
  141. package/types/particle/module/Burst.d.ts +38 -0
  142. package/types/particle/module/ColorGradient.d.ts +75 -0
  143. package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
  144. package/types/particle/module/EmissionModule.d.ts +63 -0
  145. package/types/particle/module/FrameOverTime.d.ts +73 -0
  146. package/types/particle/module/ParticleCurve.d.ts +37 -0
  147. package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
  148. package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
  149. package/types/particle/module/SizeGradient.d.ts +151 -0
  150. package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
  151. package/types/particle/module/StartFrame.d.ts +46 -0
  152. package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
  153. package/types/particle/module/VelocityGradient.d.ts +110 -0
  154. package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
  155. package/types/particle/module/index.d.ts +15 -0
  156. package/types/particle/module/shape/BaseShape.d.ts +26 -0
  157. package/types/particle/module/shape/BoxShape.d.ts +20 -0
  158. package/types/particle/module/shape/CircleShape.d.ts +27 -0
  159. package/types/particle/module/shape/ConeShape.d.ts +35 -0
  160. package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
  161. package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
  162. package/types/particle/module/shape/SphereShape.d.ts +23 -0
  163. package/types/particle/module/shape/index.d.ts +5 -0
  164. package/types/particle/modules/Burst.d.ts +14 -0
  165. package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
  166. package/types/particle/modules/EmissionModule.d.ts +45 -0
  167. package/types/particle/modules/MainModule.d.ts +70 -0
  168. package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
  169. package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
  170. package/types/particle/modules/ParticleCurve.d.ts +56 -0
  171. package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
  172. package/types/particle/modules/ParticleGradient.d.ts +94 -0
  173. package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
  174. package/types/particle/modules/ShapeModule.d.ts +9 -0
  175. package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
  176. package/types/particle/modules/TextureSheetAnimationModule.d.ts +38 -0
  177. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
  178. package/types/particle/modules/shape/BaseShape.d.ts +12 -0
  179. package/types/particle/modules/shape/BoxShape.d.ts +11 -0
  180. package/types/particle/modules/shape/CircleShape.d.ts +17 -0
  181. package/types/particle/modules/shape/ConeShape.d.ts +28 -0
  182. package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
  183. package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
  184. package/types/particle/modules/shape/SphereShape.d.ts +9 -0
  185. package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
  186. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  187. package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
  188. package/types/particle/modules/shape/index.d.ts +6 -0
  189. package/types/particle/moudules/Burst.d.ts +25 -0
  190. package/types/particle/moudules/Emission.d.ts +47 -0
  191. package/types/particle/moudules/EmissionModule.d.ts +49 -0
  192. package/types/particle/moudules/MainModule.d.ts +59 -0
  193. package/types/particle/moudules/ParticleCurve.d.ts +27 -0
  194. package/types/particle/moudules/ParticleGradient.d.ts +28 -0
  195. package/types/particle/moudules/ShapeModule.d.ts +7 -0
  196. package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
  197. package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
  198. package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
  199. package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
  200. package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
  201. package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
  202. package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
  203. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  204. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
  205. package/types/particle/moudules/shape/index.d.ts +5 -0
  206. package/types/physics/CharacterController.d.ts +0 -2
  207. package/types/physics/Collider.d.ts +1 -1
  208. package/types/physics/Collision.d.ts +4 -0
  209. package/types/physics/PhysicsManager.d.ts +5 -22
  210. package/types/physics/PhysicsScene.d.ts +79 -0
  211. package/types/physics/joint/HingeJoint.d.ts +2 -2
  212. package/types/physics/joint/Joint.d.ts +2 -2
  213. package/types/physics/joint/SpringJoint.d.ts +1 -1
  214. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +8 -0
  215. package/types/renderingHardwareInterface/index.d.ts +1 -0
  216. package/types/shader/Shader.d.ts +32 -23
  217. package/types/shader/ShaderData.d.ts +24 -24
  218. package/types/shader/ShaderMacro.d.ts +16 -0
  219. package/types/shader/ShaderPart.d.ts +41 -0
  220. package/types/shader/ShaderPass.d.ts +9 -2
  221. package/types/shader/ShaderProperty.d.ts +7 -0
  222. package/types/shader/ShaderTagKey.d.ts +16 -0
  223. package/types/shader/SubShader.d.ts +19 -0
  224. package/types/shader/enums/RenderStateElementKey.d.ts +60 -0
  225. package/types/shader/index.d.ts +5 -1
  226. package/types/shader/state/index.d.ts +6 -0
  227. package/types/shaderlib/particle/index.d.ts +14 -0
  228. package/types/shadow/CascadedShadowCasterPass.d.ts +1 -1
  229. package/types/shadow/PipelinePass.d.ts +16 -0
  230. package/types/sky/Sky.d.ts +12 -4
  231. package/types/sky/SkyBoxMaterial.d.ts +27 -9
  232. package/types/sky/SkyProceduralMaterial.d.ts +72 -0
  233. package/types/sky/index.d.ts +1 -0
  234. package/types/texture/RenderTarget.d.ts +2 -6
  235. package/types/texture/Texture.d.ts +8 -6
  236. package/types/texture/Texture2D.d.ts +3 -1
  237. package/types/texture/enums/TextureUsage.d.ts +9 -0
  238. package/types/texture/index.d.ts +1 -0
  239. package/types/trail/TrailRenderer.d.ts +0 -5
  240. package/types/utils/BoolUpdateFlag.d.ts +12 -0
  241. package/types/utils/DisorderedArray.d.ts +18 -0
  242. package/types/utils/SafeLoopArray.d.ts +41 -0
  243. package/types/utils/UpdateFlag.d.ts +20 -0
  244. package/types/utils/UpdateFlagManager.d.ts +1 -0
  245. package/types/utils/Utils.d.ts +31 -0
  246. package/types/xr/XRManager.d.ts +31 -0
  247. package/types/xr/component/XRPoseDriver.d.ts +10 -0
  248. package/types/xr/data/XRCamera.d.ts +6 -0
  249. package/types/xr/data/XRDevice.d.ts +9 -0
  250. package/types/xr/data/XRHandle.d.ts +10 -0
  251. package/types/xr/enum/EnumXRButton.d.ts +5 -0
  252. package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
  253. package/types/xr/enum/EnumXRFeature.d.ts +9 -0
  254. package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
  255. package/types/xr/enum/EnumXRMode.d.ts +7 -0
  256. package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
  257. package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
  258. package/types/xr/feature/XRCameraManager.d.ts +21 -0
  259. package/types/xr/feature/XRFeature.d.ts +29 -0
  260. package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
  261. package/types/xr/feature/XRInputManager.d.ts +16 -0
  262. package/types/xr/index.d.ts +18 -0
  263. package/types/xr/provider/XRProvider.d.ts +19 -0
  264. package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
  265. package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
@@ -1,16 +1,18 @@
1
- import { RefObject } from "../asset/RefObject";
1
+ import { GraphicsResource } from "../asset/GraphicsResource";
2
2
  import { TextureDepthCompareFunction } from "./enums/TextureDepthCompareFunction";
3
3
  import { TextureFilterMode } from "./enums/TextureFilterMode";
4
4
  import { TextureFormat } from "./enums/TextureFormat";
5
+ import { TextureUsage } from "./enums/TextureUsage";
5
6
  import { TextureWrapMode } from "./enums/TextureWrapMode";
6
7
  /**
7
8
  * The base class of texture, contains some common functions of texture-related classes.
8
9
  */
9
- export declare abstract class Texture extends RefObject {
10
+ export declare abstract class Texture extends GraphicsResource {
10
11
  name: string;
11
12
  protected _format: TextureFormat;
12
13
  protected _width: number;
13
14
  protected _height: number;
15
+ protected _usage: TextureUsage;
14
16
  protected _mipmapCount: number;
15
17
  private _wrapModeU;
16
18
  private _wrapModeV;
@@ -30,6 +32,10 @@ export declare abstract class Texture extends RefObject {
30
32
  * The height of the texture.
31
33
  */
32
34
  get height(): number;
35
+ /**
36
+ * The usage of the texture.
37
+ */
38
+ get usage(): TextureUsage;
33
39
  /**
34
40
  * Wrapping mode for texture coordinate S.
35
41
  */
@@ -64,10 +70,6 @@ export declare abstract class Texture extends RefObject {
64
70
  * Generate multi-level textures based on the 0th level data.
65
71
  */
66
72
  generateMipmaps(): void;
67
- /**
68
- * @override
69
- */
70
- _onDestroy(): void;
71
73
  /**
72
74
  * Get the maximum mip level of the corresponding size:rounding down.
73
75
  * @remarks http://download.nvidia.com/developer/Papers/2005/NP2_Mipmapping/NP2_Mipmap_Creation.pdf
@@ -1,5 +1,6 @@
1
1
  import { Engine } from "../Engine";
2
2
  import { TextureFormat } from "./enums/TextureFormat";
3
+ import { TextureUsage } from "./enums/TextureUsage";
3
4
  import { Texture } from "./Texture";
4
5
  /**
5
6
  * Two-dimensional texture.
@@ -12,8 +13,9 @@ export declare class Texture2D extends Texture {
12
13
  * @param height - Texture height
13
14
  * @param format - Texture format. default `TextureFormat.R8G8B8A8`
14
15
  * @param mipmap - Whether to use multi-level texture
16
+ * @param usage - Texture usage
15
17
  */
16
- constructor(engine: Engine, width: number, height: number, format?: TextureFormat, mipmap?: boolean);
18
+ constructor(engine: Engine, width: number, height: number, format?: TextureFormat, mipmap?: boolean, usage?: TextureUsage);
17
19
  /**
18
20
  * Setting pixels data through color buffer data, designated area and texture mipmapping level,it's also applicable to compressed formats.
19
21
  * @remarks If it is the WebGL1.0 platform and the texture format is compressed, the first upload must be filled with textures.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Texture usage.
3
+ */
4
+ export declare enum TextureUsage {
5
+ /** The content of the texture is intended to be specified once. */
6
+ Static = 0,
7
+ /** The content of the texture is intended to be updated frequently, with better performance. */
8
+ Dynamic = 1
9
+ }
@@ -3,6 +3,7 @@ export { TextureCubeFace } from "./enums/TextureCubeFace";
3
3
  export { TextureDepthCompareFunction } from "./enums/TextureDepthCompareFunction";
4
4
  export { TextureFilterMode } from "./enums/TextureFilterMode";
5
5
  export { TextureFormat } from "./enums/TextureFormat";
6
+ export { TextureUsage } from "./enums/TextureUsage";
6
7
  export { TextureWrapMode } from "./enums/TextureWrapMode";
7
8
  export { RenderTarget } from "./RenderTarget";
8
9
  export { Texture } from "./Texture";
@@ -1,6 +1,5 @@
1
1
  import { Entity } from "../Entity";
2
2
  import { MeshRenderer } from "../mesh/MeshRenderer";
3
- import { RenderContext } from "../RenderPipeline/RenderContext";
4
3
  import { Texture2D } from "../texture";
5
4
  /**
6
5
  * @deprecated
@@ -28,10 +27,6 @@ export declare class TrailRenderer extends MeshRenderer {
28
27
  * @param texture
29
28
  */
30
29
  setTexture(texture: Texture2D): void;
31
- /**
32
- * @override
33
- */
34
- protected _render(context: RenderContext): void;
35
30
  private _initGeometry;
36
31
  private _updateStrapVertices;
37
32
  private _updateStrapCoords;
@@ -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,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,41 @@
1
+ export declare class SafeLoopArray<T> {
2
+ private _array;
3
+ private _loopArray;
4
+ private _loopArrayDirty;
5
+ /**
6
+ * Get the length of the array.
7
+ */
8
+ get length(): number;
9
+ /**
10
+ * Push item to the array.
11
+ * @param item - The item which want to be pushed
12
+ */
13
+ push(item: T): void;
14
+ /**
15
+ * Add item to the array.
16
+ * @param index - The index of the array
17
+ * @param item - The item which want to be added
18
+ */
19
+ add(index: number, item: T): void;
20
+ /**
21
+ * Remove item from the array.
22
+ * @param index - The index of the array
23
+ */
24
+ removeByIndex(index: number): void;
25
+ /**
26
+ * The index of the item.
27
+ * @param item - The item which want to get the index
28
+ * @returns Index of the item
29
+ */
30
+ indexOf(item: T): number;
31
+ /**
32
+ * Get the array.
33
+ * @returns The array
34
+ */
35
+ getArray(): ReadonlyArray<T>;
36
+ /**
37
+ * Get the array use for loop.
38
+ * @returns The array use for loop
39
+ */
40
+ getLoopArray(): ReadonlyArray<T>;
41
+ }
@@ -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,31 @@
1
+ export declare class Utils {
2
+ /**
3
+ * Fast remove an element from array.
4
+ * @param array - Array
5
+ * @param item - Element
6
+ */
7
+ static removeFromArray(array: any[], item: any): boolean;
8
+ /**
9
+ * Decodes a given Uint8Array into a string.
10
+ */
11
+ static decodeText(array: Uint8Array): string;
12
+ /**
13
+ * Judge whether the url is absolute url.
14
+ * @param url - The url to be judged.
15
+ * @returns Whether the url is absolute url.
16
+ */
17
+ static isAbsoluteUrl(url: string): boolean;
18
+ /**
19
+ * Get the values of an object.
20
+ */
21
+ static objectValues(obj: any): any[];
22
+ /**
23
+ * Convert a relative URL to an absolute URL based on a given base URL.
24
+ * @param baseUrl - The base url.
25
+ * @param relativeUrl - The relative url.
26
+ * @returns The resolved url.
27
+ */
28
+ static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
29
+ private static _stringToPath;
30
+ private static _formatRelativePath;
31
+ }
@@ -0,0 +1,31 @@
1
+ import { Engine } from "../Engine";
2
+ import { EnumXRMode } from "./enum/EnumXRMode";
3
+ import { EnumXRFeature } from "./enum/EnumXRFeature";
4
+ import { EnumXRTrackingMode } from "./enum/EnumXRTrackingMode";
5
+ import { XRFeature } from "./feature/XRFeature";
6
+ import { EnumXRSubsystem } from "./enum/EnumXRSubsystem";
7
+ import { XRProvider } from "./provider/XRProvider";
8
+ import { XRSubsystem } from "./subsystem/XRSubsystem";
9
+ type FeatureConstructor = new (engine: Engine) => XRFeature;
10
+ export declare class XRManager {
11
+ private _engine;
12
+ private _provider;
13
+ private _features;
14
+ private _subsystems;
15
+ private _isPaused;
16
+ isSupportedMode(mode: EnumXRMode): Promise<void>;
17
+ isSupportedTrackingMode(mode: EnumXRTrackingMode): Promise<void>;
18
+ isSupportedFeature(feature: EnumXRFeature): Promise<void>;
19
+ getFeature<T extends XRFeature>(feature: EnumXRFeature): T;
20
+ enableFeature(feature: EnumXRFeature): void;
21
+ disableFeature(feature: EnumXRFeature): void;
22
+ getSubsystem<T extends XRSubsystem>(subsystem: EnumXRSubsystem): T;
23
+ initialize(mode: EnumXRMode, trackingMode: EnumXRTrackingMode, requestFeatures?: EnumXRFeature[]): Promise<void>;
24
+ start(): Promise<void>;
25
+ pause(): void;
26
+ resume(): void;
27
+ destroy(): void;
28
+ constructor(engine: Engine, type: new (engine: Engine) => XRProvider);
29
+ }
30
+ export declare function registerFeature(feature: EnumXRFeature, dependentSubsystem?: EnumXRSubsystem[]): (featureConstructor: FeatureConstructor) => void;
31
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Script } from "../../Script";
2
+ import { EnumXRInputSource } from "../enum/EnumXRInputSource";
3
+ import { EnumXRTrackingMode } from "../enum/EnumXRTrackingMode";
4
+ export declare class XRPoseDriver extends Script {
5
+ source: EnumXRInputSource;
6
+ updateType: EnumXRTrackingMode;
7
+ private _xrManager;
8
+ onLateUpdate(): void;
9
+ onAwake(): void;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { Matrix, Vector4 } from "@galacean/engine-math";
2
+ import { XRDevice } from "./XRDevice";
3
+ export declare class XRCamera extends XRDevice {
4
+ project: Matrix;
5
+ viewport: Vector4;
6
+ }
@@ -0,0 +1,9 @@
1
+ import { Matrix, Quaternion, Vector3 } from "@galacean/engine-math";
2
+ import { EnumXRDevicePhase } from "../enum/EnumXRDevicePhase";
3
+ export declare class XRDevice {
4
+ matrix: Matrix;
5
+ position: Vector3;
6
+ linearVelocity: Vector3;
7
+ quaternion: Quaternion;
8
+ phase: EnumXRDevicePhase;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { XRDevice } from "./XRDevice";
2
+ import { EnumXRButton } from "../enum/EnumXRButton";
3
+ import { DisorderedArray } from "../../DisorderedArray";
4
+ export declare class XRHandle extends XRDevice {
5
+ pressedButtons: EnumXRButton;
6
+ upMap: number[];
7
+ downMap: number[];
8
+ upList: DisorderedArray<EnumXRButton>;
9
+ downList: DisorderedArray<EnumXRButton>;
10
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum EnumXRButton {
2
+ None = 0,
3
+ Select = 1,
4
+ Squeeze = 2
5
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum EnumXRDevicePhase {
2
+ active = 0,
3
+ leave = 1
4
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ *
3
+ */
4
+ export declare enum EnumXRFeature {
5
+ input = 0,
6
+ camera = 1,
7
+ imageTracking = 2,
8
+ objectTracking = 3
9
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum EnumXRInputSource {
2
+ Handler = 0,
3
+ LeftHandle = 1,
4
+ RightHandle = 2,
5
+ Eye = 3,
6
+ LeftEye = 4,
7
+ RightEye = 5
8
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Modes for XR
3
+ */
4
+ export declare enum EnumXRMode {
5
+ AR = 0,
6
+ VR = 1
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum EnumXRSubsystem {
2
+ input = 0,
3
+ imageTracking = 1
4
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum EnumXRTrackingMode {
2
+ None = 0,
3
+ RotationOnly = 1,
4
+ PositionOnly = 2,
5
+ RotationAndPosition = 3,
6
+ Auto = 4
7
+ }
@@ -0,0 +1,21 @@
1
+ import { Camera } from "../../Camera";
2
+ import { EnumXRInputSource } from "../enum/EnumXRInputSource";
3
+ import { XRFeature } from "./XRFeature";
4
+ export declare class XRCameraManager extends XRFeature {
5
+ private _cameras;
6
+ private _automaticNear;
7
+ private _customNear;
8
+ private _automaticFar;
9
+ private _customFar;
10
+ get near(): number;
11
+ set near(value: number);
12
+ get far(): number;
13
+ set far(value: number);
14
+ attachCamera(source: EnumXRInputSource, camera: Camera): void;
15
+ detachCamera(source: EnumXRInputSource): void;
16
+ getCamera(source: EnumXRInputSource): Camera;
17
+ onUpdate(): void;
18
+ onEnable(): void;
19
+ onDisable(): void;
20
+ onDestroy(): void;
21
+ }
@@ -0,0 +1,29 @@
1
+ import { Engine } from "../../Engine";
2
+ export declare abstract class XRFeature {
3
+ protected _engine: Engine;
4
+ /**
5
+ * Enable an instance of a feature.
6
+ * This method needs to be override.
7
+ * @returns
8
+ */
9
+ onEnable(): void;
10
+ /**
11
+ * Disable an instance of a feature.
12
+ * This method needs to be override.
13
+ * @returns
14
+ */
15
+ onDisable(): void;
16
+ /**
17
+ * Update an instance of a feature.
18
+ * This method needs to be override.
19
+ * @returns
20
+ */
21
+ onUpdate(): void;
22
+ /**
23
+ * Destroy an instance of a feature.
24
+ * This method needs to be override.
25
+ * @returns
26
+ */
27
+ onDestroy(): void;
28
+ constructor(engine: Engine);
29
+ }
@@ -0,0 +1,10 @@
1
+ import { Entity } from "../../Entity";
2
+ import { XRFeature } from "./XRFeature";
3
+ export declare class XRImageTrackManager extends XRFeature {
4
+ addImage(): void;
5
+ removeImage(): void;
6
+ getTrackedObject(): Entity;
7
+ onEnable(): void;
8
+ onDisable(): void;
9
+ onDestroy(): void;
10
+ }
@@ -0,0 +1,16 @@
1
+ import { Engine } from "../../Engine";
2
+ import { XRDevice } from "../data/XRDevice";
3
+ import { EnumXRButton } from "../enum/EnumXRButton";
4
+ import { EnumXRInputSource } from "../enum/EnumXRInputSource";
5
+ import { XRFeature } from "./XRFeature";
6
+ export declare class XRInputManager extends XRFeature {
7
+ private _subSystem;
8
+ getDevice<T extends XRDevice>(source: EnumXRInputSource): T;
9
+ isButtonDown(handedness: EnumXRInputSource, button: EnumXRButton): boolean;
10
+ isButtonUp(handedness: EnumXRInputSource, button: EnumXRButton): boolean;
11
+ isButtonHeldDown(handedness: EnumXRInputSource, button: EnumXRButton): boolean;
12
+ onEnable(): void;
13
+ onDisable(): void;
14
+ onDestroy(): void;
15
+ constructor(engine: Engine);
16
+ }
@@ -0,0 +1,18 @@
1
+ export { XRManager, registerFeature } from "./XRManager";
2
+ export { EnumXRMode } from "./enum/EnumXRMode";
3
+ export { EnumXRButton } from "./enum/EnumXRButton";
4
+ export { EnumXRFeature } from "./enum/EnumXRFeature";
5
+ export { EnumXRSubsystem } from "./enum/EnumXRSubsystem";
6
+ export { EnumXRDevicePhase } from "./enum/EnumXRDevicePhase";
7
+ export { EnumXRInputSource } from "./enum/EnumXRInputSource";
8
+ export { EnumXRTrackingMode } from "./enum/EnumXRTrackingMode";
9
+ export { XRInputManager } from "./feature/XRInputManager";
10
+ export { XRCameraManager } from "./feature/XRCameraManager";
11
+ export { XRImageTrackManager } from "./feature/XRImageTrackManager";
12
+ export { XRSubsystem } from "./subsystem/XRSubsystem";
13
+ export { XRInputSubsystem } from "./subsystem/XRInputSubsystem";
14
+ export { XRProvider } from "./provider/XRProvider";
15
+ export { XRPoseDriver } from "./component/XRPoseDriver";
16
+ export { XRDevice } from "./data/XRDevice";
17
+ export { XRCamera } from "./data/XRCamera";
18
+ export { XRHandle } from "./data/XRHandle";
@@ -0,0 +1,19 @@
1
+ import { EnumXRMode } from "../enum/EnumXRMode";
2
+ import { EnumXRTrackingMode } from "../enum/EnumXRTrackingMode";
3
+ import { XRSubsystem } from "../subsystem/XRSubsystem";
4
+ import { Engine } from "../../Engine";
5
+ import { EnumXRSubsystem } from "../enum/EnumXRSubsystem";
6
+ export declare class XRProvider {
7
+ name: string;
8
+ protected _engine: Engine;
9
+ isSupportedMode(mode: EnumXRMode): Promise<void>;
10
+ isSupportedTrackingMode(mode: EnumXRTrackingMode): Promise<void>;
11
+ isSupportedSubsystem(feature: number): Promise<void>;
12
+ createSubsystem<T extends XRSubsystem>(feature: number): Promise<T>;
13
+ initialize(mode: EnumXRMode, trackingMode: EnumXRTrackingMode, subsystems: EnumXRSubsystem[]): Promise<XRSubsystem[]>;
14
+ start(): Promise<void>;
15
+ onUpdate(): void;
16
+ onLateUpdate(): void;
17
+ onDestroy(): void;
18
+ constructor(engine: Engine);
19
+ }
@@ -0,0 +1,5 @@
1
+ import { XRDevice } from "../data/XRDevice";
2
+ import { XRSubsystem } from "./XRSubsystem";
3
+ export declare abstract class XRInputSubsystem extends XRSubsystem {
4
+ devices: XRDevice[];
5
+ }
@@ -0,0 +1,30 @@
1
+ import { Engine } from "../../Engine";
2
+ export declare abstract class XRSubsystem {
3
+ running: boolean;
4
+ _engine: Engine;
5
+ /**
6
+ * Starts an instance of a system.
7
+ * This method needs to be override.
8
+ * @returns
9
+ */
10
+ start(): Promise<void>;
11
+ /**
12
+ * Stops an instance of a system.
13
+ * This method needs to be override.
14
+ * @returns
15
+ */
16
+ stop(): Promise<void>;
17
+ /**
18
+ * Destroys this instance of a system.
19
+ * This method needs to be override.
20
+ * @returns
21
+ */
22
+ destroy(): Promise<void>;
23
+ /**
24
+ * Update this instance of a system.
25
+ * This method needs to be override.
26
+ * @returns
27
+ */
28
+ update(): void;
29
+ constructor(engine: Engine);
30
+ }