@galacean/engine-design 2.0.0-alpha.40 → 2.0.0-alpha.43

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": "2.0.0-alpha.40",
3
+ "version": "2.0.0-alpha.43",
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": "2.0.0-alpha.40"
20
+ "@galacean/engine-math": "2.0.0-alpha.43"
21
21
  },
22
22
  "scripts": {
23
23
  "b:types": "tsc"
@@ -2,13 +2,16 @@
2
2
  * Interface of collision.
3
3
  */
4
4
  export interface ICollision {
5
- /** The unique id of the first collider. */
5
+ /** The unique ID of the first shape in the contact pair. */
6
6
  shape0Id: number;
7
- /** The unique id of the second collider. */
7
+ /** The unique ID of the second shape in the contact pair. */
8
8
  shape1Id: number;
9
9
  /** Count of contact points. */
10
10
  contactCount: number;
11
- /** Get contact points. */
11
+ /**
12
+ * Get contact points.
13
+ * @remarks Contact normals and impulses must point from the second shape in the pair to the first.
14
+ */
12
15
  getContacts(): VectorContactPairPoint;
13
16
  }
14
17
  interface VectorContactPairPoint {
@@ -98,20 +98,16 @@ export interface IDynamicCollider extends ICollider {
98
98
  * @param value - Number of position iterations the solver should perform for this body
99
99
  */
100
100
  setSolverIterations(value: number): void;
101
- /**
102
- * Sets the colliders' collision detection mode.
103
- * @param value - rigid body flag
104
- */
105
- setCollisionDetectionMode(value: number): void;
106
101
  /**
107
102
  * Whether the collider is affected by gravity.
108
103
  */
109
104
  setUseGravity(value: boolean): void;
110
105
  /**
111
- * Controls whether physics affects the dynamic collider.
112
- * @param value - is or not
106
+ * Sets the kinematic state and requested collision detection mode in one native transition.
107
+ * @param isKinematic - Whether the dynamic collider is kinematic
108
+ * @param collisionDetectionMode - The requested collision detection mode
113
109
  */
114
- setIsKinematic(value: boolean): void;
110
+ setMotionState(isKinematic: boolean, collisionDetectionMode: number): void;
115
111
  /**
116
112
  * Raises or clears a particular rigid dynamic lock flag.
117
113
  * @param flags - the flag to raise(set) or clear
@@ -36,6 +36,11 @@ export interface IPhysicsScene {
36
36
  * @param elapsedTime - Step time of update.
37
37
  */
38
38
  update(elapsedTime: number): void;
39
+ /**
40
+ * Enable contact event delivery.
41
+ * @param enabled - Whether collision contact events should be delivered for dispatch.
42
+ */
43
+ setContactEventEnabled(enabled: boolean): void;
39
44
  /**
40
45
  * Collect buffered collision and trigger events.
41
46
  * Must be called after update() and after syncing transforms back from physics.