@galacean/engine-core 2.0.0-alpha.6 → 2.0.0-alpha.60

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 (321) hide show
  1. package/dist/main.js +28967 -22183
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +28951 -22175
  4. package/dist/module.js.map +1 -1
  5. package/package.json +3 -5
  6. package/types/2d/assembler/ISpriteAssembler.d.ts +1 -0
  7. package/types/2d/assembler/ISpriteRenderer.d.ts +3 -2
  8. package/types/2d/assembler/SimpleSpriteAssembler.d.ts +1 -0
  9. package/types/2d/assembler/SlicedSpriteAssembler.d.ts +1 -0
  10. package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
  11. package/types/2d/atlas/FontAtlas.d.ts +23 -1
  12. package/types/2d/atlas/SpriteAtlas.d.ts +8 -0
  13. package/types/2d/sprite/Sprite.d.ts +30 -4
  14. package/types/2d/sprite/SpriteMask.d.ts +49 -1
  15. package/types/2d/sprite/SpriteRenderer.d.ts +35 -1
  16. package/types/2d/text/CharInfo.d.ts +20 -1
  17. package/types/2d/text/CharRenderInfo.d.ts +15 -1
  18. package/types/2d/text/Font.d.ts +11 -1
  19. package/types/2d/text/ITextRenderer.d.ts +3 -0
  20. package/types/2d/text/SubFont.d.ts +35 -1
  21. package/types/2d/text/TextRenderer.d.ts +54 -1
  22. package/types/2d/text/TextUtils.d.ts +89 -1
  23. package/types/Background.d.ts +19 -2
  24. package/types/BasicResources.d.ts +58 -0
  25. package/types/Camera.d.ts +79 -1
  26. package/types/Canvas.d.ts +36 -7
  27. package/types/Component.d.ts +35 -2
  28. package/types/ComponentsDependencies.d.ts +38 -1
  29. package/types/ComponentsManager.d.ts +20 -0
  30. package/types/Engine.d.ts +114 -7
  31. package/types/EngineEventType.d.ts +13 -0
  32. package/types/Entity.d.ts +112 -21
  33. package/types/Polyfill.d.ts +12 -1
  34. package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -2
  35. package/types/RenderPipeline/BatcherManager.d.ts +23 -1
  36. package/types/RenderPipeline/Blitter.d.ts +1 -1
  37. package/types/RenderPipeline/CullingResults.d.ts +17 -1
  38. package/types/RenderPipeline/DepthOnlyPass.d.ts +15 -1
  39. package/types/RenderPipeline/InstanceBuffer.d.ts +28 -0
  40. package/types/RenderPipeline/MaskManager.d.ts +36 -1
  41. package/types/RenderPipeline/OpaqueTexturePass.d.ts +16 -1
  42. package/types/RenderPipeline/PipelineUtils.d.ts +11 -1
  43. package/types/RenderPipeline/PrimitiveChunk.d.ts +27 -1
  44. package/types/RenderPipeline/PrimitiveChunkManager.d.ts +16 -1
  45. package/types/RenderPipeline/RenderContext.d.ts +46 -1
  46. package/types/RenderPipeline/RenderElement.d.ts +26 -6
  47. package/types/RenderPipeline/RenderQueue.d.ts +23 -1
  48. package/types/RenderPipeline/RenderTargetPool.d.ts +17 -1
  49. package/types/RenderPipeline/SubPrimitiveChunk.d.ts +14 -1
  50. package/types/RenderPipeline/VertexArea.d.ts +10 -1
  51. package/types/RenderPipeline/VertexMergeBatcher.d.ts +11 -0
  52. package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +9 -1
  53. package/types/RenderPipeline/index.d.ts +4 -1
  54. package/types/Renderer.d.ts +82 -19
  55. package/types/Scene.d.ts +34 -7
  56. package/types/SceneManager.d.ts +18 -6
  57. package/types/Script.d.ts +41 -0
  58. package/types/Signal.d.ts +71 -0
  59. package/types/SystemInfo.d.ts +14 -2
  60. package/types/Transform.d.ts +26 -1
  61. package/types/UpdateFlag.d.ts +4 -1
  62. package/types/UpdateFlagManager.d.ts +41 -1
  63. package/types/Utils.d.ts +20 -0
  64. package/types/VirtualCamera.d.ts +16 -1
  65. package/types/animation/AnimationClip.d.ts +13 -2
  66. package/types/animation/AnimationClipCurveBinding.d.ts +17 -2
  67. package/types/animation/AnimationEvent.d.ts +2 -2
  68. package/types/animation/Animator.d.ts +49 -10
  69. package/types/animation/AnimatorController.d.ts +20 -2
  70. package/types/animation/AnimatorControllerLayer.d.ts +17 -2
  71. package/types/animation/AnimatorControllerParameter.d.ts +4 -0
  72. package/types/animation/AnimatorState.d.ts +46 -2
  73. package/types/animation/AnimatorStateInstance.d.ts +46 -0
  74. package/types/animation/AnimatorStateMachine.d.ts +17 -2
  75. package/types/animation/AnimatorStateTransition.d.ts +9 -0
  76. package/types/animation/AnimatorStateTransitionCollection.d.ts +23 -1
  77. package/types/animation/Keyframe.d.ts +1 -1
  78. package/types/animation/StateMachineScript.d.ts +2 -0
  79. package/types/animation/animationCurve/AnimationArrayCurve.d.ts +39 -0
  80. package/types/animation/animationCurve/AnimationBoolCurve.d.ts +39 -0
  81. package/types/animation/animationCurve/AnimationColorCurve.d.ts +39 -0
  82. package/types/animation/animationCurve/AnimationCurve.d.ts +9 -1
  83. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +38 -0
  84. package/types/animation/animationCurve/AnimationFloatCurve.d.ts +39 -0
  85. package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +41 -0
  86. package/types/animation/animationCurve/AnimationRectCurve.d.ts +18 -0
  87. package/types/animation/animationCurve/AnimationRefCurve.d.ts +20 -2
  88. package/types/animation/animationCurve/AnimationStringCurve.d.ts +39 -0
  89. package/types/animation/animationCurve/AnimationVector2Curve.d.ts +39 -0
  90. package/types/animation/animationCurve/AnimationVector3Curve.d.ts +43 -0
  91. package/types/animation/animationCurve/AnimationVector4Curve.d.ts +39 -0
  92. package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +18 -1
  93. package/types/animation/enums/AnimatorStatePlayState.d.ts +8 -1
  94. package/types/animation/index.d.ts +1 -0
  95. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +15 -1
  96. package/types/animation/internal/AnimationEventHandler.d.ts +8 -1
  97. package/types/animation/internal/AnimatorLayerData.d.ts +28 -1
  98. package/types/animation/internal/AnimatorStateData.d.ts +14 -1
  99. package/types/animation/internal/AnimatorStatePlayData.d.ts +27 -1
  100. package/types/animation/internal/AnimatorTempValue.d.ts +12 -1
  101. package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +39 -0
  102. package/types/animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +12 -1
  103. package/types/animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts +10 -1
  104. package/types/animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts +13 -1
  105. package/types/animation/internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts +13 -1
  106. package/types/animation/internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts +13 -1
  107. package/types/animation/internal/animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts +23 -1
  108. package/types/asset/AssetPromise.d.ts +4 -4
  109. package/types/asset/AssetType.d.ts +7 -9
  110. package/types/asset/GraphicsResource.d.ts +10 -0
  111. package/types/asset/IReferable.d.ts +8 -0
  112. package/types/asset/JSONAsset.d.ts +1 -1
  113. package/types/asset/LoadItem.d.ts +1 -1
  114. package/types/asset/Loader.d.ts +2 -2
  115. package/types/asset/ReferResource.d.ts +28 -0
  116. package/types/asset/RenderingStatistics.d.ts +8 -0
  117. package/types/asset/ResourceManager.d.ts +117 -9
  118. package/types/audio/AudioClip.d.ts +8 -0
  119. package/types/audio/AudioManager.d.ts +18 -0
  120. package/types/audio/AudioSource.d.ts +20 -2
  121. package/types/base/Constant.d.ts +2 -19
  122. package/types/base/DataObject.d.ts +6 -0
  123. package/types/base/EngineObject.d.ts +4 -0
  124. package/types/base/Time.d.ts +13 -0
  125. package/types/base/index.d.ts +1 -0
  126. package/types/clone/CloneDecorators.d.ts +37 -0
  127. package/types/clone/CloneUtil.d.ts +30 -0
  128. package/types/clone/ComponentCloner.d.ts +4 -10
  129. package/types/clone/ICloneHook.d.ts +12 -0
  130. package/types/enums/CameraType.d.ts +9 -1
  131. package/types/env-probe/CubeProbe.d.ts +2 -0
  132. package/types/env-probe/Probe.d.ts +1 -1
  133. package/types/graphic/Buffer.d.ts +23 -3
  134. package/types/graphic/BufferUtil.d.ts +8 -0
  135. package/types/graphic/ElementRangeMapping.d.ts +9 -0
  136. package/types/graphic/IndexBufferBinding.d.ts +4 -0
  137. package/types/graphic/Mesh.d.ts +58 -1
  138. package/types/graphic/Primitive.d.ts +50 -1
  139. package/types/graphic/TransformFeedback.d.ts +46 -0
  140. package/types/graphic/TransformFeedbackPrimitive.d.ts +57 -0
  141. package/types/graphic/TransformFeedbackSimulator.d.ts +55 -0
  142. package/types/graphic/VertexBufferBinding.d.ts +4 -0
  143. package/types/graphic/VertexElement.d.ts +1 -0
  144. package/types/graphic/enums/BufferBindFlag.d.ts +5 -3
  145. package/types/index.d.ts +7 -4
  146. package/types/input/InputManager.d.ts +25 -6
  147. package/types/input/enums/PointerButton.d.ts +8 -0
  148. package/types/input/keyboard/KeyboardManager.d.ts +41 -1
  149. package/types/input/pointer/Pointer.d.ts +37 -1
  150. package/types/input/pointer/PointerEventData.d.ts +4 -0
  151. package/types/input/pointer/PointerManager.d.ts +58 -0
  152. package/types/input/pointer/emitter/IHitResult.d.ts +11 -1
  153. package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +20 -1
  154. package/types/input/wheel/WheelManager.d.ts +34 -1
  155. package/types/lighting/AmbientLight.d.ts +9 -8
  156. package/types/lighting/DirectLight.d.ts +17 -0
  157. package/types/lighting/KHR_lights.d.ts +13 -1
  158. package/types/lighting/Light.d.ts +2 -0
  159. package/types/lighting/LightManager.d.ts +57 -0
  160. package/types/lighting/PointLight.d.ts +17 -0
  161. package/types/lighting/SpotLight.d.ts +17 -0
  162. package/types/lighting/ambientOcclusion/AmbientOcclusion.d.ts +4 -0
  163. package/types/lighting/ambientOcclusion/ScalableAmbientObscurancePass.d.ts +37 -1
  164. package/types/material/BaseMaterial.d.ts +15 -11
  165. package/types/material/Material.d.ts +6 -9
  166. package/types/mesh/BlendShape.d.ts +14 -1
  167. package/types/mesh/BlendShapeFrame.d.ts +11 -4
  168. package/types/mesh/BlendShapeManager.d.ts +100 -1
  169. package/types/mesh/BufferMesh.d.ts +2 -2
  170. package/types/mesh/MeshRenderer.d.ts +42 -0
  171. package/types/mesh/MeshTangentUtils.d.ts +9 -0
  172. package/types/mesh/ModelMesh.d.ts +28 -12
  173. package/types/mesh/PrimitiveMesh.d.ts +266 -104
  174. package/types/mesh/PrimitiveMeshOptions.d.ts +415 -0
  175. package/types/mesh/Skin.d.ts +12 -3
  176. package/types/mesh/SkinnedMeshRenderer.d.ts +27 -1
  177. package/types/mesh/enums/PrimitiveMeshCapMode.d.ts +21 -0
  178. package/types/mesh/index.d.ts +2 -0
  179. package/types/mesh/primitive/MeshPathUtils.d.ts +13 -0
  180. package/types/mesh/primitive/PolygonUtils.d.ts +44 -0
  181. package/types/mesh/primitive/PrimitiveMeshBuilder.d.ts +25 -0
  182. package/types/mesh/primitive/PrimitiveMeshRestorer.d.ts +15 -0
  183. package/types/mesh/primitive/SubdivisionUtils.d.ts +9 -0
  184. package/types/particle/ParticleBounds.d.ts +87 -0
  185. package/types/particle/ParticleBufferUtils.d.ts +33 -1
  186. package/types/particle/ParticleGenerator.d.ts +142 -24
  187. package/types/particle/ParticleMaterial.d.ts +3 -1
  188. package/types/particle/ParticleRenderer.d.ts +62 -6
  189. package/types/particle/ParticleSubEmitterSpawnState.d.ts +36 -0
  190. package/types/particle/ParticleSystemManager.d.ts +17 -0
  191. package/types/particle/ParticleTransformFeedbackSimulator.d.ts +48 -0
  192. package/types/particle/enums/ParticleInheritVelocityMode.d.ts +14 -0
  193. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +26 -1
  194. package/types/particle/enums/ParticleScaleMode.d.ts +5 -5
  195. package/types/particle/enums/ParticleSubEmitterInheritProperty.d.ts +17 -0
  196. package/types/particle/enums/ParticleSubEmitterType.d.ts +12 -0
  197. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +6 -1
  198. package/types/particle/enums/attributes/ParticleFeedbackVertexAttribute.d.ts +10 -0
  199. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +19 -1
  200. package/types/particle/index.d.ts +9 -0
  201. package/types/particle/modules/BirthSubEmitterCommand.d.ts +29 -0
  202. package/types/particle/modules/BirthSubEmitterState.d.ts +9 -0
  203. package/types/particle/modules/Burst.d.ts +23 -2
  204. package/types/particle/modules/ColorOverLifetimeModule.d.ts +19 -0
  205. package/types/particle/modules/CustomDataModule.d.ts +90 -0
  206. package/types/particle/modules/DeathSubEmitterCommand.d.ts +19 -0
  207. package/types/particle/modules/EmissionModule.d.ts +51 -4
  208. package/types/particle/modules/EmissionState.d.ts +13 -0
  209. package/types/particle/modules/ForceOverLifetimeModule.d.ts +16 -1
  210. package/types/particle/modules/InheritVelocityModule.d.ts +86 -0
  211. package/types/particle/modules/LimitVelocityOverLifetimeModule.d.ts +163 -0
  212. package/types/particle/modules/MainModule.d.ts +56 -11
  213. package/types/particle/modules/NoiseModule.d.ts +114 -0
  214. package/types/particle/modules/ParticleCompositeCurve.d.ts +46 -4
  215. package/types/particle/modules/ParticleCompositeGradient.d.ts +8 -2
  216. package/types/particle/modules/ParticleCurve.d.ts +31 -2
  217. package/types/particle/modules/ParticleGeneratorModule.d.ts +9 -3
  218. package/types/particle/modules/ParticleGradient.d.ts +22 -5
  219. package/types/particle/modules/RotationOverLifetimeModule.d.ts +27 -3
  220. package/types/particle/modules/SizeOverLifetimeModule.d.ts +25 -0
  221. package/types/particle/modules/SubEmitter.d.ts +32 -0
  222. package/types/particle/modules/SubEmittersModule.d.ts +111 -0
  223. package/types/particle/modules/TextureSheetAnimationModule.d.ts +14 -1
  224. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +124 -3
  225. package/types/particle/modules/shape/BaseShape.d.ts +65 -2
  226. package/types/particle/modules/shape/BoxShape.d.ts +13 -2
  227. package/types/particle/modules/shape/CircleShape.d.ts +13 -1
  228. package/types/particle/modules/shape/ConeShape.d.ts +13 -4
  229. package/types/particle/modules/shape/HemisphereShape.d.ts +13 -0
  230. package/types/particle/modules/shape/MeshShape.d.ts +26 -3
  231. package/types/particle/modules/shape/ShapeUtils.d.ts +13 -1
  232. package/types/particle/modules/shape/SphereShape.d.ts +13 -0
  233. package/types/physics/CharacterController.d.ts +24 -3
  234. package/types/physics/Collider.d.ts +47 -3
  235. package/types/physics/Collision.d.ts +3 -0
  236. package/types/physics/DynamicCollider.d.ts +33 -7
  237. package/types/physics/HitResult.d.ts +2 -2
  238. package/types/physics/PhysicsMaterial.d.ts +11 -2
  239. package/types/physics/PhysicsScene.d.ts +99 -7
  240. package/types/physics/StaticCollider.d.ts +5 -0
  241. package/types/physics/enums/HingeJointFlag.d.ts +14 -1
  242. package/types/physics/joint/HingeJoint.d.ts +4 -0
  243. package/types/physics/joint/Joint.d.ts +22 -2
  244. package/types/physics/joint/JointLimits.d.ts +2 -1
  245. package/types/physics/joint/JointMotor.d.ts +2 -1
  246. package/types/physics/shape/ColliderShape.d.ts +44 -7
  247. package/types/physics/shape/MeshColliderShape.d.ts +13 -12
  248. package/types/postProcess/FinalPass.d.ts +20 -1
  249. package/types/postProcess/PostProcess.d.ts +11 -6
  250. package/types/postProcess/PostProcessEffect.d.ts +6 -1
  251. package/types/postProcess/PostProcessEffectParameter.d.ts +23 -3
  252. package/types/postProcess/PostProcessManager.d.ts +43 -0
  253. package/types/postProcess/PostProcessPass.d.ts +3 -2
  254. package/types/postProcess/PostProcessUberPass.d.ts +2 -1
  255. package/types/postProcess/effects/BloomEffect.d.ts +26 -1
  256. package/types/postProcess/effects/TonemappingEffect.d.ts +3 -0
  257. package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +74 -0
  258. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
  259. package/types/renderingHardwareInterface/IPlatformPrimitive.d.ts +6 -0
  260. package/types/renderingHardwareInterface/IPlatformShaderProgram.d.ts +4 -0
  261. package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +0 -1
  262. package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +0 -1
  263. package/types/renderingHardwareInterface/IPlatformTransformFeedback.d.ts +36 -0
  264. package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +39 -0
  265. package/types/renderingHardwareInterface/index.d.ts +5 -0
  266. package/types/shader/BuiltinShaders.d.ts +27 -0
  267. package/types/shader/Shader.d.ts +52 -25
  268. package/types/shader/ShaderBlockProperty.d.ts +19 -0
  269. package/types/shader/ShaderData.d.ts +43 -4
  270. package/types/shader/ShaderFactory.d.ts +77 -0
  271. package/types/shader/ShaderMacro.d.ts +17 -2
  272. package/types/shader/ShaderMacroCollection.d.ts +57 -1
  273. package/types/shader/ShaderMacroProcessor.d.ts +54 -0
  274. package/types/shader/ShaderPass.d.ts +42 -13
  275. package/types/shader/ShaderProgram.d.ts +92 -1
  276. package/types/shader/ShaderProgramMap.d.ts +20 -0
  277. package/types/shader/ShaderProperty.d.ts +17 -0
  278. package/types/shader/ShaderTagKey.d.ts +2 -0
  279. package/types/shader/ShaderUniform.d.ts +49 -1
  280. package/types/shader/ShaderUniformBlock.d.ts +9 -1
  281. package/types/shader/enums/ConstantBufferBindingPoint.d.ts +7 -0
  282. package/types/shader/enums/ShaderLanguage.d.ts +1 -3
  283. package/types/shader/enums/ShaderPreprocessorDirective.d.ts +22 -0
  284. package/types/shader/index.d.ts +3 -1
  285. package/types/shader/state/BlendState.d.ts +16 -1
  286. package/types/shader/state/DepthState.d.ts +16 -1
  287. package/types/shader/state/RasterState.d.ts +19 -1
  288. package/types/shader/state/RenderState.d.ts +13 -2
  289. package/types/shader/state/RenderTargetBlendState.d.ts +2 -1
  290. package/types/shader/state/StencilState.d.ts +15 -1
  291. package/types/shadow/CascadedShadowCasterPass.d.ts +5 -3
  292. package/types/shadow/ShadowSliceData.d.ts +13 -1
  293. package/types/shadow/ShadowUtils.d.ts +41 -1
  294. package/types/sky/Sky.d.ts +13 -4
  295. package/types/sky/SkyBoxMaterial.d.ts +0 -7
  296. package/types/texture/RenderTarget.d.ts +28 -3
  297. package/types/texture/Texture.d.ts +46 -12
  298. package/types/texture/Texture2D.d.ts +4 -1
  299. package/types/texture/Texture2DArray.d.ts +4 -1
  300. package/types/texture/TextureCube.d.ts +4 -1
  301. package/types/texture/TextureUtils.d.ts +15 -1
  302. package/types/texture/enums/TextureFormat.d.ts +1 -9
  303. package/types/trail/TrailRenderer.d.ts +13 -8
  304. package/types/ui/IUICanvas.d.ts +16 -1
  305. package/types/utils/DisorderedArray.d.ts +3 -1
  306. package/types/xr/XRManager.d.ts +28 -0
  307. package/types/RenderPipeline/BatchUtils.d.ts +0 -1
  308. package/types/RenderPipeline/SubRenderElement.d.ts +0 -22
  309. package/types/clone/CloneManager.d.ts +0 -31
  310. package/types/clone/enums/CloneMode.d.ts +0 -13
  311. package/types/mesh/PrimitiveMeshRestorer.d.ts +0 -1
  312. package/types/physics/enums/ColliderShapeChangeFlag.d.ts +0 -1
  313. package/types/shader/ShaderPool.d.ts +0 -1
  314. package/types/shader/ShaderProgramPool.d.ts +0 -1
  315. package/types/shader/state/index.d.ts +0 -6
  316. package/types/shaderlib/ShaderFactory.d.ts +0 -20
  317. package/types/shaderlib/ShaderLib.d.ts +0 -73
  318. package/types/shaderlib/index.d.ts +0 -1
  319. package/types/shaderlib/particle/index.d.ts +0 -15
  320. package/types/shaderlib/pbr/index.d.ts +0 -11
  321. package/types/shaderlib/shadow/index.d.ts +0 -8
