@galacean/engine-core 2.0.0-alpha.56 → 2.0.0-alpha.57

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "2.0.0-alpha.56",
3
+ "version": "2.0.0-alpha.57",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -18,8 +18,8 @@
18
18
  "types/**/*"
19
19
  ],
20
20
  "dependencies": {
21
- "@galacean/engine-design": "2.0.0-alpha.56",
22
- "@galacean/engine-math": "2.0.0-alpha.56"
21
+ "@galacean/engine-design": "2.0.0-alpha.57",
22
+ "@galacean/engine-math": "2.0.0-alpha.57"
23
23
  },
24
24
  "scripts": {
25
25
  "b:types": "tsc"
@@ -3,6 +3,7 @@ import { Engine } from "./Engine";
3
3
  import { RenderQueueMaskType } from "./RenderPipeline/enums/RenderQueueMaskType";
4
4
  import { BlinnPhongMaterial, Material } from "./material";
5
5
  import { ModelMesh } from "./mesh";
6
+ import type { BuiltinShaders } from "./shader/BuiltinShaders";
6
7
  import { RenderStateElementKey } from "./shader/enums/RenderStateElementKey";
7
8
  import { Texture2D, TextureCube } from "./texture";
8
9
  import { Texture2DArray } from "./texture/Texture2DArray";
@@ -36,7 +37,7 @@ export declare class BasicResources {
36
37
  private _blinnPhongMaterial;
37
38
  private _prefilteredDFGTexture;
38
39
  get prefilteredDFGTexture(): Texture2D;
39
- constructor(engine: Engine);
40
+ constructor(engine: Engine, shaders: BuiltinShaders);
40
41
  /**
41
42
  * @internal
42
43
  */
@@ -49,6 +50,5 @@ export declare class BasicResources {
49
50
  private _create1x1Texture;
50
51
  private _create2DMaterial;
51
52
  private _createMagentaMaterial;
52
- private _createSpriteMaskMaterial;
53
53
  }
54
54
  export type RenderStateElementMap = Record<RenderStateElementKey, number | boolean>;
package/types/Engine.d.ts CHANGED
@@ -18,6 +18,7 @@ import { InputManager } from "./input";
18
18
  import { ParticleBufferUtils } from "./particle/ParticleBufferUtils";
19
19
  import { ColliderShape } from "./physics/shape/ColliderShape";
20
20
  import { PostProcessPass } from "./postProcess/PostProcessPass";
21
+ import type { BuiltinShaders } from "./shader/BuiltinShaders";
21
22
  import { ShaderMacro } from "./shader/ShaderMacro";
22
23
  import { ShaderMacroCollection } from "./shader/ShaderMacroCollection";
23
24
  import { ShaderProgramMap } from "./shader/ShaderProgramMap";
@@ -30,6 +31,8 @@ import { XRManager } from "./xr/XRManager";
30
31
  * Engine.
31
32
  */
32
33
  export declare class Engine extends EventDispatcher {
34
+ /** @internal */
35
+ static _builtinShaders: BuiltinShaders;
33
36
  /** @internal */
34
37
  static _noDepthTextureMacro: ShaderMacro;
35
38
  /** @internal */
@@ -2,13 +2,13 @@ import { Camera } from "../../Camera";
2
2
  import { Engine } from "../../Engine";
3
3
  import { PipelinePass } from "../../RenderPipeline/PipelinePass";
4
4
  import { RenderContext } from "../../RenderPipeline/RenderContext";
5
+ import { Shader } from "../../shader";
5
6
  import { RenderTarget } from "../../texture";
6
7
  /**
7
8
  * @internal
8
9
  * Scalable Ambient Obscurance render pass.
9
10
  */
10
11
  export declare class ScalableAmbientObscurancePass extends PipelinePass {
11
- static readonly SHADER_NAME = "Lighting/ScalableAmbientOcclusion";
12
12
  private static _invRadiusSquaredProp;
13
13
  private static _intensityProp;
14
14
  private static _projectionScaleRadiusProp;
@@ -30,7 +30,7 @@ export declare class ScalableAmbientObscurancePass extends PipelinePass {
30
30
  private _offsetX;
31
31
  private _offsetY;
32
32
  private _quality;
33
- constructor(engine: Engine);
33
+ constructor(engine: Engine, shader: Shader);
34
34
  onConfig(camera: Camera, depthRenderTarget: RenderTarget): void;
35
35
  onRender(context: RenderContext): void;
36
36
  release(): void;
@@ -25,6 +25,7 @@ export declare class Material extends ReferResource implements IClone {
25
25
  * Create a material instance.
26
26
  * @param engine - Engine to which the material belongs
27
27
  * @param shader - Shader used by the material
28
+ * @throws When the shader has been destroyed.
28
29
  */
29
30
  constructor(engine: Engine, shader: Shader);
30
31
  /**
@@ -0,0 +1,9 @@
1
+ import { Vector2, Vector3, Vector4 } from "@galacean/engine-math";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare class MeshTangentUtils {
6
+ static calculateTangents(positions: readonly Vector3[], normals: readonly Vector3[], uvs: readonly Vector2[], indices: ArrayLike<number> | null): Vector4[];
7
+ static calculateTangentsFromBuffer(vertices: Float32Array, indices: ArrayLike<number> | null): Float32Array;
8
+ private static _calculateTangents;
9
+ }
@@ -13,11 +13,6 @@ import { VertexAttribute } from "./enums/VertexAttribute";
13
13
  * Define draw ranges with `addSubMesh()` and assign a material to each corresponding MeshRenderer slot.
14
14
  */
15
15
  export declare class ModelMesh extends Mesh {
16
- private static _tempVec0;
17
- private static _tempVec1;
18
- private static _tempVec2;
19
- private static _tempVec3;
20
- private static _tempVec4;
21
16
  /** @internal */
22
17
  _blendShapeManager: BlendShapeManager;
23
18
  /** @internal */
@@ -224,9 +219,11 @@ export declare class ModelMesh extends Mesh {
224
219
  */
225
220
  uploadData(releaseData: boolean): void;
226
221
  /**
227
- * Calculate mesh tangent.
228
- * @remark need to set positions(with or not with indices), normals, uv before calculation.
229
- * @remark based on http://foundationsofgameenginedev.com/FGED2-sample.pdf
222
+ * Calculate tangents from readable positions, normals and UVs.
223
+ * @remarks
224
+ * Without indices, every three consecutive vertices form a triangle.
225
+ * Incomplete trailing triangles and triangles with zero UV area are ignored.
226
+ * @see http://foundationsofgameenginedev.com/FGED2-sample.pdf
230
227
  */
231
228
  calculateTangents(): void;
232
229
  /**
@@ -1,146 +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
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
20
50
  */
21
- static createSphere(engine: Engine, radius?: number, segments?: number, noLongerAccessible?: boolean): ModelMesh;
51
+ static createPlane(engine: Engine, width: number, depth: number, options?: PlaneMeshOptions): ModelMesh;
22
52
  /**
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
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
30
61
  */
31
- static createSubdivisionSurfaceSphere(engine: Engine, radius?: number, step?: number, noLongerAccessible?: boolean): ModelMesh;
62
+ static createCylinder(engine: Engine, radius: number, height: number, options?: CylinderMeshOptions): ModelMesh;
32
63
  /**
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
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
40
73
  */
41
- static createCuboid(engine: Engine, width?: number, height?: number, depth?: number, noLongerAccessible?: boolean): ModelMesh;
74
+ static createTruncatedCone(engine: Engine, topRadius: number, bottomRadius: number, height: number, options?: TruncatedConeMeshOptions): ModelMesh;
42
75
  /**
43
- * Create a plane mesh with U mapped along local +X and V along local +Z.
44
- * @param engine - Engine
45
- * @param width - Plane width along the local X axis
46
- * @param height - Plane height along the local Z axis
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
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
51
84
  */
52
- static createPlane(engine: Engine, width?: number, height?: number, horizontalSegments?: number, verticalSegments?: number, noLongerAccessible?: boolean): ModelMesh;
85
+ static createCone(engine: Engine, radius: number, height: number, options?: ConeMeshOptions): ModelMesh;
53
86
  /**
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
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
63
95
  */
64
- static createCylinder(engine: Engine, radiusTop?: number, radiusBottom?: number, height?: number, radialSegments?: number, heightSegments?: number, noLongerAccessible?: boolean): ModelMesh;
96
+ static createCapsule(engine: Engine, radius: number, cylinderHeight: number, options?: CapsuleMeshOptions): ModelMesh;
65
97
  /**
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
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
75
105
  */
76
- static createTorus(engine: Engine, radius?: number, tubeRadius?: number, radialSegments?: number, tubularSegments?: number, arc?: number, noLongerAccessible?: boolean): ModelMesh;
106
+ static createTorus(engine: Engine, radius: number, tubeRadius: number, options?: TorusMeshOptions): ModelMesh;
77
107
  /**
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
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
86
114
  */
87
- static createCone(engine: Engine, radius?: number, height?: number, radialSegments?: number, heightSegments?: number, noLongerAccessible?: boolean): ModelMesh;
115
+ static createCircle(engine: Engine, radius: number, options?: CircleMeshOptions): ModelMesh;
88
116
  /**
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
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
97
124
  */
98
- static createCapsule(engine: Engine, radius?: number, height?: number, radialSegments?: number, heightSegments?: number, noLongerAccessible?: boolean): ModelMesh;
125
+ static createRing(engine: Engine, outerRadius: number, innerRadius: number, options?: RingMeshOptions): ModelMesh;
99
126
  /**
100
- * @internal
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
101
134
  */
102
- static _setSubdivisionSurfaceSphereData(sphereMesh: ModelMesh, radius: number, step: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
135
+ static createTetrahedron(engine: Engine, radius: number, options?: RegularPolyhedronMeshOptions): ModelMesh;
103
136
  /**
104
- * @internal
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
105
144
  */
106
- static _setSphereData(sphereMesh: ModelMesh, radius: number, segments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
145
+ static createOctahedron(engine: Engine, radius: number, options?: RegularPolyhedronMeshOptions): ModelMesh;
107
146
  /**
108
- * @internal
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
109
154
  */
110
- static _subdiveCatmullClark(step: number, positions: Float32Array, cells: Float32Array): void;
155
+ static createIcosahedron(engine: Engine, radius: number, options?: RegularPolyhedronMeshOptions): ModelMesh;
111
156
  /**
112
- * Duplicate vertices at the poles and adjust their UV coordinates.
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
113
164
  */
114
- private static _generateAndReplacePoleUV;
165
+ static createDodecahedron(engine: Engine, radius: number, options?: RegularPolyhedronMeshOptions): ModelMesh;
115
166
  /**
116
- * Get edge point index for subdivision surface sphere.
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
117
175
  */
118
- private static _calculateEdgeIndex;
176
+ static createRevolvedSurface(engine: Engine, profile: readonly Vector2[], options?: RevolvedSurfaceMeshOptions): ModelMesh;
119
177
  /**
120
- * @internal
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
121
185
  */
122
- static _setCuboidData(cuboidMesh: ModelMesh, width: number, height: number, depth: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
186
+ static createTube(engine: Engine, path: readonly Vector3[], radius: number, options?: TubeMeshOptions): ModelMesh;
123
187
  /**
124
- * @internal
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
125
194
  */
126
- static _setPlaneData(planeMesh: ModelMesh, width: number, height: number, horizontalSegments: number, verticalSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
195
+ static createPolygon(engine: Engine, shapes: readonly Vector2[] | PolygonShape | readonly PolygonShape[], options?: PolygonMeshOptions): ModelMesh;
127
196
  /**
128
- * @internal
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
129
205
  */
130
- static _setCylinderData(cylinderMesh: ModelMesh, radiusTop: number | undefined, radiusBottom: number | undefined, height: number | undefined, radialSegments: number | undefined, heightSegments: number | undefined, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
206
+ static createExtrudedPolygon(engine: Engine, shapes: readonly Vector2[] | PolygonShape | readonly PolygonShape[], depth: number, options?: LinearExtrudedPolygonMeshOptions): ModelMesh;
131
207
  /**
132
- * @internal
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
133
218
  */
134
- static _setTorusData(torusMesh: ModelMesh, radius: number, tubeRadius: number, radialSegments: number, tubularSegments: number, arc: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
219
+ static createExtrudedPolygon(engine: Engine, shapes: readonly Vector2[] | PolygonShape | readonly PolygonShape[], path: readonly Vector3[], options?: PathExtrudedPolygonMeshOptions): ModelMesh;
135
220
  /**
136
- * @internal
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
137
230
  */
138
- static _setConeData(coneMesh: ModelMesh, radius: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
231
+ static createTorusKnot(engine: Engine, radius: number, tubeRadius: number, axisTurns: number, crossSectionTurns: number, options?: TorusKnotMeshOptions): ModelMesh;
139
232
  /**
140
- * @internal
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
141
243
  */
142
- static _setCapsuleData(capsuleMesh: ModelMesh, radius: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
143
- private static _initialize;
144
- private static _generateIndices;
145
- private static _createCapsuleCap;
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;
146
274
  }