@galacean/engine-core 0.0.0-experimental-ktx2.0 → 0.0.0-experimental-double11.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 (125) hide show
  1. package/dist/main.js +9997 -10838
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +9997 -10838
  4. package/dist/module.js +9901 -10742
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/enums/SpriteDirtyFlag.d.ts +13 -0
  8. package/types/Camera.d.ts +8 -30
  9. package/types/Component.d.ts +0 -1
  10. package/types/ComponentsManager.d.ts +3 -2
  11. package/types/Engine.d.ts +4 -9
  12. package/types/Entity.d.ts +0 -2
  13. package/types/ListenerUpdateFlag.d.ts +12 -0
  14. package/types/RenderPipeline/BasicRenderPipeline.d.ts +2 -1
  15. package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
  16. package/types/RenderPipeline/RenderElement.d.ts +4 -2
  17. package/types/RenderPipeline/RenderQueue.d.ts +1 -1
  18. package/types/RenderPipeline/SpriteElement.d.ts +3 -1
  19. package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
  20. package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
  21. package/types/RenderPipeline/enums/PipelineStage.d.ts +0 -2
  22. package/types/Scene.d.ts +4 -3
  23. package/types/SceneManager.d.ts +5 -28
  24. package/types/animation/Animator.d.ts +2 -0
  25. package/types/animation/AnimatorStateTransition.d.ts +12 -0
  26. package/types/animation/AnimatorTransitionBase.d.ts +10 -0
  27. package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
  28. package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
  29. package/types/animation/enums/StateMachineState.d.ts +13 -0
  30. package/types/animation/index.d.ts +0 -4
  31. package/types/animation/internal/AnimatorPlayableObject.d.ts +23 -0
  32. package/types/animation/internal/animationCurveOwner/Assembler/PositionAnimationCurveOwnerAssembler.d.ts +1 -0
  33. package/types/animation/internal/animationCurveOwner/Assembler/RotationAnimationCurveOwnerAssembler.d.ts +1 -0
  34. package/types/animation/internal/animationCurveOwner/Assembler/ScaleAnimationCurveOwnerAssembler.d.ts +1 -0
  35. package/types/animation/internal/animationCurveOwner/Assembler/UniversalAnimationCurveOwnerAssembler.d.ts +1 -0
  36. package/types/asset/AssetType.d.ts +0 -2
  37. package/types/asset/Loader.d.ts +1 -3
  38. package/types/asset/ResourceManager.d.ts +2 -6
  39. package/types/base/Constant.d.ts +0 -1
  40. package/types/clone/ComponentCloner.d.ts +1 -2
  41. package/types/fog/EXP2Fog.d.ts +15 -0
  42. package/types/fog/Fog.d.ts +14 -0
  43. package/types/fog/LinearFog.d.ts +22 -0
  44. package/types/fog/index.d.ts +3 -0
  45. package/types/graphic/Buffer.d.ts +6 -22
  46. package/types/graphic/BufferUtil.d.ts +0 -1
  47. package/types/graphic/Primitive.d.ts +1 -0
  48. package/types/graphic/SubPrimitive.d.ts +9 -0
  49. package/types/graphic/VertexElement.d.ts +6 -10
  50. package/types/index.d.ts +0 -1
  51. package/types/input/InputManager.d.ts +2 -2
  52. package/types/mesh/BufferMesh.d.ts +2 -2
  53. package/types/mesh/ModelMesh.d.ts +41 -62
  54. package/types/mesh/PrimitiveMesh.d.ts +2 -4
  55. package/types/mesh/Skin.d.ts +0 -3
  56. package/types/mesh/SkinnedMeshRenderer.d.ts +11 -20
  57. package/types/mesh/index.d.ts +5 -6
  58. package/types/particle/ParticleBufferUtils.d.ts +1 -0
  59. package/types/particle/ParticleGenerator.d.ts +72 -0
  60. package/types/particle/ParticleMaterial.d.ts +28 -0
  61. package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
  62. package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
  63. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
  64. package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
  65. package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
  66. package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
  67. package/types/particle/enums/ParticleStopMode.d.ts +6 -0
  68. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
  69. package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
  70. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
  71. package/types/particle/modules/Burst.d.ts +14 -0
  72. package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
  73. package/types/particle/modules/EmissionModule.d.ts +45 -0
  74. package/types/particle/modules/MainModule.d.ts +68 -0
  75. package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
  76. package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
  77. package/types/particle/modules/ParticleCurve.d.ts +56 -0
  78. package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
  79. package/types/particle/modules/ParticleGradient.d.ts +94 -0
  80. package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
  81. package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
  82. package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
  83. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
  84. package/types/particle/modules/shape/BaseShape.d.ts +12 -0
  85. package/types/particle/modules/shape/BoxShape.d.ts +11 -0
  86. package/types/particle/modules/shape/CircleShape.d.ts +17 -0
  87. package/types/particle/modules/shape/ConeShape.d.ts +28 -0
  88. package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
  89. package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
  90. package/types/particle/modules/shape/SphereShape.d.ts +9 -0
  91. package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
  92. package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
  93. package/types/particle/modules/shape/index.d.ts +6 -0
  94. package/types/physics/Collider.d.ts +2 -1
  95. package/types/physics/PhysicsManager.d.ts +4 -2
  96. package/types/physics/PhysicsScene.d.ts +6 -2
  97. package/types/physics/index.d.ts +7 -7
  98. package/types/physics/joint/Joint.d.ts +1 -2
  99. package/types/physics/joint/SpringJoint.d.ts +2 -1
  100. package/types/physics/shape/BoxColliderShape.d.ts +2 -0
  101. package/types/physics/shape/CapsuleColliderShape.d.ts +2 -0
  102. package/types/physics/shape/ColliderShape.d.ts +4 -1
  103. package/types/physics/shape/PlaneColliderShape.d.ts +1 -0
  104. package/types/physics/shape/SphereColliderShape.d.ts +2 -0
  105. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
  106. package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +1 -1
  107. package/types/renderingHardwareInterface/IPlatformTexture2DArray.d.ts +1 -1
  108. package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +1 -1
  109. package/types/shader/Shader.d.ts +0 -22
  110. package/types/shader/enums/RenderStateElementKey.d.ts +3 -1
  111. package/types/shader/index.d.ts +0 -1
  112. package/types/shaderlib/particle/index.d.ts +14 -0
  113. package/types/shadow/CascadedShadowCasterPass.d.ts +6 -5
  114. package/types/shadow/enum/ShadowMode.d.ts +13 -0
  115. package/types/texture/RenderTarget.d.ts +2 -1
  116. package/types/texture/Texture2D.d.ts +1 -1
  117. package/types/texture/Texture2DArray.d.ts +1 -1
  118. package/types/texture/TextureCube.d.ts +1 -1
  119. package/types/texture/enums/TextureFormat.d.ts +49 -55
  120. /package/types/animation/{internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts → AnimatorStatePlayData.d.ts} +0 -0
  121. /package/types/animation/internal/{animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts → AnimatorStateInfo.d.ts} +0 -0
  122. /package/types/animation/internal/{animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts → AnimatorStateMachineData.d.ts} +0 -0
  123. /package/types/animation/internal/{animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts → CrossCurveData.d.ts} +0 -0
  124. /package/types/animation/internal/animationCurveOwner/{assembler/ScaleAnimationCurveOwnerAssembler.d.ts → Assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts} +0 -0
  125. /package/types/animation/internal/animationCurveOwner/{assembler/UniversalAnimationCurveOwnerAssembler.d.ts → Assembler/IAnimationCurveOwnerAssembler.d.ts} +0 -0