@@ -1,112 +1,274 @@
1
+ import { Vector2, Vector3 } from "@galacean/engine-math";
1
2
  import { Engine } from "../Engine";
2
- import { Buffer } from "../graphic/Buffer";
3
3
  import { ModelMesh } from "./ModelMesh";
4
+ import type { SphereMeshOptions, CuboidMeshOptions, PlaneMeshOptions, CylinderMeshOptions, TruncatedConeMeshOptions, ConeMeshOptions, CapsuleMeshOptions, TorusMeshOptions, CircleMeshOptions, RingMeshOptions, RegularPolyhedronMeshOptions, RevolvedSurfaceMeshOptions, TubeMeshOptions, PolygonMeshOptions, LinearExtrudedPolygonMeshOptions, PathExtrudedPolygonMeshOptions, TorusKnotMeshOptions, RoundedCuboidMeshOptions, PolygonShape } from "./PrimitiveMeshOptions";
4
5
  /**
5
- * Used to generate common primitive meshes.
6
+ * Creates primitive meshes in local space. Angle ranges use degrees.
7
+ * Meshes have one sub-mesh unless material grouping is enabled.
8
+ * @remarks
9
+ * Input arrays and vectors are copied. Changing them later does not update the mesh.
10
+ * Device restoration uses the original creation inputs; later mesh edits are not backed up.
6
11
  */
