@galacean/engine-core 1.0.0 → 1.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/main.js +16279 -13113
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +16279 -13113
  4. package/dist/module.js +16217 -13061
  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 +60 -16
  20. package/types/Component.d.ts +1 -8
  21. package/types/ComponentsDependencies.d.ts +17 -9
  22. package/types/DisorderedArray.d.ts +4 -3
  23. package/types/Engine.d.ts +43 -46
  24. package/types/Entity.d.ts +4 -2
  25. package/types/RenderPipeline/Basic2DBatcher.d.ts +6 -7
  26. package/types/RenderPipeline/BasicRenderPipeline.d.ts +7 -6
  27. package/types/RenderPipeline/ClassPool.d.ts +3 -1
  28. package/types/RenderPipeline/CullingResults.d.ts +1 -0
  29. package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
  30. package/types/RenderPipeline/IPoolElement.d.ts +3 -0
  31. package/types/RenderPipeline/MeshRenderData.d.ts +17 -0
  32. package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
  33. package/types/RenderPipeline/PipelinePass.d.ts +16 -0
  34. package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
  35. package/types/RenderPipeline/RenderData.d.ts +7 -0
  36. package/types/RenderPipeline/RenderElement.d.ts +8 -10
  37. package/types/RenderPipeline/RenderPass.d.ts +1 -1
  38. package/types/RenderPipeline/RenderQueue.d.ts +3 -5
  39. package/types/RenderPipeline/SpriteElement.d.ts +3 -1
  40. package/types/RenderPipeline/SpriteMaskBatcher.d.ts +4 -3
  41. package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
  42. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +12 -0
  43. package/types/RenderPipeline/SpriteRenderData.d.ts +14 -0
  44. package/types/RenderPipeline/TextRenderData.d.ts +8 -0
  45. package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
  46. package/types/RenderPipeline/enums/PipelineStage.d.ts +11 -0
  47. package/types/RenderPipeline/index.d.ts +4 -0
  48. package/types/Renderer.d.ts +10 -15
  49. package/types/Scene.d.ts +16 -9
  50. package/types/SceneManager.d.ts +28 -5
  51. package/types/Script.d.ts +18 -15
  52. package/types/Transform.d.ts +9 -12
  53. package/types/Utils.d.ts +28 -0
  54. package/types/animation/AnimationClip.d.ts +2 -1
  55. package/types/animation/Animator.d.ts +5 -4
  56. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +0 -1
  57. package/types/animation/enums/LayerState.d.ts +3 -1
  58. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
  59. package/types/asset/AssetType.d.ts +18 -16
  60. package/types/asset/ContentRestorer.d.ts +17 -0
  61. package/types/asset/GraphicsResource.d.ts +5 -0
  62. package/types/asset/IReferable.d.ts +2 -0
  63. package/types/asset/LoadItem.d.ts +16 -9
  64. package/types/asset/Loader.d.ts +3 -1
  65. package/types/asset/ReferResource.d.ts +22 -0
  66. package/types/asset/ResourceManager.d.ts +17 -11
  67. package/types/asset/request.d.ts +7 -3
  68. package/types/base/Constant.d.ts +3 -1
  69. package/types/base/EngineObject.d.ts +1 -0
  70. package/types/base/EventDispatcher.d.ts +2 -15
  71. package/types/base/Time.d.ts +27 -24
  72. package/types/base/index.d.ts +0 -2
  73. package/types/clone/ComponentCloner.d.ts +2 -1
  74. package/types/enums/ActiveChangeFlag.d.ts +6 -0
  75. package/types/enums/DepthTextureMode.d.ts +7 -0
  76. package/types/env-probe/CubeProbe.d.ts +0 -7
  77. package/types/env-probe/Probe.d.ts +0 -6
  78. package/types/graphic/Buffer.d.ts +25 -16
  79. package/types/graphic/BufferUtil.d.ts +1 -0
  80. package/types/graphic/Mesh.d.ts +5 -16
  81. package/types/graphic/SubMesh.d.ts +3 -1
  82. package/types/graphic/VertexElement.d.ts +10 -6
  83. package/types/index.d.ts +9 -7
  84. package/types/input/InputManager.d.ts +3 -3
  85. package/types/input/interface/IInput.d.ts +1 -1
  86. package/types/lighting/AmbientLight.d.ts +4 -1
  87. package/types/lighting/DirectLight.d.ts +0 -1
  88. package/types/lighting/Light.d.ts +0 -1
  89. package/types/lighting/LightManager.d.ts +1 -0
  90. package/types/lighting/SpotLight.d.ts +0 -1
  91. package/types/material/BaseMaterial.d.ts +8 -10
  92. package/types/material/BlinnPhongMaterial.d.ts +0 -3
  93. package/types/material/Material.d.ts +8 -8
  94. package/types/material/PBRMaterial.d.ts +12 -3
  95. package/types/material/PBRSpecularMaterial.d.ts +1 -1
  96. package/types/material/UnlitMaterial.d.ts +1 -1
  97. package/types/mesh/BlendShape.d.ts +1 -1
  98. package/types/mesh/BlendShapeFrame.d.ts +28 -6
  99. package/types/mesh/BufferMesh.d.ts +2 -2
  100. package/types/mesh/MeshRenderer.d.ts +7 -12
  101. package/types/mesh/ModelMesh.d.ts +62 -41
  102. package/types/mesh/PrimitiveMesh.d.ts +6 -2
  103. package/types/mesh/PrimitiveMeshRestorer.d.ts +1 -0
  104. package/types/mesh/Skin.d.ts +3 -0
  105. package/types/mesh/SkinnedMeshRenderer.d.ts +18 -23
  106. package/types/mesh/index.d.ts +6 -5
  107. package/types/particle/ParticleRenderer.d.ts +2 -2
  108. package/types/physics/CharacterController.d.ts +0 -2
  109. package/types/physics/Collider.d.ts +1 -1
  110. package/types/physics/Collision.d.ts +4 -0
  111. package/types/physics/PhysicsManager.d.ts +1 -20
  112. package/types/physics/PhysicsScene.d.ts +75 -0
  113. package/types/physics/index.d.ts +7 -7
  114. package/types/physics/joint/HingeJoint.d.ts +2 -2
  115. package/types/physics/joint/Joint.d.ts +2 -2
  116. package/types/physics/joint/SpringJoint.d.ts +1 -1
  117. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +7 -0
  118. package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +1 -1
  119. package/types/renderingHardwareInterface/IPlatformTexture2DArray.d.ts +1 -1
  120. package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +1 -1
  121. package/types/renderingHardwareInterface/index.d.ts +1 -0
  122. package/types/shader/Shader.d.ts +54 -23
  123. package/types/shader/ShaderData.d.ts +24 -24
  124. package/types/shader/ShaderMacro.d.ts +16 -0
  125. package/types/shader/ShaderPart.d.ts +41 -0
  126. package/types/shader/ShaderPass.d.ts +9 -2
  127. package/types/shader/ShaderProperty.d.ts +7 -0
  128. package/types/shader/ShaderTagKey.d.ts +16 -0
  129. package/types/shader/SubShader.d.ts +19 -0
  130. package/types/shader/enums/RenderStateElementKey.d.ts +58 -0
  131. package/types/shader/index.d.ts +6 -1
  132. package/types/shader/state/index.d.ts +6 -0
  133. package/types/shadow/CascadedShadowCasterPass.d.ts +6 -7
  134. package/types/sky/Sky.d.ts +12 -4
  135. package/types/sky/SkyBoxMaterial.d.ts +27 -9
  136. package/types/sky/SkyProceduralMaterial.d.ts +72 -0
  137. package/types/sky/index.d.ts +1 -0
  138. package/types/texture/RenderTarget.d.ts +3 -8
  139. package/types/texture/Texture.d.ts +8 -6
  140. package/types/texture/Texture2D.d.ts +4 -2
  141. package/types/texture/Texture2DArray.d.ts +1 -1
  142. package/types/texture/TextureCube.d.ts +1 -1
  143. package/types/texture/enums/TextureFormat.d.ts +55 -49
  144. package/types/texture/enums/TextureUsage.d.ts +9 -0
  145. package/types/texture/index.d.ts +1 -0
  146. package/types/trail/TrailRenderer.d.ts +0 -5
  147. package/types/utils/SafeLoopArray.d.ts +41 -0
