@galacean/engine-physics-physx 0.9.0 → 1.0.0-beta.0
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/README.md +2 -2
- package/dist/browser.js +222 -197
- package/dist/browser.min.js +1 -1
- package/dist/main.js +222 -197
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +38526 -7553
- package/dist/module.js +220 -197
- package/dist/module.js.map +1 -1
- package/libs/physx.release.js +1 -1
- package/libs/physx.release.js.js +32 -31
- package/libs/physx.release.js.mem +0 -0
- package/package.json +4 -4
- package/types/PhysXCharacterController.d.ts +6 -0
- package/types/PhysXCollider.d.ts +3 -0
- package/types/PhysXDynamicCollider.d.ts +2 -1
- package/types/PhysXPhysics.d.ts +21 -17
- package/types/PhysXPhysicsManager.d.ts +5 -4
- package/types/PhysXPhysicsMaterial.d.ts +3 -1
- package/types/PhysXStaticCollider.d.ts +3 -7
- package/types/joint/PhysXFixedJoint.d.ts +3 -2
- package/types/joint/PhysXHingeJoint.d.ts +4 -3
- package/types/joint/PhysXJoint.d.ts +4 -1
- package/types/joint/PhysXSpringJoint.d.ts +2 -1
- package/types/shape/PhysXBoxColliderShape.d.ts +3 -7
- package/types/shape/PhysXCapsuleColliderShape.d.ts +2 -8
- package/types/shape/PhysXColliderShape.d.ts +5 -2
- package/types/shape/PhysXPlaneColliderShape.d.ts +2 -11
- package/types/shape/PhysXSphereColliderShape.d.ts +4 -9
- package/types/StaticInterfaceImplement.d.ts +0 -5
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-physics-physx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"types/**/*"
|
|
24
24
|
],
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@galacean/engine
|
|
27
|
-
"@galacean/engine": "0.
|
|
26
|
+
"@galacean/engine": "1.0.0-beta.0",
|
|
27
|
+
"@galacean/engine-design": "1.0.0-beta.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@galacean/engine": "0.
|
|
30
|
+
"@galacean/engine": "1.0.0-beta.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"b:types": "tsc"
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { ICharacterController } from "@galacean/engine-design";
|
|
2
2
|
import { Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXPhysics } from "./PhysXPhysics";
|
|
3
4
|
import { PhysXColliderShape } from "./shape/PhysXColliderShape";
|
|
4
5
|
/**
|
|
5
6
|
* Base class for character controllers.
|
|
6
7
|
*/
|
|
7
8
|
export declare class PhysXCharacterController implements ICharacterController {
|
|
9
|
+
private static _tempVec;
|
|
10
|
+
private _scaledOffset;
|
|
11
|
+
private _position;
|
|
12
|
+
private _physXPhysics;
|
|
13
|
+
constructor(physXPhysics: PhysXPhysics);
|
|
8
14
|
/**
|
|
9
15
|
* {@inheritDoc ICharacterController.move }
|
|
10
16
|
*/
|
package/types/PhysXCollider.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ICollider } from "@galacean/engine-design";
|
|
2
2
|
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXPhysics } from "./PhysXPhysics";
|
|
3
4
|
import { PhysXColliderShape } from "./shape/PhysXColliderShape";
|
|
4
5
|
/**
|
|
5
6
|
* Abstract class of physical collider.
|
|
6
7
|
*/
|
|
7
8
|
export declare abstract class PhysXCollider implements ICollider {
|
|
8
9
|
private static _tempTransform;
|
|
10
|
+
protected _physXPhysics: PhysXPhysics;
|
|
11
|
+
constructor(physXPhysics: PhysXPhysics);
|
|
9
12
|
/**
|
|
10
13
|
* {@inheritDoc ICollider.addShape }
|
|
11
14
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IDynamicCollider } from "@galacean/engine-design";
|
|
2
2
|
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
3
|
import { PhysXCollider } from "./PhysXCollider";
|
|
4
|
+
import { PhysXPhysics } from "./PhysXPhysics";
|
|
4
5
|
/**
|
|
5
6
|
* The collision detection mode constants used for PhysXDynamicCollider.collisionDetectionMode.
|
|
6
7
|
* */
|
|
@@ -20,7 +21,7 @@ export declare enum CollisionDetectionMode {
|
|
|
20
21
|
export declare class PhysXDynamicCollider extends PhysXCollider implements IDynamicCollider {
|
|
21
22
|
private static _tempTranslation;
|
|
22
23
|
private static _tempRotation;
|
|
23
|
-
constructor(position: Vector3, rotation: Quaternion);
|
|
24
|
+
constructor(physXPhysics: PhysXPhysics, position: Vector3, rotation: Quaternion);
|
|
24
25
|
/**
|
|
25
26
|
* {@inheritDoc IDynamicCollider.setLinearDamping }
|
|
26
27
|
*/
|
package/types/PhysXPhysics.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBoxColliderShape, ICapsuleColliderShape, ICharacterController, IDynamicCollider, IFixedJoint, IHingeJoint, IPhysicsManager, IPhysicsMaterial, IPlaneColliderShape, ISphereColliderShape, ISpringJoint, IStaticCollider } from "@galacean/engine-design";
|
|
1
|
+
import { IBoxColliderShape, ICapsuleColliderShape, ICharacterController, IDynamicCollider, IFixedJoint, IHingeJoint, IPhysics, IPhysicsManager, IPhysicsMaterial, IPlaneColliderShape, ISphereColliderShape, ISpringJoint, IStaticCollider } from "@galacean/engine-design";
|
|
2
2
|
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
3
|
import { PhysXRuntimeMode } from "./enum/PhysXRuntimeMode";
|
|
4
4
|
import { PhysXCollider } from "./PhysXCollider";
|
|
@@ -6,64 +6,68 @@ import { PhysXPhysicsMaterial } from "./PhysXPhysicsMaterial";
|
|
|
6
6
|
/**
|
|
7
7
|
* PhysX object creation.
|
|
8
8
|
*/
|
|
9
|
-
export declare class PhysXPhysics {
|
|
9
|
+
export declare class PhysXPhysics implements IPhysics {
|
|
10
|
+
private _runTimeMode;
|
|
11
|
+
private _initializeState;
|
|
12
|
+
private _initializePromise;
|
|
13
|
+
constructor(runtimeMode?: PhysXRuntimeMode);
|
|
10
14
|
/**
|
|
11
15
|
* Initialize PhysXPhysics.
|
|
12
16
|
* @param runtimeMode - Runtime mode
|
|
13
17
|
* @returns Promise object
|
|
14
18
|
*/
|
|
15
|
-
|
|
19
|
+
initialize(): Promise<void>;
|
|
16
20
|
/**
|
|
17
21
|
* Destroy PhysXPhysics.
|
|
18
22
|
*/
|
|
19
|
-
|
|
23
|
+
destroy(): void;
|
|
20
24
|
/**
|
|
21
25
|
* {@inheritDoc IPhysics.createPhysicsManager }
|
|
22
26
|
*/
|
|
23
|
-
|
|
27
|
+
createPhysicsManager(onContactBegin?: (obj1: number, obj2: number) => void, onContactEnd?: (obj1: number, obj2: number) => void, onContactStay?: (obj1: number, obj2: number) => void, onTriggerBegin?: (obj1: number, obj2: number) => void, onTriggerEnd?: (obj1: number, obj2: number) => void, onTriggerStay?: (obj1: number, obj2: number) => void): IPhysicsManager;
|
|
24
28
|
/**
|
|
25
29
|
* {@inheritDoc IPhysics.createStaticCollider }
|
|
26
30
|
*/
|
|
27
|
-
|
|
31
|
+
createStaticCollider(position: Vector3, rotation: Quaternion): IStaticCollider;
|
|
28
32
|
/**
|
|
29
33
|
* {@inheritDoc IPhysics.createDynamicCollider }
|
|
30
34
|
*/
|
|
31
|
-
|
|
35
|
+
createDynamicCollider(position: Vector3, rotation: Quaternion): IDynamicCollider;
|
|
32
36
|
/**
|
|
33
37
|
* {@inheritDoc IPhysics.createCharacterController }
|
|
34
38
|
*/
|
|
35
|
-
|
|
39
|
+
createCharacterController(): ICharacterController;
|
|
36
40
|
/**
|
|
37
41
|
* {@inheritDoc IPhysics.createPhysicsMaterial }
|
|
38
42
|
*/
|
|
39
|
-
|
|
43
|
+
createPhysicsMaterial(staticFriction: number, dynamicFriction: number, bounciness: number, frictionCombine: number, bounceCombine: number): IPhysicsMaterial;
|
|
40
44
|
/**
|
|
41
45
|
* {@inheritDoc IPhysics.createBoxColliderShape }
|
|
42
46
|
*/
|
|
43
|
-
|
|
47
|
+
createBoxColliderShape(uniqueID: number, size: Vector3, material: PhysXPhysicsMaterial): IBoxColliderShape;
|
|
44
48
|
/**
|
|
45
49
|
* {@inheritDoc IPhysics.createSphereColliderShape }
|
|
46
50
|
*/
|
|
47
|
-
|
|
51
|
+
createSphereColliderShape(uniqueID: number, radius: number, material: PhysXPhysicsMaterial): ISphereColliderShape;
|
|
48
52
|
/**
|
|
49
53
|
* {@inheritDoc IPhysics.createPlaneColliderShape }
|
|
50
54
|
*/
|
|
51
|
-
|
|
55
|
+
createPlaneColliderShape(uniqueID: number, material: PhysXPhysicsMaterial): IPlaneColliderShape;
|
|
52
56
|
/**
|
|
53
57
|
* {@inheritDoc IPhysics.createCapsuleColliderShape }
|
|
54
58
|
*/
|
|
55
|
-
|
|
59
|
+
createCapsuleColliderShape(uniqueID: number, radius: number, height: number, material: PhysXPhysicsMaterial): ICapsuleColliderShape;
|
|
56
60
|
/**
|
|
57
61
|
* {@inheritDoc IPhysics.createFixedJoint }
|
|
58
62
|
*/
|
|
59
|
-
|
|
63
|
+
createFixedJoint(collider: PhysXCollider): IFixedJoint;
|
|
60
64
|
/**
|
|
61
65
|
* {@inheritDoc IPhysics.createHingeJoint }
|
|
62
66
|
*/
|
|
63
|
-
|
|
67
|
+
createHingeJoint(collider: PhysXCollider): IHingeJoint;
|
|
64
68
|
/**
|
|
65
69
|
* {@inheritDoc IPhysics.createSpringJoint }
|
|
66
70
|
*/
|
|
67
|
-
|
|
68
|
-
private
|
|
71
|
+
createSpringJoint(collider: PhysXCollider): ISpringJoint;
|
|
72
|
+
private _init;
|
|
69
73
|
}
|
|
@@ -2,6 +2,7 @@ import { IPhysicsManager } from "@galacean/engine-design";
|
|
|
2
2
|
import { Ray, Vector3 } from "@galacean/engine";
|
|
3
3
|
import { PhysXCharacterController } from "./PhysXCharacterController";
|
|
4
4
|
import { PhysXCollider } from "./PhysXCollider";
|
|
5
|
+
import { PhysXPhysics } from "./PhysXPhysics";
|
|
5
6
|
import { PhysXColliderShape } from "./shape/PhysXColliderShape";
|
|
6
7
|
/**
|
|
7
8
|
* A manager is a collection of colliders and constraints which can interact.
|
|
@@ -9,9 +10,9 @@ import { PhysXColliderShape } from "./shape/PhysXColliderShape";
|
|
|
9
10
|
export declare class PhysXPhysicsManager implements IPhysicsManager {
|
|
10
11
|
private static _tempPosition;
|
|
11
12
|
private static _tempNormal;
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
|
|
13
|
+
private _physXPhysics;
|
|
14
|
+
private _pxRaycastHit;
|
|
15
|
+
private _pxFilterData;
|
|
15
16
|
private _pxScene;
|
|
16
17
|
private readonly _onContactEnter?;
|
|
17
18
|
private readonly _onContactExit?;
|
|
@@ -22,7 +23,7 @@ export declare class PhysXPhysicsManager implements IPhysicsManager {
|
|
|
22
23
|
private _currentEvents;
|
|
23
24
|
private _eventMap;
|
|
24
25
|
private _eventPool;
|
|
25
|
-
constructor(onContactEnter?: (obj1: number, obj2: number) => void, onContactExit?: (obj1: number, obj2: number) => void, onContactStay?: (obj1: number, obj2: number) => void, onTriggerEnter?: (obj1: number, obj2: number) => void, onTriggerExit?: (obj1: number, obj2: number) => void, onTriggerStay?: (obj1: number, obj2: number) => void);
|
|
26
|
+
constructor(physXPhysics: PhysXPhysics, onContactEnter?: (obj1: number, obj2: number) => void, onContactExit?: (obj1: number, obj2: number) => void, onContactStay?: (obj1: number, obj2: number) => void, onTriggerEnter?: (obj1: number, obj2: number) => void, onTriggerExit?: (obj1: number, obj2: number) => void, onTriggerStay?: (obj1: number, obj2: number) => void);
|
|
26
27
|
/**
|
|
27
28
|
* {@inheritDoc IPhysicsManager.setGravity }
|
|
28
29
|
*/
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IPhysicsMaterial } from "@galacean/engine-design";
|
|
2
|
+
import { PhysXPhysics } from "./PhysXPhysics";
|
|
2
3
|
/**
|
|
3
4
|
* Physics material describes how to handle colliding objects (friction, bounciness).
|
|
4
5
|
*/
|
|
5
6
|
export declare class PhysXPhysicsMaterial implements IPhysicsMaterial {
|
|
6
|
-
|
|
7
|
+
protected _physXPhysics: PhysXPhysics;
|
|
8
|
+
constructor(physXPhysics: PhysXPhysics, staticFriction: number, dynamicFriction: number, bounciness: number, frictionCombine: CombineMode, bounceCombine: CombineMode);
|
|
7
9
|
/**
|
|
8
10
|
* {@inheritDoc IPhysicsMaterial.setBounciness }
|
|
9
11
|
*/
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { IStaticCollider } from "@galacean/engine-design";
|
|
2
|
-
import { PhysXCollider } from "./PhysXCollider";
|
|
3
2
|
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXCollider } from "./PhysXCollider";
|
|
4
|
+
import { PhysXPhysics } from "./PhysXPhysics";
|
|
4
5
|
/**
|
|
5
6
|
* A static collider component that will not move.
|
|
6
7
|
* @remarks Mostly used for object which always stays at the same place and never moves around.
|
|
7
8
|
*/
|
|
8
9
|
export declare class PhysXStaticCollider extends PhysXCollider implements IStaticCollider {
|
|
9
|
-
|
|
10
|
-
* Initialize PhysX static actor.
|
|
11
|
-
* @param position - The global position
|
|
12
|
-
* @param rotation - The global rotation
|
|
13
|
-
*/
|
|
14
|
-
constructor(position: Vector3, rotation: Quaternion);
|
|
10
|
+
constructor(physXPhysics: PhysXPhysics, position: Vector3, rotation: Quaternion);
|
|
15
11
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { PhysXJoint } from "./PhysXJoint";
|
|
2
1
|
import { IFixedJoint } from "@galacean/engine-design";
|
|
3
2
|
import { PhysXCollider } from "../PhysXCollider";
|
|
3
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
4
|
+
import { PhysXJoint } from "./PhysXJoint";
|
|
4
5
|
/**
|
|
5
6
|
* A fixed joint permits no relative movement between two colliders. ie the bodies are glued together.
|
|
6
7
|
*/
|
|
7
8
|
export declare class PhysXFixedJoint extends PhysXJoint implements IFixedJoint {
|
|
8
|
-
constructor(collider: PhysXCollider);
|
|
9
|
+
constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider);
|
|
9
10
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { PhysXCollider } from "../PhysXCollider";
|
|
2
|
-
import { PhysXJoint } from "./PhysXJoint";
|
|
3
1
|
import { IHingeJoint } from "@galacean/engine-design";
|
|
4
2
|
import { Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXCollider } from "../PhysXCollider";
|
|
4
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
5
|
+
import { PhysXJoint } from "./PhysXJoint";
|
|
5
6
|
/**
|
|
6
7
|
* A joint which behaves in a similar way to a hinge or axle.
|
|
7
8
|
*/
|
|
@@ -9,7 +10,7 @@ export declare class PhysXHingeJoint extends PhysXJoint implements IHingeJoint {
|
|
|
9
10
|
private _axisRotationQuaternion;
|
|
10
11
|
private _swingOffset;
|
|
11
12
|
private _velocity;
|
|
12
|
-
constructor(collider: PhysXCollider);
|
|
13
|
+
constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider);
|
|
13
14
|
/**
|
|
14
15
|
* {@inheritDoc IHingeJoint.setAxis }
|
|
15
16
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IJoint } from "@galacean/engine-design";
|
|
2
|
-
import { PhysXCollider } from "../PhysXCollider";
|
|
3
2
|
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXCollider } from "../PhysXCollider";
|
|
4
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
4
5
|
/**
|
|
5
6
|
* a base interface providing common functionality for PhysX joints
|
|
6
7
|
*/
|
|
@@ -13,6 +14,8 @@ export declare class PhysXJoint implements IJoint {
|
|
|
13
14
|
private _connectedAnchor;
|
|
14
15
|
private _breakForce;
|
|
15
16
|
private _breakTorque;
|
|
17
|
+
protected _physXPhysics: PhysXPhysics;
|
|
18
|
+
constructor(physXPhysics: PhysXPhysics);
|
|
16
19
|
/**
|
|
17
20
|
* {@inheritDoc IJoint.setConnectedCollider }
|
|
18
21
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
1
2
|
import { PhysXJoint } from "./PhysXJoint";
|
|
2
3
|
import { ISpringJoint } from "@galacean/engine-design";
|
|
3
4
|
import { PhysXCollider } from "../PhysXCollider";
|
|
@@ -7,7 +8,7 @@ import { Vector3 } from "@galacean/engine";
|
|
|
7
8
|
*/
|
|
8
9
|
export declare class PhysXSpringJoint extends PhysXJoint implements ISpringJoint {
|
|
9
10
|
private _swingOffset;
|
|
10
|
-
constructor(collider: PhysXCollider);
|
|
11
|
+
constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider);
|
|
11
12
|
/**
|
|
12
13
|
* {@inheritDoc ISpringJoint.setSwingOffset }
|
|
13
14
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IBoxColliderShape } from "@galacean/engine-design";
|
|
2
2
|
import { Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
3
4
|
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
4
5
|
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
5
6
|
/**
|
|
@@ -7,13 +8,7 @@ import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
|
7
8
|
*/
|
|
8
9
|
export declare class PhysXBoxColliderShape extends PhysXColliderShape implements IBoxColliderShape {
|
|
9
10
|
private static _tempHalfExtents;
|
|
10
|
-
|
|
11
|
-
* Init Box Shape and alloc PhysX objects.
|
|
12
|
-
* @param uniqueID - UniqueID mark Shape.
|
|
13
|
-
* @param size - Size of Shape.
|
|
14
|
-
* @param material - Material of PhysXCollider.
|
|
15
|
-
*/
|
|
16
|
-
constructor(uniqueID: number, size: Vector3, material: PhysXPhysicsMaterial);
|
|
11
|
+
constructor(physXPhysics: PhysXPhysics, uniqueID: number, size: Vector3, material: PhysXPhysicsMaterial);
|
|
17
12
|
/**
|
|
18
13
|
* {@inheritDoc IBoxColliderShape.setSize }
|
|
19
14
|
*/
|
|
@@ -22,4 +17,5 @@ export declare class PhysXBoxColliderShape extends PhysXColliderShape implements
|
|
|
22
17
|
* {@inheritDoc IColliderShape.setWorldScale }
|
|
23
18
|
*/
|
|
24
19
|
setWorldScale(scale: Vector3): void;
|
|
20
|
+
private _updateController;
|
|
25
21
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ICapsuleColliderShape } from "@galacean/engine-design";
|
|
2
2
|
import { Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
3
4
|
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
4
5
|
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
5
6
|
/**
|
|
@@ -7,14 +8,7 @@ import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
|
7
8
|
*/
|
|
8
9
|
export declare class PhysXCapsuleColliderShape extends PhysXColliderShape implements ICapsuleColliderShape {
|
|
9
10
|
private _upAxis;
|
|
10
|
-
|
|
11
|
-
* Init PhysXCollider and alloc PhysX objects.
|
|
12
|
-
* @param uniqueID - UniqueID mark collider
|
|
13
|
-
* @param radius - Radius of CapsuleCollider
|
|
14
|
-
* @param height - Height of CapsuleCollider
|
|
15
|
-
* @param material - Material of PhysXCollider
|
|
16
|
-
*/
|
|
17
|
-
constructor(uniqueID: number, radius: number, height: number, material: PhysXPhysicsMaterial);
|
|
11
|
+
constructor(physXPhysics: PhysXPhysics, uniqueID: number, radius: number, height: number, material: PhysXPhysicsMaterial);
|
|
18
12
|
/**
|
|
19
13
|
* {@inheritDoc ICapsuleColliderShape.setRadius }
|
|
20
14
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IColliderShape } from "@galacean/engine-design";
|
|
2
2
|
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
3
4
|
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
4
5
|
/**
|
|
5
6
|
* Flags which affect the behavior of Shapes.
|
|
@@ -21,12 +22,14 @@ export declare abstract class PhysXColliderShape implements IColliderShape {
|
|
|
21
22
|
translation: Vector3;
|
|
22
23
|
rotation: any;
|
|
23
24
|
};
|
|
25
|
+
protected _physXPhysics: PhysXPhysics;
|
|
24
26
|
protected _scale: Vector3;
|
|
25
27
|
protected _position: Vector3;
|
|
26
28
|
protected _rotation: Vector3;
|
|
27
29
|
protected _axis: Quaternion;
|
|
28
|
-
protected
|
|
30
|
+
protected _physXRotation: Quaternion;
|
|
29
31
|
private _shapeFlags;
|
|
32
|
+
constructor(physXPhysics: PhysXPhysics);
|
|
30
33
|
/**
|
|
31
34
|
* {@inheritDoc IColliderShape.setRotation }
|
|
32
35
|
*/
|
|
@@ -38,7 +41,7 @@ export declare abstract class PhysXColliderShape implements IColliderShape {
|
|
|
38
41
|
/**
|
|
39
42
|
* {@inheritDoc IColliderShape.setWorldScale }
|
|
40
43
|
*/
|
|
41
|
-
|
|
44
|
+
setWorldScale(scale: Vector3): void;
|
|
42
45
|
/**
|
|
43
46
|
* {@inheritDoc IColliderShape.setContactOffset }
|
|
44
47
|
* @default 0.02f * PxTolerancesScale::length
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { IPlaneColliderShape } from "@galacean/engine-design";
|
|
2
|
-
import {
|
|
2
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
3
3
|
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
4
4
|
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
5
5
|
/**
|
|
6
6
|
* Plane collider shape in PhysX.
|
|
7
7
|
*/
|
|
8
8
|
export declare class PhysXPlaneColliderShape extends PhysXColliderShape implements IPlaneColliderShape {
|
|
9
|
-
|
|
10
|
-
* Init PhysXCollider and alloc PhysX objects.
|
|
11
|
-
* @param uniqueID - UniqueID mark collider
|
|
12
|
-
* @param material - Material of PhysXCollider
|
|
13
|
-
*/
|
|
14
|
-
constructor(uniqueID: number, material: PhysXPhysicsMaterial);
|
|
15
|
-
/**
|
|
16
|
-
* {@inheritDoc IColliderShape.setWorldScale }
|
|
17
|
-
*/
|
|
18
|
-
setWorldScale(scale: Vector3): void;
|
|
9
|
+
constructor(physXPhysics: PhysXPhysics, uniqueID: number, material: PhysXPhysicsMaterial);
|
|
19
10
|
}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { ISphereColliderShape } from "@galacean/engine-design";
|
|
2
|
-
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
3
|
-
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
4
2
|
import { Vector3 } from "@galacean/engine";
|
|
3
|
+
import { PhysXPhysics } from "../PhysXPhysics";
|
|
4
|
+
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
5
|
+
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
5
6
|
/**
|
|
6
7
|
* Sphere collider shape in PhysX.
|
|
7
8
|
*/
|
|
8
9
|
export declare class PhysXSphereColliderShape extends PhysXColliderShape implements ISphereColliderShape {
|
|
9
10
|
private _radius;
|
|
10
11
|
private _maxScale;
|
|
11
|
-
|
|
12
|
-
* Init PhysXCollider and alloc PhysX objects.
|
|
13
|
-
* @param uniqueID - UniqueID mark collider
|
|
14
|
-
* @param radius - Size of SphereCollider
|
|
15
|
-
* @param material - Material of PhysXCollider
|
|
16
|
-
*/
|
|
17
|
-
constructor(uniqueID: number, radius: number, material: PhysXPhysicsMaterial);
|
|
12
|
+
constructor(physXPhysics: PhysXPhysics, uniqueID: number, radius: number, material: PhysXPhysicsMaterial);
|
|
18
13
|
/**
|
|
19
14
|
* {@inheritDoc ISphereColliderShape.setRadius }
|
|
20
15
|
*/
|