7
12
  export declare class PrimitiveMesh {
8
- private static _tempVec30;
9
13
  private static readonly _sphereSeedPositions;
10
14
  private static readonly _sphereSeedCells;
11
- private static _sphereEdgeIdx;
12
- private static _spherePoleIdx;
13
- /**
14
- * Create a sphere mesh.
15
- * @param engine - Engine
16
- * @param radius - Sphere radius
17
- * @param segments - Number of segments
18
- * @param noLongerAccessible - No longer access the vertices of the mesh after creation
19
- * @returns Sphere model mesh
20
- */
21
- static createSphere(engine: Engine, radius?: number, segments?: number, noLongerAccessible?: boolean): ModelMesh;
22
- /**
23
- * Create a sphere mesh by implementing Catmull-Clark Surface Subdivision Algorithm.
24
- * Max step is limited to 6.
25
- * @param engine - Engine
26
- * @param radius - Sphere radius
27
- * @param step - Number of subdiv steps
28
- * @param noLongerAccessible - No longer access the vertices of the mesh after creation
29
- * @returns Sphere model mesh
30
- */
31
- static createSubdivisionSurfaceSphere(engine: Engine, radius?: number, step?: number, noLongerAccessible?: boolean): ModelMesh;
32
- /**
33
- * Create a cuboid mesh.
34
- * @param engine - Engine
35
- * @param width - Cuboid width
36
- * @param height - Cuboid height
37
- * @param depth - Cuboid depth
38
- * @param noLongerAccessible - No longer access the vertices of the mesh after creation
39
- * @returns Cuboid model mesh
40
- */
41
- static createCuboid(engine: Engine, width?: number, height?: number, depth?: number, noLongerAccessible?: boolean): ModelMesh;
42
- /**
43
- * Create a plane mesh.
44
- * @param engine - Engine
45
- * @param width - Plane width
46
- * @param height - Plane height
47
- * @param horizontalSegments - Plane horizontal segments
48
- * @param verticalSegments - Plane vertical segments
49
- * @param noLongerAccessible - No longer access the vertices of the mesh after creation
50
- * @returns Plane model mesh
51
- */
52
- static createPlane(engine: Engine, width?: number, height?: number, horizontalSegments?: number, verticalSegments?: number, noLongerAccessible?: boolean): ModelMesh;
53
- /**
54
- * Create a cylinder mesh.
55
- * @param engine - Engine
56
- * @param radiusTop - The radius of top cap
57
- * @param radiusBottom - The radius of bottom cap
58
- * @param height - The height of torso
59
- * @param radialSegments - Cylinder radial segments
60
- * @param heightSegments - Cylinder height segments
61
- * @param noLongerAccessible - No longer access the vertices of the mesh after creation
62
- * @returns Cylinder model mesh
63
- */
64
- static createCylinder(engine: Engine, radiusTop?: number, radiusBottom?: number, height?: number, radialSegments?: number, heightSegments?: number, noLongerAccessible?: boolean): ModelMesh;
65
- /**
66
- * Create a torus mesh.
67
- * @param engine - Engine
68
- * @param radius - Torus radius
69
- * @param tubeRadius - Torus tube
70
- * @param radialSegments - Torus radial segments
71
- * @param tubularSegments - Torus tubular segments
72
- * @param arc - Central angle
73
- * @param noLongerAccessible - No longer access the vertices of the mesh after creation
74
- * @returns Torus model mesh
75
- */
76
- static createTorus(engine: Engine, radius?: number, tubeRadius?: number, radialSegments?: number, tubularSegments?: number, arc?: number, noLongerAccessible?: boolean): ModelMesh;
77
- /**
78
- * Create a cone mesh.
79
- * @param engine - Engine
80
- * @param radius - The radius of cap
81
- * @param height - The height of torso
82
- * @param radialSegments - Cone radial segments
83
- * @param heightSegments - Cone height segments
84
- * @param noLongerAccessible - No longer access the vertices of the mesh after creation
85
- * @returns Cone model mesh
86
- */
87
- static createCone(engine: Engine, radius?: number, height?: number, radialSegments?: number, heightSegments?: number, noLongerAccessible?: boolean): ModelMesh;
88
- /**
89
- * Create a capsule mesh.
90
- * @param engine - Engine
91
- * @param radius - The radius of the two hemispherical ends
92
- * @param height - The height of the cylindrical part, measured between the centers of the hemispherical ends
93
- * @param radialSegments - Hemispherical end radial segments
94
- * @param heightSegments - Cylindrical part height segments
95
- * @param noLongerAccessible - No longer access the vertices of the mesh after creation
96
- * @returns Capsule model mesh
97
- */
98
- static createCapsule(engine: Engine, radius?: number, height?: number, radialSegments?: number, heightSegments?: number, noLongerAccessible?: boolean): ModelMesh;
99
- /**
100
- * Duplicate vertices at the poles and adjust their UV coordinates.
101
- */
102
- private static _generateAndReplacePoleUV;
103
- /**
104
- * Get edge point index for subdivision surface sphere.
105
- */
106
- private static _calculateEdgeIndex;
107
- static _setCylinderData(cylinderMesh: ModelMesh, radiusTop: number, radiusBottom: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
108
- static _setCapsuleData(capsuleMesh: ModelMesh, radius: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
109
- private static _initialize;
110
- private static _generateIndices;
111
- private static _createCapsuleCap;
15
+ private static readonly _goldenRatio;
16
+ private static readonly _inverseGoldenRatio;
17
+ private static readonly _regularPolyhedra;
18
+ /**
19
+ * Create a sphere or an open spherical section from a subdivided cube.
20
+ * U follows the horizontal angle interval and V follows the vertical angle interval, each scaled to 0–1.
21
+ * The horizontal start marks the U seam; V increases from the upper to the lower boundary.
22
+ * @param engine - The engine that owns the mesh
23
+ * @param radius - The radius in local units
24
+ * @param options - Optional mesh generation settings
25
+ * @returns The generated mesh
26
+ */
27
+ static createSphere(engine: Engine, radius: number, options?: SphereMeshOptions): ModelMesh;
28
+ /**
29
+ * Create an axis-aligned cuboid centered at the origin.
30
+ * @remarks
31
+ * Each face spans 0–1 in U/V. Face directions (+U, +V) are:
32
+ * +Y: (+X, +Z); -Y: (+X, -Z); -X: (+Z, -Y);
33
+ * +X: (-Z, -Y); +Z: (+X, -Y); -Z: (-X, -Y).
34
+ * @param engine - The engine that owns the mesh
35
+ * @param width - The full size along X in local units
36
+ * @param height - The full size along Y in local units
37
+ * @param depth - The full size along Z in local units
38
+ * @param options - Optional mesh generation settings
39
+ * @returns The generated mesh
40
+ */
41
+ static createCuboid(engine: Engine, width: number, height: number, depth: number, options?: CuboidMeshOptions): ModelMesh;
42
+ /**
43
+ * Create a plane in XZ facing +Y, centered at the origin.
44
+ * UVs span 0–1, with U along +X and V along +Z.
45
+ * @param engine - The engine that owns the mesh
46
+ * @param width - The full size along X in local units
47
+ * @param depth - The full size along Z in local units
48
+ * @param options - Optional mesh generation settings
49
+ * @returns The generated mesh
50
+ */
51
+ static createPlane(engine: Engine, width: number, depth: number, options?: PlaneMeshOptions): ModelMesh;
52
+ /**
53
+ * Create a cylinder centered on Y with equal end radii.
54
+ * U spans the angular range from 0 to 1; V runs from 0 at the top to 1 at the bottom.
55
+ * The default side seam is at -Z. Both caps use planar UVs with U along +X and V along -Z.
56
+ * @param engine - The engine that owns the mesh
57
+ * @param radius - The radius in local units
58
+ * @param height - The full size along Y in local units
59
+ * @param options - Optional mesh generation settings
60
+ * @returns The generated mesh
61
+ */
62
+ static createCylinder(engine: Engine, radius: number, height: number, options?: CylinderMeshOptions): ModelMesh;
63
+ /**
64
+ * Create a truncated cone centered on Y with independently sized ends.
65
+ * U spans the angular range from 0 to 1; V runs from 0 at the top to 1 at the bottom.
66
+ * The default side seam is at -Z. Both caps use planar UVs with U along +X and V along -Z.
67
+ * @param engine - The engine that owns the mesh
68
+ * @param topRadius - The top radius in local units
69
+ * @param bottomRadius - The bottom radius in local units
70
+ * @param height - The full size along Y in local units
71
+ * @param options - Optional mesh generation settings
72
+ * @returns The generated mesh
73
+ */
74
+ static createTruncatedCone(engine: Engine, topRadius: number, bottomRadius: number, height: number, options?: TruncatedConeMeshOptions): ModelMesh;
75
+ /**
76
+ * Create a cone centered on Y with its tip at the top.
77
+ * U spans the angular range from 0 to 1; V runs from 0 at the tip to 1 at the base.
78
+ * The default side seam is at -Z. The base uses planar UVs with U along +X and V along -Z.
79
+ * @param engine - The engine that owns the mesh
80
+ * @param radius - The bottom radius in local units
81
+ * @param height - The full size along Y in local units
82
+ * @param options - Optional mesh generation settings
83
+ * @returns The generated mesh
84
+ */
85
+ static createCone(engine: Engine, radius: number, height: number, options?: ConeMeshOptions): ModelMesh;
86
+ /**
87
+ * Create a capsule centered on Y.
88
+ * U runs around Y from -Z towards -X. V runs from 0 at the top to 1 at the bottom,
89
+ * proportional to surface length along the hemispheres and cylinder.
90
+ * @param engine - The engine that owns the mesh
91
+ * @param radius - The radius of the cylinder and hemispherical ends in local units
92
+ * @param cylinderHeight - The straight cylindrical section height in local units; total height is `cylinderHeight + 2 * radius`
93
+ * @param options - Optional mesh generation settings
94
+ * @returns The generated mesh
95
+ */
96
+ static createCapsule(engine: Engine, radius: number, cylinderHeight: number, options?: CapsuleMeshOptions): ModelMesh;
97
+ /**
98
+ * Create a torus centered in XY around Z.
99
+ * U spans the ring angle interval and V spans the tube angle interval, each scaled to 0–1.
100
+ * @param engine - The engine that owns the mesh
101
+ * @param radius - The distance from the origin to the tube centerline in local units
102
+ * @param tubeRadius - The radius of the tube cross-section in local units
103
+ * @param options - Optional mesh generation settings
104
+ * @returns The generated mesh
105
+ */
106
+ static createTorus(engine: Engine, radius: number, tubeRadius: number, options?: TorusMeshOptions): ModelMesh;
107
+ /**
108
+ * Create a filled disk or sector in XY facing +Z.
109
+ * UVs project X/Y onto the full disk's bounding square; angular cuts do not rescale them.
110
+ * @param engine - The engine that owns the mesh
111
+ * @param radius - The radius in local units
112
+ * @param options - Optional mesh generation settings
113
+ * @returns The generated mesh
114
+ */
115
+ static createCircle(engine: Engine, radius: number, options?: CircleMeshOptions): ModelMesh;
116
+ /**
117
+ * Create a ring or ring sector in XY facing +Z.
118
+ * UVs project X/Y onto the outer disk's bounding square; angular cuts do not rescale them.
119
+ * @param engine - The engine that owns the mesh
120
+ * @param outerRadius - The outer radius in local units
121
+ * @param innerRadius - The inner radius in local units
122
+ * @param options - Optional mesh generation settings
123
+ * @returns The generated mesh
124
+ */
125
+ static createRing(engine: Engine, outerRadius: number, innerRadius: number, options?: RingMeshOptions): ModelMesh;
126
+ /**
127
+ * Create a regular tetrahedron or its spherical subdivision.
128
+ * UVs use spherical projection around Y, with the U seam at +X and V from 0 at +Y to 1 at -Y.
129
+ * Triangles crossing the U seam may use values above 1.
130
+ * @param engine - The engine that owns the mesh
131
+ * @param radius - The distance from the origin to each vertex in local units
132
+ * @param options - Optional mesh generation settings
133
+ * @returns The generated mesh
134
+ */
135
+ static createTetrahedron(engine: Engine, radius: number, options?: RegularPolyhedronMeshOptions): ModelMesh;
136
+ /**
137
+ * Create a regular octahedron or its spherical subdivision.
138
+ * UVs use spherical projection around Y, with the U seam at +X and V from 0 at +Y to 1 at -Y.
139
+ * Triangles crossing the U seam may use values above 1.
140
+ * @param engine - The engine that owns the mesh
141
+ * @param radius - The distance from the origin to each vertex in local units
142
+ * @param options - Optional mesh generation settings
143
+ * @returns The generated mesh
144
+ */
145
+ static createOctahedron(engine: Engine, radius: number, options?: RegularPolyhedronMeshOptions): ModelMesh;
146
+ /**
147
+ * Create a regular icosahedron or its spherical subdivision.
148
+ * UVs use spherical projection around Y, with the U seam at +X and V from 0 at +Y to 1 at -Y.
149
+ * Triangles crossing the U seam may use values above 1.
150
+ * @param engine - The engine that owns the mesh
151
+ * @param radius - The distance from the origin to each vertex in local units
152
+ * @param options - Optional mesh generation settings
153
+ * @returns The generated mesh
154
+ */
155
+ static createIcosahedron(engine: Engine, radius: number, options?: RegularPolyhedronMeshOptions): ModelMesh;
156
+ /**
157
+ * Create a regular dodecahedron or its spherical subdivision.
158
+ * UVs use spherical projection around Y, with the U seam at +X and V from 0 at +Y to 1 at -Y.
159
+ * Triangles crossing the U seam may use values above 1.
160
+ * @param engine - The engine that owns the mesh
161
+ * @param radius - The distance from the origin to each vertex in local units
162
+ * @param options - Optional mesh generation settings
163
+ * @returns The generated mesh
164
+ */
165
+ static createDodecahedron(engine: Engine, radius: number, options?: RegularPolyhedronMeshOptions): ModelMesh;
166
+ /**
167
+ * Create a surface of revolution by rotating a radius-height profile around Y.
168
+ * No end caps are added automatically.
169
+ * Define inner walls and closed ends in the profile when needed.
170
+ * U spans the revolution from 0 to 1; V advances uniformly by profile point index from 0 to 1.
171
+ * @param engine - The engine that owns the mesh
172
+ * @param profile - The profile points in input order, with at least two points; X is radius and Y is height. Repeat the first point to close the profile
173
+ * @param options - Optional mesh generation settings
174
+ * @returns The generated mesh
175
+ */
176
+ static createRevolvedSurface(engine: Engine, profile: readonly Vector2[], options?: RevolvedSurfaceMeshOptions): ModelMesh;
177
+ /**
178
+ * Sweep a circular cross-section along a path without end caps.
179
+ * U measures normalized path distance; V runs around the generated path frame from 0 to 1.
180
+ * @param engine - The engine that owns the mesh
181
+ * @param path - The centerline points, resampled at equal distances along the polyline; at least two distinct points are required
182
+ * @param radius - The radius of the cross-section in local units
183
+ * @param options - Optional mesh generation settings
184
+ * @returns The generated mesh
185
+ */
186
+ static createTube(engine: Engine, path: readonly Vector3[], radius: number, options?: TubeMeshOptions): ModelMesh;
187
+ /**
188
+ * Create a zero-thickness polygon mesh in the XY plane, facing +Z.
189
+ * UVs use the local X/Y coordinates directly, without normalization.
190
+ * @param engine - The engine that owns the mesh
191
+ * @param shapes - A contour, a polygon with holes, or an array of polygons; closing points need not be repeated
192
+ * @param options - Optional mesh generation settings
193
+ * @returns The triangulated polygon mesh without side walls
194
+ */
195
+ static createPolygon(engine: Engine, shapes: readonly Vector2[] | PolygonShape | readonly PolygonShape[], options?: PolygonMeshOptions): ModelMesh;
196
+ /**
197
+ * Extrude polygon contours along +Z.
198
+ * Caps use their local X/Y coordinates as UVs. Wall U measures the original contour length;
199
+ * V follows the generated extrusion layers from 0 to 1, including bevel layers.
200
+ * @param engine - The engine that owns the mesh
201
+ * @param shapes - A contour, a polygon with holes, or an array of polygons; closing points need not be repeated
202
+ * @param depth - The total extrusion depth in local units, including both end bevels
203
+ * @param options - Optional linear extrusion settings
204
+ * @returns The mesh with side walls and both end caps
205
+ */
206
+ static createExtrudedPolygon(engine: Engine, shapes: readonly Vector2[] | PolygonShape | readonly PolygonShape[], depth: number, options?: LinearExtrudedPolygonMeshOptions): ModelMesh;
207
+ /**
208
+ * Extrude polygon contours along a spatial path.
209
+ * @remarks
210
+ * Open paths generate both end caps; closed paths join the end cross-sections without caps.
211
+ * Caps use cross-section X/Y coordinates as UVs. Wall U measures the contour length;
212
+ * V follows the path from 0 to 1.
213
+ * @param engine - The engine that owns the mesh
214
+ * @param shapes - A contour, a polygon with holes, or an array of polygons; closing points need not be repeated
215
+ * @param path - The extrusion path in local coordinates, with at least two distinct points
216
+ * @param options - Optional path extrusion settings
217
+ * @returns The mesh swept along the path
218
+ */
219
+ static createExtrudedPolygon(engine: Engine, shapes: readonly Vector2[] | PolygonShape | readonly PolygonShape[], path: readonly Vector3[], options?: PathExtrudedPolygonMeshOptions): ModelMesh;
220
+ /**
221
+ * Create a closed torus knot. At least one of `axisTurns` and `crossSectionTurns` must be nonzero.
222
+ * U follows the knot parameter from 0 to 1; V runs around the generated tube cross-section from 0 to 1.
223
+ * @param engine - The engine that owns the mesh
224
+ * @param radius - The base radius of the torus in local units
225
+ * @param tubeRadius - The radius of the tube cross-section in local units
226
+ * @param axisTurns - The signed integer revolution count around the torus axis; negative values reverse the winding
227
+ * @param crossSectionTurns - The signed integer revolution count around the torus cross-section; negative values reverse the winding
228
+ * @param options - Optional mesh generation settings
229
+ * @returns The generated mesh
230
+ */
231
+ static createTorusKnot(engine: Engine, radius: number, tubeRadius: number, axisTurns: number, crossSectionTurns: number, options?: TorusKnotMeshOptions): ModelMesh;
232
+ /**
233
+ * Create an axis-aligned cuboid with rounded edges and corners.
234
+ * @remarks
235
+ * UVs preserve the face orientations of {@link PrimitiveMesh.createCuboid} and account for rounded edge length.
236
+ * @param engine - The engine that owns the mesh
237
+ * @param width - The full size along X in local units
238
+ * @param height - The full size along Y in local units
239
+ * @param depth - The full size along Z in local units
240
+ * @param cornerRadius - The edge and corner radius in local units, clamped to half the smallest dimension
241
+ * @param options - Optional mesh generation settings
242
+ * @returns The generated mesh
243
+ */
244
+ static createRoundedCuboid(engine: Engine, width: number, height: number, depth: number, cornerRadius: number, options?: RoundedCuboidMeshOptions): ModelMesh;
245
+ private static _createPlaneData;
246
+ private static _createCuboidData;
247
+ private static _createCylinderData;
248
+ private static _createCapsuleData;
249
+ private static _createTorusData;
250
+ private static _createCircleData;
251
+ private static _createRingData;
252
+ private static _createRoundedCuboidData;
253
+ private static _createRevolvedSurfaceData;
254
+ private static _createTubeData;
255
+ private static _createTubeSurfaceData;
256
+ private static _createTorusKnotData;
257
+ private static _createRegularPolyhedronData;
258
+ private static _addPolyhedronFace;
259
+ private static _createPolygonData;
260
+ private static _createExtrudedPolygonData;
261
+ private static _insetContour;
262
+ private static _createSphereData;
263
+ private static _createSphereSectionData;
264
+ private static _clipSpherePolygon;
265
+ private static _createSphereSurfaceData;
266
+ private static _replacePoleUV;
267
+ private static _createMesh;
268
+ private static _polygons;
269
+ private static _setBounds;
270
+ private static _copy;
271
+ private static _createArcSamples;
272
+ private static _getSegmentCount;
273
+ private static _normalizeVector;
112
274
  }