@@ -15,12 +15,8 @@ export declare class ModelMesh extends Mesh {
15
15
  private static _tempVec3;
16
16
  private static _tempVec4;
17
17
  private _vertexCount;
18
- private _accessible;
19
- private _verticesFloat32;
20
- private _verticesUint8;
21
- private _indices;
22
- private _indicesFormat;
23
- private _indicesChangeFlag;
18
+ private _vertexCountDirty;
19
+ private _dataVersionCounter;
24
20
  private _positions;
25
21
  private _normals;
26
22
  private _colors;
@@ -35,18 +31,20 @@ export declare class ModelMesh extends Mesh {
35
31
  private _uv7;
36
32
  private _boneWeights;
37
33
  private _boneIndices;
38
- private _bufferStrides;
39
- private _vertexBufferUpdateFlag;
40
- private _vertexDataUpdateFlag;
41
- private _vertexElementsUpdate;
42
- private _customVertexElements;
43
- private _vertexCountChanged;
44
- /**
45
- * Whether to access data of the mesh.
46
- */
47
- get accessible(): boolean;
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;
48
46
  /**
49
- * Vertex count of current mesh.
47
+ * Vertex count of mesh.
50
48
  */
51
49
  get vertexCount(): number;
52
50
  /**
@@ -73,7 +71,7 @@ export declare class ModelMesh extends Mesh {
73
71
  constructor(engine: Engine, name?: string);
74
72
  /**
75
73
  * Set positions for the mesh.
76
- * @param positions - The positions for the mesh.
74
+ * @param positions - The positions for the mesh
77
75
  */
78
76
  setPositions(positions: Vector3[] | null): void;
79
77
  /**
@@ -83,7 +81,7 @@ export declare class ModelMesh extends Mesh {
83
81
  getPositions(): Vector3[] | null;
84
82
  /**
85
83
  * Set per-vertex normals for the mesh.
86
- * @param normals - The normals for the mesh.
84
+ * @param normals - The normals for the mesh
87
85
  */
88
86
  setNormals(normals: Vector3[] | null): void;
89
87
  /**
@@ -93,7 +91,7 @@ export declare class ModelMesh extends Mesh {
93
91
  getNormals(): Vector3[] | null;
94
92
  /**
95
93
  * Set per-vertex colors for the mesh.
96
- * @param colors - The colors for the mesh.
94
+ * @param colors - The colors for the mesh
97
95
  */
98
96
  setColors(colors: Color[] | null): void;
99
97
  /**
@@ -103,27 +101,27 @@ export declare class ModelMesh extends Mesh {
103
101
  getColors(): Color[] | null;
104
102
  /**
105
103
  * Set per-vertex bone weights for the mesh.
106
- * @param boneWeights - The bone weights for the mesh.
104
+ * @param boneWeights - The bone weights for the mesh
107
105
  */
108
106
  setBoneWeights(boneWeights: Vector4[] | null): void;
109
107
  /**
110
- * Get weights for the mesh.
108
+ * Get bone weights for the mesh.
111
109
  * @remarks Please call the setWeights() method after modification to ensure that the modification takes effect.
112
110
  */
113
111
  getBoneWeights(): Vector4[] | null;
114
112
  /**
115
113
  * Set per-vertex bone indices for the mesh.
116
- * @param boneIndices - The bone indices for the mesh.
114
+ * @param boneIndices - The bone indices for the mesh
117
115
  */
118
116
  setBoneIndices(boneIndices: Vector4[] | null): void;
119
117
  /**
120
- * Get joints for the mesh.
118
+ * Get bone indices for the mesh.
121
119
  * @remarks Please call the setBoneIndices() method after modification to ensure that the modification takes effect.
122
120
  */
123
121
  getBoneIndices(): Vector4[] | null;
124
122
  /**
125
123
  * Set per-vertex tangents for the mesh.
126
- * @param tangents - The tangents for the mesh.
124
+ * @param tangents - The tangents for the mesh
127
125
  */
128
126
  setTangents(tangents: Vector4[] | null): void;
129
127
  /**
@@ -133,13 +131,13 @@ export declare class ModelMesh extends Mesh {
133
131
  getTangents(): Vector4[] | null;
134
132
  /**
135
133
  * Set per-vertex uv for the mesh.
136
- * @param uv - The uv for the mesh.
134
+ * @param uv - The uv for the mesh
137
135
  */
138
136
  setUVs(uv: Vector2[] | null): void;
139
137
  /**
140
138
  * Set per-vertex uv for the mesh by channelIndex.
141
- * @param uv - The uv for the mesh.
142
- * @param channelIndex - The index of uv channels, in [0 ~ 7] range.
139
+ * @param uv - The uv for the mesh
140
+ * @param channelIndex - The index of uv channels, in [0 ~ 7] range
143
141
  */
144
142
  setUVs(uv: Vector2[] | null, channelIndex: number): void;
145
143
  /**
@@ -155,7 +153,7 @@ export declare class ModelMesh extends Mesh {
155
153
  getUVs(channelIndex: number): Vector2[] | null;
156
154
  /**
157
155
  * Set indices for the mesh.
158
- * @param indices - The indices for the mesh.
156
+ * @param indices - The indices for the mesh
159
157
  */
160
158
  setIndices(indices: Uint8Array | Uint16Array | Uint32Array): void;
161
159
  /**
@@ -163,21 +161,20 @@ export declare class ModelMesh extends Mesh {
163
161
  */
164
162
  getIndices(): Uint8Array | Uint16Array | Uint32Array;
165
163
  /**
166
- * @beta
167
- * @todo Update buffer should support custom vertex elements.
168
164
  * Set vertex elements.
169
165
  * @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.
170
169
  */
171
170
  setVertexElements(elements: VertexElement[]): void;
172
171
  /**
173
- * @beta
174
172
  * Set vertex buffer binding.
175
- * @param vertexBufferBindings - Vertex buffer binding
173
+ * @param vertexBufferBinding - Vertex buffer binding
176
174
  * @param index - Vertex buffer index, the default value is 0
177
175
  */
178
- setVertexBufferBinding(vertexBufferBindings: VertexBufferBinding, index?: number): void;
176
+ setVertexBufferBinding(vertexBufferBinding: VertexBufferBinding, index?: number): void;
179
177
  /**
180
- * @beta
181
178
  * Set vertex buffer binding.
182
179
  * @param vertexBuffer - Vertex buffer
183
180
  * @param stride - Vertex buffer data stride
@@ -206,21 +203,45 @@ export declare class ModelMesh extends Mesh {
206
203
  */
207
204
  getBlendShapeName(index: number): string;
208
205
  /**
209
- * Upload Mesh Data to GPU.
210
- * @param noLongerAccessible - Whether to access data later. If true, you'll never access data anymore (free memory cache)
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.
211
210
  */
212
- uploadData(noLongerAccessible: boolean): void;
211
+ uploadData(releaseData: boolean): void;
213
212
  /**
214
213
  * Calculate mesh tangent.
215
214
  * @remark need to set positions(with or not with indices), normals, uv before calculation.
216
215
  * @remark based on http://foundationsofgameenginedev.com/FGED2-sample.pdf
217
216
  */
218
217
  calculateTangents(): void;
219
- private _supplementaryVertexElements;
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;
220
229
  private _updateVertexElements;
221
- private _updateVertices;
222
- private _insertVertexAttribute;
230
+ private _writeVector2AdvancedVertexData;
231
+ private _writeVector3AdvancedVertexData;
232
+ private _writeVector4AdvancedVertexData;
233
+ private _writeColorAdvancedVertexData;
234
+ private _writeAdvancedVertexData;
235
+ private _updateAdvancedVertices;
236
+ private _getInternalVertexBufferIndex;
223
237
  private _getAttributeFormat;
224
238
  private _getAttributeByteLength;
225
239
  private _releaseCache;
240
+ /** @deprecated */
241
+ private _accessible;
242
+ /**
243
+ * @deprecated
244
+ * Whether to access data of the mesh.
245
+ */
246
+ get accessible(): boolean;
226
247
  }
@@ -1,9 +1,11 @@
1
1
  import { Engine } from "../Engine";
2
+ import { Buffer } from "../graphic/Buffer";
2
3
  import { ModelMesh } from "./ModelMesh";
3
4
  /**
4
5
  * Used to generate common primitive meshes.
5
6
  */
6
7
  export declare class PrimitiveMesh {
8
+ private static _tempVec30;
7
9
  /**
8
10
  * Create a sphere mesh.
9
11
  * @param engine - Engine
@@ -63,8 +65,8 @@ export declare class PrimitiveMesh {
63
65
  * @param engine - Engine
64
66
  * @param radius - The radius of cap
65
67
  * @param height - The height of torso
66
- * @param radialSegments - Cylinder radial segments
67
- * @param heightSegments - Cylinder height segments
68
+ * @param radialSegments - Cone radial segments
69
+ * @param heightSegments - Cone height segments
68
70
  * @param noLongerAccessible - No longer access the vertices of the mesh after creation
69
71
  * @returns Cone model mesh
70
72
  */
@@ -80,6 +82,8 @@ export declare class PrimitiveMesh {
80
82
  * @returns Capsule model mesh
81
83
  */
82
84
  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
87
  private static _initialize;
84
88
  private static _generateIndices;
85
89
  private static _createCapsuleCap;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { Matrix } from "@galacean/engine-math";
2
2
  import { EngineObject } from "../base/EngineObject";
3
+ import { Entity } from "../Entity";
3
4
  /**
4
5
  * Mesh skin data, equal glTF skins define
5
6
  */
@@ -8,6 +9,8 @@ export declare class Skin extends EngineObject {
8
9
  inverseBindMatrices: Matrix[];
9
10
  joints: string[];
10
11
  skeleton: string;
12
+ _rootBone: Entity;
13
+ _bones: Entity[];
11
14
  /**
12
15
  * Constructor of skin
13
16
  * @param name - name
@@ -1,37 +1,28 @@
1
1
  import { BoundingBox } from "@galacean/engine-math";
2
2
  import { Entity } from "../Entity";
3
- import { RenderContext } from "../RenderPipeline/RenderContext";
4
3
  import { MeshRenderer } from "./MeshRenderer";
5
4
  import { Skin } from "./Skin";
6
5
  /**
7
6
  * SkinnedMeshRenderer.
8
7
  */
9
8
  export declare class SkinnedMeshRenderer extends MeshRenderer {
10
- private static _tempMatrix;
11
9
  private static _jointCountProperty;
12
10
  private static _jointSamplerProperty;
13
11
  private static _jointMatrixProperty;
14
- private _hasInitSkin;
15
12
  private _jointDataCreateCache;
16
- private _skin;
17
13
  private _blendShapeWeights;
18
14
  private _maxVertexUniformVectors;
19
15
  private _rootBone;
20
16
  private _localBounds;
21
17
  private _jointMatrices;
22
18
  private _jointTexture;
23
- private _jointEntities;
19
+ private _bones;
24
20
  /**
25
21
  * The weights of the BlendShapes.
26
22
  * @remarks Array index is BlendShape index.
27
23
  */
28
24
  get blendShapeWeights(): Float32Array;
29
25
  set blendShapeWeights(value: Float32Array);
30
- /**
31
- * Skin Object.
32
- */
33
- get skin(): Skin;
34
- set skin(value: Skin);
35
26
  /**
36
27
  * Local bounds.
37
28
  */
@@ -43,20 +34,24 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
43
34
  get rootBone(): Entity;
44
35
  set rootBone(value: Entity);
45
36
  /**
46
- * @override
47
- */
48
- protected _updateShaderData(context: RenderContext): void;
49
- /**
50
- * @override
37
+ * Bones of the SkinnedMeshRenderer.
51
38
  */
52
- protected _registerEntityTransformListener(): void;
53
- /**
54
- * @override
55
- */
56
- protected _updateBounds(worldBounds: BoundingBox): void;
57
- private _initSkin;
58
- private _computeApproximateBindMatrix;
59
- private _findByEntityName;
39
+ get bones(): ReadonlyArray<Entity>;
40
+ set bones(value: ReadonlyArray<Entity>);
60
41
  private _checkBlendShapeWeightLength;
61
42
  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);
62
57
  }
@@ -1,8 +1,9 @@
1
+ export { BlendShape } from "./BlendShape";
2
+ export { BlendShapeFrame } from "./BlendShapeFrame";
3
+ export { BufferMesh } from "./BufferMesh";
4
+ export { MeshRenderer } from "./MeshRenderer";
1
5
  export { ModelMesh } from "./ModelMesh";
6
+ export { PrimitiveMesh } from "./PrimitiveMesh";
2
7
  export { Skin } from "./Skin";
3
- export { MeshRenderer } from "./MeshRenderer";
4
8
  export { SkinnedMeshRenderer } from "./SkinnedMeshRenderer";
5
- export { PrimitiveMesh } from "./PrimitiveMesh";
6
- export { BufferMesh } from "./BufferMesh";
7
- export { BlendShape } from "./BlendShape";
8
- export { BlendShapeFrame } from "./BlendShapeFrame";
9
+ export { VertexAttribute } from "./enums/VertexAttribute";
@@ -1,6 +1,6 @@
1
- import { Vector3, Color } from "@galacean/engine-math";
2
- import { Texture } from "../texture";
1
+ import { Color, Vector3 } from "@galacean/engine-math";
3
2
  import { MeshRenderer } from "../mesh/MeshRenderer";
3
+ import { Texture } from "../texture";
4
4
  /**
5
5
  * Blend mode enums of the particle renderer's material.
6
6
  */
@@ -41,12 +41,10 @@ export declare class CharacterController extends Collider {
41
41
  /**
42
42
  * Add collider shape on this controller.
43
43
  * @param shape - Collider shape
44
- * @override
45
44
  */
46
45
  addShape(shape: ColliderShape): void;
47
46
  /**
48
47
  * Remove all shape attached.
49
- * @override
50
48
  */
51
49
  clearShapes(): void;
52
50
  private _setUpDirection;
@@ -3,7 +3,7 @@ import { Component } from "../Component";
3
3
  import { ColliderShape } from "./shape/ColliderShape";
4
4
  /**
5
5
  * Base class for all colliders.
6
- * @decorator `@dependentComponents(Transform)`
6
+ * @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
7
7
  */
8
8
  export declare class Collider extends Component {
9
9
  protected _updateFlag: BoolUpdateFlag;
@@ -0,0 +1,4 @@
1
+ import { ColliderShape } from "./shape";
2
+ export declare class Collision {
3
+ shape: ColliderShape;
4
+ }
@@ -1,4 +1,3 @@
1
- import { IPhysics } from "@galacean/engine-design";
2
1
  import { Ray, Vector3 } from "@galacean/engine-math";
3
2
  import { Engine } from "../Engine";
4
3
  import { Layer } from "../Layer";
@@ -7,6 +6,7 @@ import { HitResult } from "./HitResult";
7
6
  * A physics manager is a collection of colliders and constraints which can interact.
8
7
  */
9
8
  export declare class PhysicsManager {
9
+ private static _collision;
10
10
  private _engine;
11
11
  private _restTime;
12
12
  private _colliders;
@@ -21,31 +21,12 @@ export declare class PhysicsManager {
21
21
  private _onTriggerStay;
22
22
  /** The fixed time step in seconds at which physics are performed. */
23
23
  fixedTimeStep: number;
24
- /**
25
- * The max allowed time step in seconds one frame.
26
- *
27
- * @remarks
28
- * When the frame rate is low or stutter occurs, the maximum execution time of physics will not exceed this value.
29
- * So physics will slow down a bit when performance hitch occurs.
30
- */
31
- maxAllowedTimeStep: number;
32
24
  /**
33
25
  * The gravity of physics scene.
34
26
  */
35
27
  get gravity(): Vector3;
36
28
  set gravity(value: Vector3);
37
- /**
38
- * @deprecated
39
- * Please use `maxAllowedTimeStep` instead.
40
- */
41
- get maxSumTimeStep(): number;
42
- set maxSumTimeStep(value: number);
43
29
  constructor(engine: Engine);
44
- /**
45
- * initialize PhysicsManager.
46
- * @param physics - Physics Engine
47
- */
48
- initialize(physics: IPhysics): void;
49
30
  /**
50
31
  * Casts a ray through the Scene and returns the first hit.
51
32
  * @param ray - The ray
@@ -0,0 +1,75 @@
1
+ import { Ray, Vector3 } from "@galacean/engine-math";
2
+ import { Layer } from "../Layer";
3
+ import { Scene } from "../Scene";
4
+ import { HitResult } from "./HitResult";
5
+ /**
6
+ * A physics scene is a collection of colliders and constraints which can interact.
7
+ */
8
+ export declare class PhysicsScene {
9
+ private static _collision;
10
+ private _scene;
11
+ private _restTime;
12
+ private _colliders;
13
+ private _gravity;
14
+ private _nativePhysicsScene;
15
+ private _onContactEnter;
16
+ private _onContactExit;
17
+ private _onContactStay;
18
+ private _onTriggerEnter;
19
+ private _onTriggerExit;
20
+ private _onTriggerStay;
21
+ /** The fixed time step in seconds at which physics are performed. */
22
+ fixedTimeStep: number;
23
+ /**
24
+ * The gravity of physics scene.
25
+ */
26
+ get gravity(): Vector3;
27
+ set gravity(value: Vector3);
28
+ constructor(scene: Scene);
29
+ /**
30
+ * Casts a ray through the Scene and returns the first hit.
31
+ * @param ray - The ray
32
+ * @returns Returns True if the ray intersects with a collider, otherwise false
33
+ */
34
+ raycast(ray: Ray): boolean;
35
+ /**
36
+ * Casts a ray through the Scene and returns the first hit.
37
+ * @param ray - The ray
38
+ * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
39
+ * @returns Returns True if the ray intersects with a collider, otherwise false
40
+ */
41
+ raycast(ray: Ray, outHitResult: HitResult): boolean;
42
+ /**
43
+ * Casts a ray through the Scene and returns the first hit.
44
+ * @param ray - The ray
45
+ * @param distance - The max distance the ray should check
46
+ * @returns Returns True if the ray intersects with a collider, otherwise false
47
+ */
48
+ raycast(ray: Ray, distance: number): boolean;
49
+ /**
50
+ * Casts a ray through the Scene and returns the first hit.
51
+ * @param ray - The ray
52
+ * @param distance - The max distance the ray should check
53
+ * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
54
+ * @returns Returns True if the ray intersects with a collider, otherwise false
55
+ */
56
+ raycast(ray: Ray, distance: number, outHitResult: HitResult): boolean;
57
+ /**
58
+ * Casts a ray through the Scene and returns the first hit.
59
+ * @param ray - The ray
60
+ * @param distance - The max distance the ray should check
61
+ * @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
62
+ * @returns Returns True if the ray intersects with a collider, otherwise false
63
+ */
64
+ raycast(ray: Ray, distance: number, layerMask: Layer): boolean;
65
+ /**
66
+ * Casts a ray through the Scene and returns the first hit.
67
+ * @param ray - The ray
68
+ * @param distance - The max distance the ray should check
69
+ * @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
70
+ * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
71
+ * @returns Returns True if the ray intersects with a collider, otherwise false.
72
+ */
73
+ raycast(ray: Ray, distance: number, layerMask: Layer, outHitResult: HitResult): boolean;
74
+ private _setGravity;
75
+ }
@@ -1,10 +1,10 @@
1
- export { HitResult } from "./HitResult";
2
- export { PhysicsManager } from "./PhysicsManager";
3
- export { PhysicsMaterial } from "./PhysicsMaterial";
4
1
  export { CharacterController } from "./CharacterController";
5
- export * from "./shape";
6
- export * from "./joint";
7
- export * from "./enums";
8
2
  export { Collider } from "./Collider";
3
+ export { CollisionDetectionMode, DynamicCollider, DynamicColliderConstraints } from "./DynamicCollider";
4
+ export { HitResult } from "./HitResult";
5
+ export { PhysicsMaterial } from "./PhysicsMaterial";
6
+ export { PhysicsScene } from "./PhysicsScene";
9
7
  export { StaticCollider } from "./StaticCollider";
10
- export { DynamicCollider, CollisionDetectionMode, DynamicColliderConstraints } from "./DynamicCollider";
8
+ export * from "./enums";
9
+ export * from "./joint";
10
+ export * from "./shape";
@@ -1,7 +1,7 @@
1
- import { Joint } from "./Joint";
2
1
  import { Vector3 } from "@galacean/engine-math";
3
- import { JointMotor } from "./JointMotor";
2
+ import { Joint } from "./Joint";
4
3
  import { JointLimits } from "./JointLimits";
4
+ import { JointMotor } from "./JointMotor";
5
5
  /**
6
6
  * A joint which behaves in a similar way to a hinge or axle.
7
7
  */
@@ -1,11 +1,11 @@
1
1
  import { IJoint } from "@galacean/engine-design";
2
2
  import { Vector3 } from "@galacean/engine-math";
3
3
  import { Component } from "../../Component";
4
- import { Collider } from "../Collider";
5
4
  import { Entity } from "../../Entity";
5
+ import { Collider } from "../Collider";
6
6
  /**
7
7
  * A base class providing common functionality for joints.
8
- * @decorator `@dependentComponents(Collider)`
8
+ * @decorator `@dependentComponents(Collider, DependentMode.CheckOnly)`
9
9
  */
10
10
  export declare class Joint extends Component {
11
11
  protected _connectedCollider: JointCollider;
@@ -1,5 +1,5 @@
1
- import { Joint } from "./Joint";
2
1
  import { Vector3 } from "@galacean/engine-math";
2
+ import { Joint } from "./Joint";
3
3
  /**
4
4
  * A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
5
5
  */
@@ -0,0 +1,7 @@
1
+ import { SetDataOptions } from "../graphic";
2
+ export interface IPlatformBuffer {
3
+ bind(): void;
4
+ setData(byteLength: number, data: ArrayBuffer | ArrayBufferView, bufferByteOffset?: number, dataOffset?: number, dataLength?: number, options?: SetDataOptions): void;
5
+ getData(data: ArrayBufferView, bufferByteOffset?: number, dataOffset?: number, dataLength?: number): void;
6
+ destroy(): void;
7
+ }
@@ -23,7 +23,7 @@ export interface IPlatformTexture2D extends IPlatformTexture {
23
23
  * @param x - X coordinate of area start
24
24
  * @param y - Y coordinate of area start
25
25
  */
26
- setImageSource(imageSource: TexImageSource | OffscreenCanvas, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
26
+ setImageSource(imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
27
27
  /**
28
28
  * Get the pixel color buffer according to the specified area.
29
29
  * @param x - X coordinate of area start
@@ -25,7 +25,7 @@ export interface IPlatformTexture2DArray extends IPlatformTexture {
25
25
  * @param x - X coordinate of area start
26
26
  * @param y - Y coordinate of area start
27
27
  */
28
- setImageSource(index: number, imageSource: TexImageSource | OffscreenCanvas, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
28
+ setImageSource(index: number, imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
29
29
  /**
30
30
  * Get the pixel color buffer according to the specified area.
31
31
  * @param elementIndex - The texture array element index
@@ -26,7 +26,7 @@ export interface IPlatformTextureCube extends IPlatformTexture {
26
26
  * @param x - X coordinate of area start
27
27
  * @param y - Y coordinate of area start
28
28
  */
29
- setImageSource(face: TextureCubeFace, imageSource: TexImageSource | OffscreenCanvas, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
29
+ setImageSource(face: TextureCubeFace, imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
30
30
  /**
31
31
  * Get the pixel color buffer according to the specified cube face and area.
32
32
  * @param face - You can choose which cube face to read
@@ -1,4 +1,5 @@
1
1
  export type { IHardwareRenderer } from "./IHardwareRenderer";
2
+ export type { IPlatformBuffer } from "./IPlatformBuffer";
2
3
  export type { IPlatformRenderTarget } from "./IPlatformRenderTarget";
3
4
  export type { IPlatformTexture } from "./IPlatformTexture";
4
5
  export type { IPlatformTexture2D } from "./IPlatformTexture2D";