@galacean/engine-design 1.6.13 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-design",
3
- "version": "1.6.13",
3
+ "version": "2.0.0-alpha.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "types": "types/index.d.ts",
19
19
  "dependencies": {
20
- "@galacean/engine-math": "1.6.13"
20
+ "@galacean/engine-math": "2.0.0-alpha.1"
21
21
  },
22
22
  "scripts": {
23
23
  "b:types": "tsc"
@@ -7,7 +7,7 @@ import { IPhysicsMaterial } from "./IPhysicsMaterial";
7
7
  import { IPhysicsScene } from "./IPhysicsScene";
8
8
  import { IStaticCollider } from "./IStaticCollider";
9
9
  import { IFixedJoint, IHingeJoint, ISpringJoint } from "./joints";
10
- import { IBoxColliderShape, ICapsuleColliderShape, IPlaneColliderShape, ISphereColliderShape } from "./shape";
10
+ import { IBoxColliderShape, ICapsuleColliderShape, IMeshColliderShape, IPlaneColliderShape, ISphereColliderShape } from "./shape";
11
11
  import { ICollision } from "./ICollision";
12
12
  /**
13
13
  * The interface of physics creation.
@@ -86,6 +86,16 @@ export interface IPhysics {
86
86
  * @param material - The material of this shape
87
87
  */
88
88
  createCapsuleColliderShape(uniqueID: number, radius: number, height: number, material: IPhysicsMaterial): ICapsuleColliderShape;
89
+ /**
90
+ * Create mesh collider shape.
91
+ * @param uniqueID - Shape unique id
92
+ * @param vertices - Vertex positions (Float32Array, 3 floats per vertex)
93
+ * @param vertexCount - Number of vertices
94
+ * @param indices - Index array (null for convex mesh)
95
+ * @param isConvex - Whether to create convex mesh (true) or triangle mesh (false)
96
+ * @param material - The material of this shape
97
+ */
98
+ createMeshColliderShape(uniqueID: number, vertices: Float32Array, vertexCount: number, indices: Uint16Array | Uint32Array | null, isConvex: boolean, material: IPhysicsMaterial): IMeshColliderShape;
89
99
  /**
90
100
  * Create fixed joint.
91
101
  * @param collider - collider of joint
@@ -0,0 +1,26 @@
1
+ import { IColliderShape } from "./IColliderShape";
2
+ /**
3
+ * Interface for mesh collider shape.
4
+ */
5
+ export interface IMeshColliderShape extends IColliderShape {
6
+ /**
7
+ * Set mesh data for this collider shape.
8
+ * @param vertices - The vertex positions array (Float32Array, 3 floats per vertex)
9
+ * @param vertexCount - Number of vertices
10
+ * @param indices - The index array (Uint16Array or Uint32Array), required for triangle mesh
11
+ * @param isConvex - Whether to use convex mesh (true) or triangle mesh (false)
12
+ */
13
+ setMeshData(vertices: Float32Array, vertexCount: number, indices: Uint16Array | Uint32Array | null, isConvex: boolean): void;
14
+ /**
15
+ * Set whether the triangle mesh should be double-sided for collision detection.
16
+ * Only applies to triangle mesh (non-convex). Default: false
17
+ * @param value - Whether to enable double-sided collision
18
+ */
19
+ setDoubleSided(value: boolean): void;
20
+ /**
21
+ * Set whether to use tight bounds for convex mesh.
22
+ * Only applies to convex mesh. Default: true
23
+ * @param value - Whether to enable tight bounds
24
+ */
25
+ setTightBounds(value: boolean): void;
26
+ }
@@ -3,3 +3,4 @@ export type { IBoxColliderShape } from "./IBoxColliderShape";
3
3
  export type { ICapsuleColliderShape } from "./ICapsuleColliderShape";
4
4
  export type { ISphereColliderShape } from "./ISphereColliderShape";
5
5
  export type { IPlaneColliderShape } from "./IPlaneColliderShape";
6
+ export type { IMeshColliderShape } from "./IMeshColliderShape";