@galacean/engine-physics-physx 2.0.0-alpha.17 → 2.0.0-alpha.19

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-physics-physx",
3
- "version": "2.0.0-alpha.17",
3
+ "version": "2.0.0-alpha.19",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,11 +26,11 @@
26
26
  "types/**/*"
27
27
  ],
28
28
  "devDependencies": {
29
- "@galacean/engine": "2.0.0-alpha.17",
30
- "@galacean/engine-design": "2.0.0-alpha.17"
29
+ "@galacean/engine-design": "2.0.0-alpha.19",
30
+ "@galacean/engine": "2.0.0-alpha.19"
31
31
  },
32
32
  "peerDependencies": {
33
- "@galacean/engine": "2.0.0-alpha.17"
33
+ "@galacean/engine": "2.0.0-alpha.19"
34
34
  },
35
35
  "scripts": {
36
36
  "b:types": "tsc"
@@ -1,5 +1,5 @@
1
1
  import { Quaternion, Vector3 } from "@galacean/engine";
2
- import { IBoxColliderShape, ICapsuleColliderShape, ICharacterController, ICollision, IDynamicCollider, IFixedJoint, IHingeJoint, IMeshColliderShape, IPhysics, IPhysicsManager, IPhysicsMaterial, IPhysicsScene, IPlaneColliderShape, ISphereColliderShape, ISpringJoint, IStaticCollider } from "@galacean/engine-design";
2
+ import { IBoxColliderShape, ICapsuleColliderShape, ICharacterController, IDynamicCollider, IFixedJoint, IHingeJoint, IMeshColliderShape, IPhysics, IPhysicsManager, IPhysicsMaterial, IPhysicsScene, IPlaneColliderShape, ISphereColliderShape, ISpringJoint, IStaticCollider } from "@galacean/engine-design";
3
3
  import { PhysXCollider } from "./PhysXCollider";
4
4
  import { PhysXPhysicsManager } from "./PhysXPhysicsManager";
5
5
  import { PhysXPhysicsMaterial } from "./PhysXPhysicsMaterial";
@@ -39,7 +39,7 @@ export declare class PhysXPhysics implements IPhysics {
39
39
  /**
40
40
  * {@inheritDoc IPhysics.createPhysicsScene }
41
41
  */
42
- createPhysicsScene(physicsManager: PhysXPhysicsManager, onContactBegin?: (collision: ICollision) => void, onContactEnd?: (collision: ICollision) => void, onContactStay?: (collision: ICollision) => void, onTriggerBegin?: (obj1: number, obj2: number) => void, onTriggerEnd?: (obj1: number, obj2: number) => void, onTriggerStay?: (obj1: number, obj2: number) => void): IPhysicsScene;
42
+ createPhysicsScene(physicsManager: PhysXPhysicsManager): IPhysicsScene;
43
43
  /**
44
44
  * {@inheritDoc IPhysics.createStaticCollider }
45
45
  */
@@ -1,5 +1,5 @@
1
1
  import { Ray, Vector3, Quaternion } from "@galacean/engine";
2
- import { ICollision, IPhysicsScene } from "@galacean/engine-design";
2
+ import { IPhysicsScene, IPhysicsEvents, ITriggerEvent } from "@galacean/engine-design";
3
3
  import { PhysXCharacterController } from "./PhysXCharacterController";
4
4
  import { PhysXCollider } from "./PhysXCollider";
5
5
  import { PhysXPhysics } from "./PhysXPhysics";
@@ -22,15 +22,13 @@ export declare class PhysXPhysicsScene implements IPhysicsScene {
22
22
  private _pxFilterData;
23
23
  private _pxScene;
24
24
  private _physXSimulationCallbackInstance;
25
- private readonly _onContactEnter?;
26
- private readonly _onContactExit?;
27
- private readonly _onContactStay?;
28
- private readonly _onTriggerEnter?;
29
- private readonly _onTriggerExit?;
30
- private readonly _onTriggerStay?;
31
- private _currentEvents;
32
- private _eventPool;
33
- constructor(physXPhysics: PhysXPhysics, physicsManager: PhysXPhysicsManager, onContactEnter?: (collision: ICollision) => void, onContactExit?: (collision: ICollision) => void, onContactStay?: (collision: ICollision) => void, onTriggerEnter?: (obj1: number, obj2: number) => void, onTriggerExit?: (obj1: number, obj2: number) => void, onTriggerStay?: (obj1: number, obj2: number) => void);
25
+ private _activeTriggers;
26
+ private _contactEvents;
27
+ private _contactEventCount;
28
+ private _triggerEvents;
29
+ private _physicsEvents;
30
+ private _triggerEventPool;
31
+ constructor(physXPhysics: PhysXPhysics, physicsManager: PhysXPhysicsManager);
34
32
  /**
35
33
  * {@inheritDoc IPhysicsScene.setGravity }
36
34
  */
@@ -55,6 +53,10 @@ export declare class PhysXPhysicsScene implements IPhysicsScene {
55
53
  * {@inheritDoc IPhysicsScene.update }
56
54
  */
57
55
  update(elapsedTime: number): void;
56
+ /**
57
+ * {@inheritDoc IPhysicsScene.updateEvents }
58
+ */
59
+ updateEvents(): IPhysicsEvents;
58
60
  /**
59
61
  * {@inheritDoc IPhysicsScene.raycast }
60
62
  */
@@ -83,6 +85,10 @@ export declare class PhysXPhysicsScene implements IPhysicsScene {
83
85
  * {@inheritDoc IPhysicsScene.overlapCapsuleAll }
84
86
  */
85
87
  overlapCapsuleAll(center: Vector3, radius: number, height: number, orientation: Quaternion, onOverlap: (obj: number) => boolean): number[];
88
+ /**
89
+ * {@inheritDoc IPhysicsScene.gc }
90
+ */
91
+ gc(): void;
86
92
  /**
87
93
  * {@inheritDoc IPhysicsScene.destroy }
88
94
  */
@@ -92,23 +98,15 @@ export declare class PhysXPhysicsScene implements IPhysicsScene {
92
98
  private _simulate;
93
99
  private _fetchResults;
94
100
  private _getTrigger;
95
- private _fireEvent;
96
- }
97
- /**
98
- * Physics state
99
- */
100
- declare enum TriggerEventState {
101
- Enter = 0,
102
- Stay = 1,
103
- Exit = 2
101
+ private _bufferContactEvent;
104
102
  }
105
103
  /**
106
104
  * Trigger event to store interactive object ids and state.
107
105
  */
108
- export declare class TriggerEvent {
109
- state: TriggerEventState;
106
+ export declare class TriggerEvent implements ITriggerEvent {
107
+ state: number;
108
+ dispatchState: number;
110
109
  index1: number;
111
110
  index2: number;
112
111
  constructor(index1: number, index2: number);
113
112
  }
114
- export {};