@@ -0,0 +1,22 @@
1
+ import { Entity } from "../Entity";
2
+ import { Fog } from "./Fog";
3
+ /**
4
+ * Linear fog, according to the distance of the camera linear difference fog density.
5
+ */
6
+ export declare class LinearFog extends Fog {
7
+ private static _nearProperty;
8
+ private static _farProperty;
9
+ /**
10
+ * Start of fog.
11
+ */
12
+ get near(): number;
13
+ set near(value: number);
14
+ /**
15
+ * End of fog.
16
+ */
17
+ get far(): number;
18
+ set far(value: number);
19
+ private _near;
20
+ private _far;
21
+ constructor(entity: Entity);
22
+ }
@@ -0,0 +1,3 @@
1
+ export { EXP2Fog } from "./EXP2Fog";
2
+ export { Fog } from "./Fog";
3
+ export { LinearFog } from "./LinearFog";
@@ -11,8 +11,6 @@ export declare class Buffer extends GraphicsResource {
11
11
  private _byteLength;
12
12
  private _bufferUsage;
13
13
  private _platformBuffer;
14
- private _readable;
15
- private _data;
16
14
  /**
17
15
  * Buffer binding flag.
18
16
  */
@@ -25,36 +23,22 @@ export declare class Buffer extends GraphicsResource {
25
23
  * Buffer usage.
26
24
  */
27
25
  get bufferUsage(): BufferUsage;
28
- /**
29
- * If buffer is readable.
30
- */
31
- get readable(): boolean;
32
- /**
33
- * Buffer data cache.
34
- *
35
- * @remarks
36
- * Buffer must be readable.
37
- * If the data you get is modified, must call `setData()` to update buffer to GPU.
38
- */
39
- get data(): Uint8Array;
40
26
  /**
41
27
  * Create Buffer.
42
28
  * @param engine - Engine
43
29
  * @param type - Buffer binding flag
44
30
  * @param byteLength - Byte length
45
31
  * @param bufferUsage - Buffer usage
46
- * @param readable - If buffer is readable
47
32
  */
48
- constructor(engine: Engine, type: BufferBindFlag, byteLength: number, bufferUsage?: BufferUsage, readable?: boolean);
33
+ constructor(engine: Engine, type: BufferBindFlag, byteLength: number, bufferUsage?: BufferUsage);
49
34
  /**
50
35
  * Create Buffer.
51
36
  * @param engine - Engine
52
37
  * @param type - Buffer binding flag
53
- * @param data - Buffer data, if `readable` is true, the`data` property will store a copy of this
38
+ * @param data - Byte
54
39
  * @param bufferUsage - Buffer usage
55
- * @param readable - If buffer is readable
56
40
  */
57
- constructor(engine: Engine, type: BufferBindFlag, data: ArrayBuffer | ArrayBufferView, bufferUsage?: BufferUsage, readable?: boolean);
41
+ constructor(engine: Engine, type: BufferBindFlag, data: ArrayBuffer | ArrayBufferView, bufferUsage?: BufferUsage);
58
42
  /**
59
43
  * Bind buffer.
60
44
  */
@@ -106,9 +90,9 @@ export declare class Buffer extends GraphicsResource {
106
90
  * @param dataLength - Output data length
107
91
  */
108
92
  getData(data: ArrayBufferView, bufferByteOffset: number, dataOffset: number, dataLength: number): void;
93
+ _rebuild(): void;
109
94
  /**
110
- * Mark buffer as readable, the `data` property will be not accessible anymore.
95
+ * @deprecated
111
96
  */
112
- markAsUnreadable(): void;
113
- _rebuild(): void;
97
+ resize(byteLength: number): void;
114
98
  }
@@ -4,7 +4,6 @@ export interface ElementInfo {
4
4
  size: number;
5
5
  type: DataType;
6
6
  normalized: boolean;
7
- normalizedScaleFactor: number;
8
7
  }
9
8
  export declare class BufferUtil {
10
9
  static _getGLIndexType(indexFormat: IndexFormat): DataType;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { MeshTopology } from "./enums/MeshTopology";
2
+ export declare class SubPrimitive {
3
+ /** Start drawing offset. */
4
+ start: number;
5
+ /** Drawing count. */
6
+ count: number;
7
+ /** Drawing topology. */
8
+ topology: MeshTopology;
9
+ }
@@ -4,16 +4,16 @@ import { VertexElementFormat } from "./enums/VertexElementFormat";
4
4
  * Vertex element.
5
5
  */
6
6
  export declare class VertexElement {
7
- _formatMetaInfo: ElementInfo;
8
- private _attributeName;
7
+ _glElementInfo: ElementInfo;
8
+ private _semantic;
9
9
  private _offset;
10
10
  private _format;
11
11
  private _bindingIndex;
12
12
  private _instanceStepRate;
13
13
  /**
14
- * Vertex attribute.
14
+ * Vertex semantic.
15
15
  */
16
- get attribute(): string;
16
+ get semantic(): string;
17
17
  /**
18
18
  * Vertex data byte offset.
19
19
  */
@@ -34,15 +34,11 @@ export declare class VertexElement {
34
34
  get instanceStepRate(): number;
35
35
  /**
36
36
  * Create vertex element.
37
- * @param attribute - Input attribute
37
+ * @param semantic - Input vertex semantic
38
38
  * @param offset - Vertex data byte offset
39
39
  * @param format - Vertex data format
40
40
  * @param bindingIndex - Vertex buffer binding index
41
41
  * @param instanceStepRate - Instance cadence, the number of instances drawn for each vertex in the buffer, non-instance elements must be 0.
42
42
  */
43
- constructor(attribute: string, offset: number, format: VertexElementFormat, bindingIndex: number, instanceStepRate?: number);
44
- /**
45
- * @deprecated use `attributeName` instead
46
- */
47
- get semantic(): string;
43
+ constructor(semantic: string, offset: number, format: VertexElementFormat, bindingIndex: number, instanceStepRate?: number);
48
44
  }
package/types/index.d.ts CHANGED
@@ -26,7 +26,6 @@ export * from "./RenderPipeline/index";
26
26
  export * from "./base";
27
27
  export { Background } from "./Background";
28
28
  export { BackgroundMode } from "./enums/BackgroundMode";
29
- export { DepthTextureMode } from "./enums/DepthTextureMode";
30
29
  export { FogMode } from "./enums/FogMode";
31
30
  export { CameraClearFlags } from "./enums/CameraClearFlags";
32
31
  export { ColorSpace } from "./enums/ColorSpace";
@@ -1,7 +1,7 @@
1
- import { Vector3 } from "@galacean/engine-math";
2
1
  import { Keys } from "./enums/Keys";
3
- import { PointerButton } from "./enums/PointerButton";
4
2
  import { Pointer } from "./pointer/Pointer";
3
+ import { PointerButton } from "./enums/PointerButton";
4
+ import { Vector3 } from "@galacean/engine-math";
5
5
  /**
6
6
  * InputManager manages device input such as mouse, touch, keyboard, etc.
7
7
  */
@@ -27,10 +27,10 @@ export declare class BufferMesh extends Mesh {
27
27
  setVertexElements(elements: VertexElement[]): void;
28
28
  /**
29
29
  * Set vertex buffer binding.
30
- * @param vertexBufferBinding - Vertex buffer binding
30
+ * @param vertexBufferBindings - Vertex buffer binding
31
31
  * @param index - Vertex buffer index, the default value is 0
32
32
  */
33
- setVertexBufferBinding(vertexBufferBinding: VertexBufferBinding, index?: number): void;
33
+ setVertexBufferBinding(vertexBufferBindings: VertexBufferBinding, index?: number): void;
34
34
  /**
35
35
  * Set vertex buffer binding.
36
36
  * @param vertexBuffer - Vertex buffer
@@ -15,8 +15,12 @@ export declare class ModelMesh extends Mesh {
15
15
  private static _tempVec3;
16
16
  private static _tempVec4;
17
17
  private _vertexCount;
18
- private _vertexCountDirty;
19
- private _dataVersionCounter;
18
+ private _readable;
19
+ private _verticesFloat32;
20
+ private _verticesUint8;
21
+ private _indices;
22
+ private _indicesFormat;
23
+ private _indicesChangeFlag;
20
24
  private _positions;
21
25
  private _normals;
22
26
  private _colors;
@@ -31,20 +35,18 @@ export declare class ModelMesh extends Mesh {
31
35
  private _uv7;
32
36
  private _boneWeights;
33
37
  private _boneIndices;
34
- private _advancedElementUpdateFlag;
35
- private _advancedDataUpdateFlag;
36
- private _advancedVertexDataVersions;
37
- private _advancedDataSyncToBuffer;
38
- private _internalVertexBufferStride;
39
- private _internalVertexBufferCreatedInfo;
40
- private _internalVertexElementsOffset;
41
- private _internalVertexElementsFlags;
42
- private _vertexBufferInfos;
43
- private _indices;
44
- private _indicesFormat;
45
- private _indicesChangeFlag;
38
+ private _bufferStrides;
39
+ private _vertexBufferUpdateFlag;
40
+ private _vertexDataUpdateFlag;
41
+ private _vertexElementsUpdate;
42
+ private _customVertexElements;
43
+ private _vertexCountChanged;
46
44
  /**
47
- * Vertex count of mesh.
45
+ * Whether to read data of the mesh.
46
+ */
47
+ get readable(): boolean;
48
+ /**
49
+ * Vertex count of current mesh.
48
50
  */
49
51
  get vertexCount(): number;
50
52
  /**
@@ -71,7 +73,7 @@ export declare class ModelMesh extends Mesh {
71
73
  constructor(engine: Engine, name?: string);
72
74
  /**
73
75
  * Set positions for the mesh.
74
- * @param positions - The positions for the mesh
76
+ * @param positions - The positions for the mesh.
75
77
  */
76
78
  setPositions(positions: Vector3[] | null): void;
77
79
  /**
@@ -81,7 +83,7 @@ export declare class ModelMesh extends Mesh {
81
83
  getPositions(): Vector3[] | null;
82
84
  /**
83
85
  * Set per-vertex normals for the mesh.
84
- * @param normals - The normals for the mesh
86
+ * @param normals - The normals for the mesh.
85
87
  */
86
88
  setNormals(normals: Vector3[] | null): void;
87
89
  /**
@@ -91,7 +93,7 @@ export declare class ModelMesh extends Mesh {
91
93
  getNormals(): Vector3[] | null;
92
94
  /**
93
95
  * Set per-vertex colors for the mesh.
94
- * @param colors - The colors for the mesh
96
+ * @param colors - The colors for the mesh.
95
97
  */
96
98
  setColors(colors: Color[] | null): void;
97
99
  /**
@@ -101,27 +103,27 @@ export declare class ModelMesh extends Mesh {
101
103
  getColors(): Color[] | null;
102
104
  /**
103
105
  * Set per-vertex bone weights for the mesh.
104
- * @param boneWeights - The bone weights for the mesh
106
+ * @param boneWeights - The bone weights for the mesh.
105
107
  */
106
108
  setBoneWeights(boneWeights: Vector4[] | null): void;
107
109
  /**
108
- * Get bone weights for the mesh.
110
+ * Get weights for the mesh.
109
111
  * @remarks Please call the setWeights() method after modification to ensure that the modification takes effect.
110
112
  */
111
113
  getBoneWeights(): Vector4[] | null;
112
114
  /**
113
115
  * Set per-vertex bone indices for the mesh.
114
- * @param boneIndices - The bone indices for the mesh
116
+ * @param boneIndices - The bone indices for the mesh.
115
117
  */
116
118
  setBoneIndices(boneIndices: Vector4[] | null): void;
117
119
  /**
118
- * Get bone indices for the mesh.
120
+ * Get joints for the mesh.
119
121
  * @remarks Please call the setBoneIndices() method after modification to ensure that the modification takes effect.
120
122
  */
121
123
  getBoneIndices(): Vector4[] | null;
122
124
  /**
123
125
  * Set per-vertex tangents for the mesh.
124
- * @param tangents - The tangents for the mesh
126
+ * @param tangents - The tangents for the mesh.
125
127
  */
126
128
  setTangents(tangents: Vector4[] | null): void;
127
129
  /**
@@ -131,13 +133,13 @@ export declare class ModelMesh extends Mesh {
131
133
  getTangents(): Vector4[] | null;
132
134
  /**
133
135
  * Set per-vertex uv for the mesh.
134
- * @param uv - The uv for the mesh
136
+ * @param uv - The uv for the mesh.
135
137
  */
136
138
  setUVs(uv: Vector2[] | null): void;
137
139
  /**
138
140
  * Set per-vertex uv for the mesh by channelIndex.
139
- * @param uv - The uv for the mesh
140
- * @param channelIndex - The index of uv channels, in [0 ~ 7] range
141
+ * @param uv - The uv for the mesh.
142
+ * @param channelIndex - The index of uv channels, in [0 ~ 7] range.
141
143
  */
142
144
  setUVs(uv: Vector2[] | null, channelIndex: number): void;
143
145
  /**
@@ -153,7 +155,7 @@ export declare class ModelMesh extends Mesh {
153
155
  getUVs(channelIndex: number): Vector2[] | null;
154
156
  /**
155
157
  * Set indices for the mesh.
156
- * @param indices - The indices for the mesh
158
+ * @param indices - The indices for the mesh.
157
159
  */
158
160
  setIndices(indices: Uint8Array | Uint16Array | Uint32Array): void;
159
161
  /**
@@ -161,20 +163,21 @@ export declare class ModelMesh extends Mesh {
161
163
  */
162
164
  getIndices(): Uint8Array | Uint16Array | Uint32Array;
163
165
  /**
166
+ * @beta
167
+ * @todo Update buffer should support custom vertex elements.
164
168
  * Set vertex elements.
165
169
  * @param elements - Vertex element collection
166
- *
167
- * @remarks
168
- * Call this method will clear the vertex data set by the setPositions(), setNormals(), setColors(), setBoneWeights(), setBoneIndices(), setTangents(), setUVs() methods.
169
170
  */
170
171
  setVertexElements(elements: VertexElement[]): void;
171
172
  /**
173
+ * @beta
172
174
  * Set vertex buffer binding.
173
- * @param vertexBufferBinding - Vertex buffer binding
175
+ * @param vertexBufferBindings - Vertex buffer binding
174
176
  * @param index - Vertex buffer index, the default value is 0
175
177
  */
176
- setVertexBufferBinding(vertexBufferBinding: VertexBufferBinding, index?: number): void;
178
+ setVertexBufferBinding(vertexBufferBindings: VertexBufferBinding, index?: number): void;
177
179
  /**
180
+ * @beta
178
181
  * Set vertex buffer binding.
179
182
  * @param vertexBuffer - Vertex buffer
180
183
  * @param stride - Vertex buffer data stride
@@ -203,45 +206,21 @@ export declare class ModelMesh extends Mesh {
203
206
  */
204
207
  getBlendShapeName(index: number): string;
205
208
  /**
206
- * Upload data to GPU set by `setPositions()`, `setNormals()`, `setColors()`, `setBoneWeights()`, `setBoneIndices()`, `setTangents()`, `setUVs()`, `setIndices()` methods.
207
- * This method will be auto generate vertex element and vertex buffer binding if needed.
208
- *
209
- * @param releaseData - Whether to release the data cache, release data can reduce memory usage.
209
+ * Upload Mesh Data to GPU.
210
+ * @param noLongerReadable - Whether to read data later. If true, you'll never read data anymore (free memory cache)
210
211
  */
211
- uploadData(releaseData: boolean): void;
212
+ uploadData(noLongerReadable: boolean): void;
212
213
  /**
213
214
  * Calculate mesh tangent.
214
215
  * @remark need to set positions(with or not with indices), normals, uv before calculation.
215
216
  * @remark based on http://foundationsofgameenginedev.com/FGED2-sample.pdf
216
217
  */
217
218
  calculateTangents(): void;
218
- private _getVertexElementData;
219
- private _beforeSetAdvancedVertexData;
220
- private _updateAdvancedVertexDataMarks;
221
- private _updateInternalVertexBuffer;
222
- private _readVector2VertexData;
223
- private _readVector3VertexData;
224
- private _readVector4VertexData;
225
- private _readColorVertexData;
226
- private _readVertexData;
227
- private _updateAdvancedVertexElement;
228
- private _updateAdvancedVertexElements;
219
+ private _supplementaryVertexElements;
229
220
  private _updateVertexElements;
230
- private _writeVector2AdvancedVertexData;
231
- private _writeVector3AdvancedVertexData;
232
- private _writeVector4AdvancedVertexData;
233
- private _writeColorAdvancedVertexData;
234
- private _writeAdvancedVertexData;
235
- private _updateAdvancedVertices;
236
- private _getInternalVertexBufferIndex;
221
+ private _updateVertices;
222
+ private _insertVertexAttribute;
237
223
  private _getAttributeFormat;
238
224
  private _getAttributeByteLength;
239
225
  private _releaseCache;
240
- /** @deprecated */
241
- private _accessible;
242
- /**
243
- * @deprecated
244
- * Whether to access data of the mesh.
245
- */
246
- get accessible(): boolean;
247
226
  }
@@ -1,11 +1,9 @@
1
1
  import { Engine } from "../Engine";
2
- import { Buffer } from "../graphic/Buffer";
3
2
  import { ModelMesh } from "./ModelMesh";
4
3
  /**
5
4
  * Used to generate common primitive meshes.
6
5
  */
7
6
  export declare class PrimitiveMesh {
8
- private static _tempVec30;
9
7
  /**
10
8
  * Create a sphere mesh.
11
9
  * @param engine - Engine
@@ -82,8 +80,8 @@ export declare class PrimitiveMesh {
82
80
  * @returns Capsule model mesh
83
81
  */
84
82
  static createCapsule(engine: Engine, radius?: number, height?: number, radialSegments?: number, heightSegments?: number, noLongerAccessible?: boolean): ModelMesh;
85
- static _setCylinderData(cylinderMesh: ModelMesh, radiusTop: number, radiusBottom: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
86
- static _setCapsuleData(capsuleMesh: ModelMesh, radius: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
83
+ static _setCylinderData(cylinderMesh: ModelMesh, radiusTop: number, radiusBottom: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean): void;
84
+ static _setCapsuleData(capsuleMesh: ModelMesh, radius: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean): void;
87
85
  private static _initialize;
88
86
  private static _generateIndices;
89
87
  private static _createCapsuleCap;
@@ -1,6 +1,5 @@
1
1
  import { Matrix } from "@galacean/engine-math";
2
2
  import { EngineObject } from "../base/EngineObject";
3
- import { Entity } from "../Entity";
4
3
  /**
5
4
  * Mesh skin data, equal glTF skins define
6
5
  */
@@ -9,8 +8,6 @@ export declare class Skin extends EngineObject {
9
8
  inverseBindMatrices: Matrix[];
10
9
  joints: string[];
11
10
  skeleton: string;
12
- _rootBone: Entity;
13
- _bones: Entity[];
14
11
  /**
15
12
  * Constructor of skin
16
13
  * @param name - name
@@ -9,20 +9,27 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
9
9
  private static _jointCountProperty;
10
10
  private static _jointSamplerProperty;
11
11
  private static _jointMatrixProperty;
12
+ private _hasInitSkin;
12
13
  private _jointDataCreateCache;
14
+ private _skin;
13
15
  private _blendShapeWeights;
14
16
  private _maxVertexUniformVectors;
15
17
  private _rootBone;
16
18
  private _localBounds;
17
19
  private _jointMatrices;
18
20
  private _jointTexture;
19
- private _bones;
21
+ private _jointEntities;
20
22
  /**
21
23
  * The weights of the BlendShapes.
22
24
  * @remarks Array index is BlendShape index.
23
25
  */
24
26
  get blendShapeWeights(): Float32Array;
25
27
  set blendShapeWeights(value: Float32Array);
28
+ /**
29
+ * Skin Object.
30
+ */
31
+ get skin(): Skin;
32
+ set skin(value: Skin);
26
33
  /**
27
34
  * Local bounds.
28
35
  */
@@ -33,25 +40,9 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
33
40
  */
34
41
  get rootBone(): Entity;
35
42
  set rootBone(value: Entity);
36
- /**
37
- * Bones of the SkinnedMeshRenderer.
38
- */
39
- get bones(): ReadonlyArray<Entity>;
40
- set bones(value: ReadonlyArray<Entity>);
43
+ private _initSkin;
44
+ private _computeApproximateBindMatrix;
45
+ private _findByEntityName;
41
46
  private _checkBlendShapeWeightLength;
42
47
  private _onLocalBoundsChanged;
43
- private _getEntityHierarchyPath;
44
- private _skin;
45
- /**
46
- * @deprecated
47
- * Skin Object.
48
- *
49
- * If you want get `skeleton`, use {@link SkinnedMeshRenderer.rootBone} instead.
50
- * If you want get `bones`, use {@link SkinnedMeshRenderer.bones} instead.
51
- * `inverseBindMatrices` will migrate to mesh in the future.
52
- *
53
- * @remarks `rootBone` and `bones` will not update when `skin` changed.
54
- */
55
- get skin(): Skin;
56
- set skin(value: Skin);
57
48
  }
@@ -1,9 +1,8 @@
1
- export { BlendShape } from "./BlendShape";
2
- export { BlendShapeFrame } from "./BlendShapeFrame";
3
- export { BufferMesh } from "./BufferMesh";
4
- export { MeshRenderer } from "./MeshRenderer";
5
1
  export { ModelMesh } from "./ModelMesh";
6
- export { PrimitiveMesh } from "./PrimitiveMesh";
7
2
  export { Skin } from "./Skin";
3
+ export { MeshRenderer } from "./MeshRenderer";
8
4
  export { SkinnedMeshRenderer } from "./SkinnedMeshRenderer";
9
- export { VertexAttribute } from "./enums/VertexAttribute";
5
+ export { PrimitiveMesh } from "./PrimitiveMesh";
6
+ export { BufferMesh } from "./BufferMesh";
7
+ export { BlendShape } from "./BlendShape";
8
+ export { BlendShapeFrame } from "./BlendShapeFrame";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,72 @@
1
+ import { ParticleRenderer } from "./ParticleRenderer";
2
+ import { ParticleStopMode } from "./enums/ParticleStopMode";
3
+ import { ColorOverLifetimeModule } from "./modules/ColorOverLifetimeModule";
4
+ import { EmissionModule } from "./modules/EmissionModule";
5
+ import { MainModule } from "./modules/MainModule";
6
+ import { RotationOverLifetimeModule } from "./modules/RotationOverLifetimeModule";
7
+ import { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
8
+ import { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
9
+ import { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
10
+ /**
11
+ * Particle Generator.
12
+ */
13
+ export declare class ParticleGenerator {
14
+ private static readonly _particleIncreaseCount;
15
+ /** Use auto random seed. */
16
+ useAutoRandomSeed: boolean;
17
+ /** Main module. */
18
+ readonly main: MainModule;
19
+ /** Emission module. */
20
+ readonly emission: EmissionModule;
21
+ /** Velocity over lifetime module. */
22
+ readonly velocityOverLifetime: VelocityOverLifetimeModule;
23
+ /** Size over lifetime module. */
24
+ readonly sizeOverLifetime: SizeOverLifetimeModule;
25
+ /** Rotation over lifetime module. */
26
+ readonly rotationOverLifetime: RotationOverLifetimeModule;
27
+ /** Color over lifetime module. */
28
+ readonly colorOverLifetime: ColorOverLifetimeModule;
29
+ /** Texture sheet animation module. */
30
+ readonly textureSheetAnimation: TextureSheetAnimationModule;
31
+ private _isPlaying;
32
+ private _instanceBufferResized;
33
+ private _waitProcessRetiredElementCount;
34
+ private _instanceVertexBufferBinding;
35
+ private _instanceVertices;
36
+ private _randomSeed;
37
+ /**
38
+ * Whether the particle generator is contain alive or is still creating particles.
39
+ */
40
+ get isAlive(): boolean;
41
+ /**
42
+ * Random seed.
43
+ *
44
+ * @remarks
45
+ * If `useAutoRandomSeed` is true, this value will be random changed when play.
46
+ * If you set this value custom, `useAutoRandomSeed` will be false.
47
+ */
48
+ get randomSeed(): number;
49
+ set randomSeed(value: number);
50
+ constructor(renderer: ParticleRenderer);
51
+ /**
52
+ * Start emitting particles.
53
+ * @param withChildren - Whether to start the particle generator of the child entity
54
+ */
55
+ play(withChildren?: boolean): void;
56
+ /**
57
+ * Stop emitting particles.
58
+ * @param withChildren - Whether to stop the particle generator of the child entity
59
+ * @param stopMode - Stop mode
60
+ */
61
+ stop(withChildren?: boolean, stopMode?: ParticleStopMode): void;
62
+ /**
63
+ * Manually emit certain number of particles immediately.
64
+ * @param count - Number of particles to emit
65
+ */
66
+ emit(count: number): void;
67
+ private _addNewParticle;
68
+ private _retireActiveParticles;
69
+ private _freeRetiredParticles;
70
+ private _addActiveParticlesToVertexBuffer;
71
+ private _addVertexBufferBindingsFilterDuplicate;
72
+ }
@@ -0,0 +1,28 @@
1
+ import { Color } from "@galacean/engine-math";
2
+ import { Engine } from "../Engine";
3
+ import { BaseMaterial } from "../material/BaseMaterial";
4
+ import { Texture2D } from "../texture/Texture2D";
5
+ /**
6
+ * Particle Material.
7
+ */
8
+ export declare class ParticleMaterial extends BaseMaterial {
9
+ /**
10
+ * Base color.
11
+ */
12
+ get baseColor(): Color;
13
+ set baseColor(value: Color);
14
+ /**
15
+ * Base texture.
16
+ */
17
+ get baseTexture(): Texture2D;
18
+ set baseTexture(value: Texture2D);
19
+ /**
20
+ * Create a unlit material instance.
21
+ * @param engine - Engine to which the material belongs
22
+ */
23
+ constructor(engine: Engine);
24
+ /**
25
+ * @inheritdoc
26
+ */
27
+ clone(): ParticleMaterial;
28
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Particle curve mode.
3
+ */
4
+ export declare enum ParticleCurveMode {
5
+ Constant = 0,
6
+ TwoConstants = 1,
7
+ Curve = 2,
8
+ TwoCurves = 3
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Particle gradient mode.
3
+ */
4
+ export declare enum ParticleGradientMode {
5
+ Constant = 0,
6
+ TwoConstants = 1,
7
+ Gradient = 2,
8
+ TwoGradients = 3
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The rendering mode for particle renderer.
3
+ */
4
+ export declare enum ParticleRenderMode {
5
+ /** Render particles as billboards facing the active camera. */
6
+ Billboard = 0,
7
+ /** Stretch particles in the direction of motion. */
8
+ StretchBillboard = 1,
9
+ /** Render particles as billboards always facing up along the y-Axis. */
10
+ HorizontalBillboard = 2,
11
+ /** Render particles as billboards always facing the player, but not pitching along the x-Axis. */
12
+ VerticalBillboard = 3,
13
+ /** Render particles as meshes. */
14
+ Mesh = 4,
15
+ /** Do not render particles. */
16
+ None = 5
17
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Control how Particle Generator apply transform scale.
3
+ */
4
+ export declare enum ParticleScaleMode {
5
+ /** Scale the Particle Generator using the entire transform hierarchy. */
6
+ Hierarchy = 0,
7
+ /** Scale the Particle Generator using only its own transform scale. (Ignores parent scale). */
8
+ Local = 1,
9
+ /** Only apply transform scale to the shape component, which controls where particles are spawned, but does not affect their size or movement. */
10
+ World = 2
11
+ }