@galacean/engine-physics-physx 1.6.7 → 1.6.8
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 +4 -4
- package/dist/browser.js +0 -1675
- package/dist/browser.js.map +0 -1
- package/dist/browser.min.js +0 -2
- package/dist/browser.min.js.map +0 -1
- package/dist/main.js +0 -1671
- package/dist/main.js.map +0 -1
- package/dist/module.js +0 -1665
- package/dist/module.js.map +0 -1
- package/types/PhysXCharacterController.d.ts +0 -59
- package/types/PhysXCollider.d.ts +0 -36
- package/types/PhysXDynamicCollider.d.ts +0 -130
- package/types/PhysXPhysics.d.ts +0 -103
- package/types/PhysXPhysicsManager.d.ts +0 -3
- package/types/PhysXPhysicsMaterial.d.ts +0 -47
- package/types/PhysXPhysicsScene.d.ts +0 -114
- package/types/PhysXStaticCollider.d.ts +0 -11
- package/types/enum/PhysXRuntimeMode.d.ts +0 -11
- package/types/index.d.ts +0 -3
- package/types/joint/PhysXFixedJoint.d.ts +0 -10
- package/types/joint/PhysXHingeJoint.d.ts +0 -57
- package/types/joint/PhysXJoint.d.ts +0 -68
- package/types/joint/PhysXSpringJoint.d.ts +0 -30
- package/types/shape/PhysXBoxColliderShape.d.ts +0 -25
- package/types/shape/PhysXCapsuleColliderShape.d.ts +0 -42
- package/types/shape/PhysXColliderShape.d.ts +0 -68
- package/types/shape/PhysXPlaneColliderShape.d.ts +0 -10
- package/types/shape/PhysXSphereColliderShape.d.ts +0 -21
package/types/PhysXPhysics.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
2
|
-
import { IBoxColliderShape, ICapsuleColliderShape, ICharacterController, ICollision, IDynamicCollider, IFixedJoint, IHingeJoint, IPhysics, IPhysicsManager, IPhysicsMaterial, IPhysicsScene, IPlaneColliderShape, ISphereColliderShape, ISpringJoint, IStaticCollider } from "@galacean/engine-design";
|
|
3
|
-
import { PhysXCollider } from "./PhysXCollider";
|
|
4
|
-
import { PhysXPhysicsManager } from "./PhysXPhysicsManager";
|
|
5
|
-
import { PhysXPhysicsMaterial } from "./PhysXPhysicsMaterial";
|
|
6
|
-
import { PhysXRuntimeMode } from "./enum/PhysXRuntimeMode";
|
|
7
|
-
/**
|
|
8
|
-
* PhysX object creation.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PhysXPhysics implements IPhysics {
|
|
11
|
-
private _runTimeMode;
|
|
12
|
-
private _initializeState;
|
|
13
|
-
private _initializePromise;
|
|
14
|
-
private _defaultErrorCallback;
|
|
15
|
-
private _allocator;
|
|
16
|
-
private _tolerancesScale;
|
|
17
|
-
private _wasmModeUrl;
|
|
18
|
-
private _downgradeModeUrl;
|
|
19
|
-
/**
|
|
20
|
-
* Create a PhysXPhysics instance.
|
|
21
|
-
* @param runtimeMode - Runtime use WebAssembly mode or downgrade JavaScript mode, `Auto` prefers webAssembly mode if supported @see {@link PhysXRuntimeMode}
|
|
22
|
-
* @param runtimeUrls - Manually specify the `PhysXRuntimeMode.WebAssembly` mode and `PhysXRuntimeMode.JavaScript` mode URL
|
|
23
|
-
*/
|
|
24
|
-
constructor(runtimeMode?: PhysXRuntimeMode, runtimeUrls?: PhysXRuntimeUrls);
|
|
25
|
-
/**
|
|
26
|
-
* Initialize PhysXPhysics.
|
|
27
|
-
* @param runtimeMode - Runtime mode
|
|
28
|
-
* @returns Promise object
|
|
29
|
-
*/
|
|
30
|
-
initialize(): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Destroy PhysXPhysics.
|
|
33
|
-
*/
|
|
34
|
-
destroy(): void;
|
|
35
|
-
/**
|
|
36
|
-
* {@inheritDoc IPhysics.createPhysicsManager }
|
|
37
|
-
*/
|
|
38
|
-
createPhysicsManager(): IPhysicsManager;
|
|
39
|
-
/**
|
|
40
|
-
* {@inheritDoc IPhysics.createPhysicsScene }
|
|
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;
|
|
43
|
-
/**
|
|
44
|
-
* {@inheritDoc IPhysics.createStaticCollider }
|
|
45
|
-
*/
|
|
46
|
-
createStaticCollider(position: Vector3, rotation: Quaternion): IStaticCollider;
|
|
47
|
-
/**
|
|
48
|
-
* {@inheritDoc IPhysics.createDynamicCollider }
|
|
49
|
-
*/
|
|
50
|
-
createDynamicCollider(position: Vector3, rotation: Quaternion): IDynamicCollider;
|
|
51
|
-
/**
|
|
52
|
-
* {@inheritDoc IPhysics.createCharacterController }
|
|
53
|
-
*/
|
|
54
|
-
createCharacterController(): ICharacterController;
|
|
55
|
-
/**
|
|
56
|
-
* {@inheritDoc IPhysics.createPhysicsMaterial }
|
|
57
|
-
*/
|
|
58
|
-
createPhysicsMaterial(staticFriction: number, dynamicFriction: number, bounciness: number, frictionCombine: number, bounceCombine: number): IPhysicsMaterial;
|
|
59
|
-
/**
|
|
60
|
-
* {@inheritDoc IPhysics.createBoxColliderShape }
|
|
61
|
-
*/
|
|
62
|
-
createBoxColliderShape(uniqueID: number, size: Vector3, material: PhysXPhysicsMaterial): IBoxColliderShape;
|
|
63
|
-
/**
|
|
64
|
-
* {@inheritDoc IPhysics.createSphereColliderShape }
|
|
65
|
-
*/
|
|
66
|
-
createSphereColliderShape(uniqueID: number, radius: number, material: PhysXPhysicsMaterial): ISphereColliderShape;
|
|
67
|
-
/**
|
|
68
|
-
* {@inheritDoc IPhysics.createPlaneColliderShape }
|
|
69
|
-
*/
|
|
70
|
-
createPlaneColliderShape(uniqueID: number, material: PhysXPhysicsMaterial): IPlaneColliderShape;
|
|
71
|
-
/**
|
|
72
|
-
* {@inheritDoc IPhysics.createCapsuleColliderShape }
|
|
73
|
-
*/
|
|
74
|
-
createCapsuleColliderShape(uniqueID: number, radius: number, height: number, material: PhysXPhysicsMaterial): ICapsuleColliderShape;
|
|
75
|
-
/**
|
|
76
|
-
* {@inheritDoc IPhysics.createFixedJoint }
|
|
77
|
-
*/
|
|
78
|
-
createFixedJoint(collider: PhysXCollider): IFixedJoint;
|
|
79
|
-
/**
|
|
80
|
-
* {@inheritDoc IPhysics.createHingeJoint }
|
|
81
|
-
*/
|
|
82
|
-
createHingeJoint(collider: PhysXCollider): IHingeJoint;
|
|
83
|
-
/**
|
|
84
|
-
* {@inheritDoc IPhysics.createSpringJoint }
|
|
85
|
-
*/
|
|
86
|
-
createSpringJoint(collider: PhysXCollider): ISpringJoint;
|
|
87
|
-
/**
|
|
88
|
-
* {@inheritDoc IPhysics.getColliderLayerCollision }
|
|
89
|
-
*/
|
|
90
|
-
getColliderLayerCollision(layer1: number, layer2: number): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* {@inheritDoc IPhysics.setColliderLayerCollision }
|
|
93
|
-
*/
|
|
94
|
-
setColliderLayerCollision(layer1: number, layer2: number, isCollide: boolean): void;
|
|
95
|
-
private _init;
|
|
96
|
-
}
|
|
97
|
-
interface PhysXRuntimeUrls {
|
|
98
|
-
/*** The URL of `PhysXRuntimeMode.WebAssembly` mode. */
|
|
99
|
-
wasmModeUrl?: string;
|
|
100
|
-
/*** The URL of `PhysXRuntimeMode.JavaScript` mode. */
|
|
101
|
-
javaScriptModeUrl?: string;
|
|
102
|
-
}
|
|
103
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { IPhysicsMaterial } from "@galacean/engine-design";
|
|
2
|
-
import { PhysXPhysics } from "./PhysXPhysics";
|
|
3
|
-
/**
|
|
4
|
-
* Physics material describes how to handle colliding objects (friction, bounciness).
|
|
5
|
-
*/
|
|
6
|
-
export declare class PhysXPhysicsMaterial implements IPhysicsMaterial {
|
|
7
|
-
protected _physXPhysics: PhysXPhysics;
|
|
8
|
-
constructor(physXPhysics: PhysXPhysics, staticFriction: number, dynamicFriction: number, bounciness: number, frictionCombine: CombineMode, bounceCombine: CombineMode);
|
|
9
|
-
/**
|
|
10
|
-
* {@inheritDoc IPhysicsMaterial.setBounciness }
|
|
11
|
-
*/
|
|
12
|
-
setBounciness(value: number): void;
|
|
13
|
-
/**
|
|
14
|
-
* {@inheritDoc IPhysicsMaterial.setDynamicFriction }
|
|
15
|
-
*/
|
|
16
|
-
setDynamicFriction(value: number): void;
|
|
17
|
-
/**
|
|
18
|
-
* {@inheritDoc IPhysicsMaterial.setStaticFriction }
|
|
19
|
-
*/
|
|
20
|
-
setStaticFriction(value: number): void;
|
|
21
|
-
/**
|
|
22
|
-
* {@inheritDoc IPhysicsMaterial.setBounceCombine }
|
|
23
|
-
*/
|
|
24
|
-
setBounceCombine(value: CombineMode): void;
|
|
25
|
-
/**
|
|
26
|
-
* {@inheritDoc IPhysicsMaterial.setFrictionCombine }
|
|
27
|
-
*/
|
|
28
|
-
setFrictionCombine(value: CombineMode): void;
|
|
29
|
-
/**
|
|
30
|
-
* {@inheritDoc IPhysicsMaterial.destroy }
|
|
31
|
-
*/
|
|
32
|
-
destroy(): void;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Describes how physics materials of the colliding objects are combined.
|
|
36
|
-
*/
|
|
37
|
-
declare enum CombineMode {
|
|
38
|
-
/** Averages the friction/bounce of the two colliding materials. */
|
|
39
|
-
Average = 0,
|
|
40
|
-
/** Uses the smaller friction/bounce of the two colliding materials. */
|
|
41
|
-
Minimum = 1,
|
|
42
|
-
/** Multiplies the friction/bounce of the two colliding materials. */
|
|
43
|
-
Multiply = 2,
|
|
44
|
-
/** Uses the larger friction/bounce of the two colliding materials. */
|
|
45
|
-
Maximum = 3
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { Ray, Vector3, Quaternion } from "@galacean/engine";
|
|
2
|
-
import { ICollision, IPhysicsScene } from "@galacean/engine-design";
|
|
3
|
-
import { PhysXCharacterController } from "./PhysXCharacterController";
|
|
4
|
-
import { PhysXCollider } from "./PhysXCollider";
|
|
5
|
-
import { PhysXPhysics } from "./PhysXPhysics";
|
|
6
|
-
import { PhysXPhysicsManager } from "./PhysXPhysicsManager";
|
|
7
|
-
/**
|
|
8
|
-
* A manager is a collection of colliders and constraints which can interact.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PhysXPhysicsScene implements IPhysicsScene {
|
|
11
|
-
private static _tempPosition;
|
|
12
|
-
private static _tempQuaternion;
|
|
13
|
-
private static _tempNormal;
|
|
14
|
-
private static _tempPose;
|
|
15
|
-
private static _tempShapeIDs;
|
|
16
|
-
private _boxGeometry;
|
|
17
|
-
private _sphereGeometry;
|
|
18
|
-
private _capsuleGeometry;
|
|
19
|
-
private _physXPhysics;
|
|
20
|
-
private _physXManager;
|
|
21
|
-
private _pxRaycastHit;
|
|
22
|
-
private _pxFilterData;
|
|
23
|
-
private _pxScene;
|
|
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);
|
|
34
|
-
/**
|
|
35
|
-
* {@inheritDoc IPhysicsScene.setGravity }
|
|
36
|
-
*/
|
|
37
|
-
setGravity(value: Vector3): void;
|
|
38
|
-
/**
|
|
39
|
-
* {@inheritDoc IPhysicsScene.addCollider }
|
|
40
|
-
*/
|
|
41
|
-
addCollider(collider: PhysXCollider): void;
|
|
42
|
-
/**
|
|
43
|
-
* {@inheritDoc IPhysicsScene.removeCollider }
|
|
44
|
-
*/
|
|
45
|
-
removeCollider(collider: PhysXCollider): void;
|
|
46
|
-
/**
|
|
47
|
-
* {@inheritDoc IPhysicsScene.addCharacterController }
|
|
48
|
-
*/
|
|
49
|
-
addCharacterController(characterController: PhysXCharacterController): void;
|
|
50
|
-
/**
|
|
51
|
-
* {@inheritDoc IPhysicsScene.removeCharacterController }
|
|
52
|
-
*/
|
|
53
|
-
removeCharacterController(characterController: PhysXCharacterController): void;
|
|
54
|
-
/**
|
|
55
|
-
* {@inheritDoc IPhysicsScene.update }
|
|
56
|
-
*/
|
|
57
|
-
update(elapsedTime: number): void;
|
|
58
|
-
/**
|
|
59
|
-
* {@inheritDoc IPhysicsScene.raycast }
|
|
60
|
-
*/
|
|
61
|
-
raycast(ray: Ray, distance: number, onRaycast: (obj: number) => boolean, hit?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* {@inheritDoc IPhysicsScene.boxCast }
|
|
64
|
-
*/
|
|
65
|
-
boxCast(center: Vector3, orientation: Quaternion, halfExtents: Vector3, direction: Vector3, distance: number, onSweep: (obj: number) => boolean, outHitResult?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* {@inheritDoc IPhysicsScene.sphereCast }
|
|
68
|
-
*/
|
|
69
|
-
sphereCast(center: Vector3, radius: number, direction: Vector3, distance: number, onSweep: (obj: number) => boolean, outHitResult?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* {@inheritDoc IPhysicsScene.capsuleCast }
|
|
72
|
-
*/
|
|
73
|
-
capsuleCast(center: Vector3, radius: number, height: number, orientation: Quaternion, direction: Vector3, distance: number, onSweep: (obj: number) => boolean, outHitResult?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* {@inheritDoc IPhysicsScene.overlapBoxAll }
|
|
76
|
-
*/
|
|
77
|
-
overlapBoxAll(center: Vector3, orientation: Quaternion, halfExtents: Vector3, onOverlap: (obj: number) => boolean): number[];
|
|
78
|
-
/**
|
|
79
|
-
* {@inheritDoc IPhysicsScene.overlapSphereAll }
|
|
80
|
-
*/
|
|
81
|
-
overlapSphereAll(center: Vector3, radius: number, onOverlap: (obj: number) => boolean): number[];
|
|
82
|
-
/**
|
|
83
|
-
* {@inheritDoc IPhysicsScene.overlapCapsuleAll }
|
|
84
|
-
*/
|
|
85
|
-
overlapCapsuleAll(center: Vector3, radius: number, height: number, orientation: Quaternion, onOverlap: (obj: number) => boolean): number[];
|
|
86
|
-
/**
|
|
87
|
-
* {@inheritDoc IPhysicsScene.destroy }
|
|
88
|
-
*/
|
|
89
|
-
destroy(): void;
|
|
90
|
-
private _sweepSingle;
|
|
91
|
-
private _overlapMultiple;
|
|
92
|
-
private _simulate;
|
|
93
|
-
private _fetchResults;
|
|
94
|
-
private _getTrigger;
|
|
95
|
-
private _fireEvent;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Physics state
|
|
99
|
-
*/
|
|
100
|
-
declare enum TriggerEventState {
|
|
101
|
-
Enter = 0,
|
|
102
|
-
Stay = 1,
|
|
103
|
-
Exit = 2
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Trigger event to store interactive object ids and state.
|
|
107
|
-
*/
|
|
108
|
-
export declare class TriggerEvent {
|
|
109
|
-
state: TriggerEventState;
|
|
110
|
-
index1: number;
|
|
111
|
-
index2: number;
|
|
112
|
-
constructor(index1: number, index2: number);
|
|
113
|
-
}
|
|
114
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IStaticCollider } from "@galacean/engine-design";
|
|
2
|
-
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
|
-
import { PhysXCollider } from "./PhysXCollider";
|
|
4
|
-
import { PhysXPhysics } from "./PhysXPhysics";
|
|
5
|
-
/**
|
|
6
|
-
* A static collider component that will not move.
|
|
7
|
-
* @remarks Mostly used for object which always stays at the same place and never moves around.
|
|
8
|
-
*/
|
|
9
|
-
export declare class PhysXStaticCollider extends PhysXCollider implements IStaticCollider {
|
|
10
|
-
constructor(physXPhysics: PhysXPhysics, position: Vector3, rotation: Quaternion);
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PhysX runtime mode.
|
|
3
|
-
*/
|
|
4
|
-
export declare enum PhysXRuntimeMode {
|
|
5
|
-
/** Use webAssembly mode first, if WebAssembly mode is not supported, roll back to JavaScript mode. */
|
|
6
|
-
Auto = 0,
|
|
7
|
-
/** WebAssembly mode. */
|
|
8
|
-
WebAssembly = 1,
|
|
9
|
-
/** JavaScript mode. */
|
|
10
|
-
JavaScript = 2
|
|
11
|
-
}
|
package/types/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IFixedJoint } from "@galacean/engine-design";
|
|
2
|
-
import { PhysXCollider } from "../PhysXCollider";
|
|
3
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
4
|
-
import { PhysXJoint } from "./PhysXJoint";
|
|
5
|
-
/**
|
|
6
|
-
* A fixed joint permits no relative movement between two colliders. ie the bodies are glued together.
|
|
7
|
-
*/
|
|
8
|
-
export declare class PhysXFixedJoint extends PhysXJoint implements IFixedJoint {
|
|
9
|
-
constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider);
|
|
10
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { IHingeJoint } from "@galacean/engine-design";
|
|
2
|
-
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
|
-
import { PhysXCollider } from "../PhysXCollider";
|
|
4
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
5
|
-
import { PhysXJoint } from "./PhysXJoint";
|
|
6
|
-
/**
|
|
7
|
-
* A joint which behaves in a similar way to a hinge or axle.
|
|
8
|
-
*/
|
|
9
|
-
export declare class PhysXHingeJoint extends PhysXJoint implements IHingeJoint {
|
|
10
|
-
protected static _xAxis: Vector3;
|
|
11
|
-
private _axis;
|
|
12
|
-
private _axisRotationQuaternion;
|
|
13
|
-
private _connectedAxisRotationQuaternion;
|
|
14
|
-
constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider);
|
|
15
|
-
setRotation(value: Quaternion): void;
|
|
16
|
-
/**
|
|
17
|
-
* {@inheritDoc IHingeJoint.setAxis }
|
|
18
|
-
*/
|
|
19
|
-
setAxis(value: Vector3): void;
|
|
20
|
-
setAnchor(value: Vector3): void;
|
|
21
|
-
/**
|
|
22
|
-
* {@inheritDoc IJoint.setConnectedAnchor }
|
|
23
|
-
*/
|
|
24
|
-
setConnectedAnchor(value: Vector3): void;
|
|
25
|
-
/**
|
|
26
|
-
* {@inheritDoc IHingeJoint.getAngle }
|
|
27
|
-
*/
|
|
28
|
-
getAngle(): number;
|
|
29
|
-
/**
|
|
30
|
-
* {@inheritDoc IHingeJoint.getVelocity }
|
|
31
|
-
*/
|
|
32
|
-
getVelocity(): Readonly<number>;
|
|
33
|
-
/**
|
|
34
|
-
* {@inheritDoc IHingeJoint.setHardLimitCone }
|
|
35
|
-
*/
|
|
36
|
-
setHardLimit(lowerLimit: number, upperLimit: number, contactDist: number): void;
|
|
37
|
-
/**
|
|
38
|
-
* {@inheritDoc IHingeJoint.setHardLimitCone }
|
|
39
|
-
*/
|
|
40
|
-
setSoftLimit(lowerLimit: number, upperLimit: number, stiffness: number, damping: number): void;
|
|
41
|
-
/**
|
|
42
|
-
* {@inheritDoc IHingeJoint.setDriveVelocity }
|
|
43
|
-
*/
|
|
44
|
-
setDriveVelocity(velocity: number, autowake?: boolean): void;
|
|
45
|
-
/**
|
|
46
|
-
* {@inheritDoc IHingeJoint.setDriveForceLimit }
|
|
47
|
-
*/
|
|
48
|
-
setDriveForceLimit(limit: number): void;
|
|
49
|
-
/**
|
|
50
|
-
* {@inheritDoc IHingeJoint.setDriveGearRatio }
|
|
51
|
-
*/
|
|
52
|
-
setDriveGearRatio(ratio: number): void;
|
|
53
|
-
/**
|
|
54
|
-
* {@inheritDoc IHingeJoint.setHingeJointFlag }
|
|
55
|
-
*/
|
|
56
|
-
setHingeJointFlag(flag: number, value: boolean): void;
|
|
57
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { IJoint } from "@galacean/engine-design";
|
|
2
|
-
import { Quaternion, Vector3 } from "@galacean/engine";
|
|
3
|
-
import { PhysXCollider } from "../PhysXCollider";
|
|
4
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
5
|
-
/**
|
|
6
|
-
* a base interface providing common functionality for PhysX joints
|
|
7
|
-
*/
|
|
8
|
-
export declare class PhysXJoint implements IJoint {
|
|
9
|
-
protected static _defaultVec: Vector3;
|
|
10
|
-
protected static _defaultQuat: Quaternion;
|
|
11
|
-
protected _pxJoint: any;
|
|
12
|
-
protected _anchor: Vector3;
|
|
13
|
-
protected _connectedAnchor: Vector3;
|
|
14
|
-
protected _rotation: Quaternion;
|
|
15
|
-
protected _collider: PhysXCollider;
|
|
16
|
-
private _breakForce;
|
|
17
|
-
private _breakTorque;
|
|
18
|
-
protected _physXPhysics: PhysXPhysics;
|
|
19
|
-
constructor(physXPhysics: PhysXPhysics);
|
|
20
|
-
/**
|
|
21
|
-
* {@inheritDoc IJoint.setConnectedCollider }
|
|
22
|
-
*/
|
|
23
|
-
setConnectedCollider(value: PhysXCollider): void;
|
|
24
|
-
/**
|
|
25
|
-
* {@inheritDoc IJoint.setConnectedAnchor }
|
|
26
|
-
*/
|
|
27
|
-
setAnchor(value: Vector3): void;
|
|
28
|
-
/**
|
|
29
|
-
* {@inheritDoc IJoint.setConnectedAnchor }
|
|
30
|
-
*/
|
|
31
|
-
setConnectedAnchor(value: Vector3): void;
|
|
32
|
-
setRotation(value: Quaternion): void;
|
|
33
|
-
/**
|
|
34
|
-
* {@inheritDoc IJoint.setMassScale }
|
|
35
|
-
*/
|
|
36
|
-
setMassScale(value: number): void;
|
|
37
|
-
/**
|
|
38
|
-
* {@inheritDoc IJoint.setConnectedMassScale }
|
|
39
|
-
*/
|
|
40
|
-
setConnectedMassScale(value: number): void;
|
|
41
|
-
/**
|
|
42
|
-
* {@inheritDoc IJoint.setInertiaScale }
|
|
43
|
-
*/
|
|
44
|
-
setInertiaScale(value: number): void;
|
|
45
|
-
/**
|
|
46
|
-
* {@inheritDoc IJoint.setConnectedInertiaScale }
|
|
47
|
-
*/
|
|
48
|
-
setConnectedInertiaScale(value: number): void;
|
|
49
|
-
/**
|
|
50
|
-
* {@inheritDoc IJoint.setBreakForce }
|
|
51
|
-
*/
|
|
52
|
-
setBreakForce(value: number): void;
|
|
53
|
-
/**
|
|
54
|
-
* {@inheritDoc IJoint.setBreakTorque }
|
|
55
|
-
*/
|
|
56
|
-
setBreakTorque(value: number): void;
|
|
57
|
-
/**
|
|
58
|
-
* {@inheritDoc IJoint.destroy }
|
|
59
|
-
*/
|
|
60
|
-
destroy(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Set the joint local pose for an actor.
|
|
63
|
-
* @param actor 0 for the first actor, 1 for the second actor.
|
|
64
|
-
* @param position the local position for the actor this joint
|
|
65
|
-
* @param rotation the local rotation for the actor this joint
|
|
66
|
-
*/
|
|
67
|
-
protected _setLocalPose(actor: number, position: Vector3, rotation: Quaternion): void;
|
|
68
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
2
|
-
import { PhysXJoint } from "./PhysXJoint";
|
|
3
|
-
import { ISpringJoint } from "@galacean/engine-design";
|
|
4
|
-
import { PhysXCollider } from "../PhysXCollider";
|
|
5
|
-
/**
|
|
6
|
-
* a joint that maintains an upper or lower bound (or both) on the distance between two points on different objects
|
|
7
|
-
*/
|
|
8
|
-
export declare class PhysXSpringJoint extends PhysXJoint implements ISpringJoint {
|
|
9
|
-
constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider);
|
|
10
|
-
/**
|
|
11
|
-
* {@inheritDoc ISpringJoint.setMinDistance }
|
|
12
|
-
*/
|
|
13
|
-
setMinDistance(distance: number): void;
|
|
14
|
-
/**
|
|
15
|
-
* {@inheritDoc ISpringJoint.setMaxDistance }
|
|
16
|
-
*/
|
|
17
|
-
setMaxDistance(distance: number): void;
|
|
18
|
-
/**
|
|
19
|
-
* {@inheritDoc ISpringJoint.setTolerance }
|
|
20
|
-
*/
|
|
21
|
-
setTolerance(tolerance: number): void;
|
|
22
|
-
/**
|
|
23
|
-
* {@inheritDoc ISpringJoint.setStiffness }
|
|
24
|
-
*/
|
|
25
|
-
setStiffness(stiffness: number): void;
|
|
26
|
-
/**
|
|
27
|
-
* {@inheritDoc ISpringJoint.setDamping }
|
|
28
|
-
*/
|
|
29
|
-
setDamping(damping: number): void;
|
|
30
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Vector3 } from "@galacean/engine";
|
|
2
|
-
import { IBoxColliderShape } from "@galacean/engine-design";
|
|
3
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
4
|
-
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
5
|
-
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
6
|
-
/**
|
|
7
|
-
* Box collider shape in PhysX.
|
|
8
|
-
*/
|
|
9
|
-
export declare class PhysXBoxColliderShape extends PhysXColliderShape implements IBoxColliderShape {
|
|
10
|
-
private static _tempHalfExtents;
|
|
11
|
-
constructor(physXPhysics: PhysXPhysics, uniqueID: number, size: Vector3, material: PhysXPhysicsMaterial);
|
|
12
|
-
/**
|
|
13
|
-
* {@inheritDoc IBoxColliderShape.setSize }
|
|
14
|
-
*/
|
|
15
|
-
setSize(value: Vector3): void;
|
|
16
|
-
/**
|
|
17
|
-
* {@inheritDoc IColliderShape.setRotation }
|
|
18
|
-
*/
|
|
19
|
-
setRotation(value: Vector3): void;
|
|
20
|
-
/**
|
|
21
|
-
* {@inheritDoc IColliderShape.setWorldScale }
|
|
22
|
-
*/
|
|
23
|
-
setWorldScale(scale: Vector3): void;
|
|
24
|
-
private _updateController;
|
|
25
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ICapsuleColliderShape } from "@galacean/engine-design";
|
|
2
|
-
import { Vector3 } from "@galacean/engine";
|
|
3
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
4
|
-
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
5
|
-
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
6
|
-
/**
|
|
7
|
-
* Capsule collider shape in PhysX.
|
|
8
|
-
*/
|
|
9
|
-
export declare class PhysXCapsuleColliderShape extends PhysXColliderShape implements ICapsuleColliderShape {
|
|
10
|
-
constructor(physXPhysics: PhysXPhysics, uniqueID: number, radius: number, height: number, material: PhysXPhysicsMaterial);
|
|
11
|
-
/**
|
|
12
|
-
* {@inheritDoc ICapsuleColliderShape.setRadius }
|
|
13
|
-
*/
|
|
14
|
-
setRadius(value: number): void;
|
|
15
|
-
/**
|
|
16
|
-
* {@inheritDoc ICapsuleColliderShape.setHeight }
|
|
17
|
-
*/
|
|
18
|
-
setHeight(value: number): void;
|
|
19
|
-
/**
|
|
20
|
-
* {@inheritDoc ICapsuleColliderShape.setRotation }
|
|
21
|
-
*/
|
|
22
|
-
setRotation(value: Vector3): void;
|
|
23
|
-
/**
|
|
24
|
-
* {@inheritDoc ICapsuleColliderShape.setUpAxis }
|
|
25
|
-
*/
|
|
26
|
-
setUpAxis(upAxis: ColliderShapeUpAxis): void;
|
|
27
|
-
/**
|
|
28
|
-
* {@inheritDoc IColliderShape.setWorldScale }
|
|
29
|
-
*/
|
|
30
|
-
setWorldScale(scale: Vector3): void;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The up axis of the collider shape.
|
|
34
|
-
*/
|
|
35
|
-
export declare enum ColliderShapeUpAxis {
|
|
36
|
-
/** Up axis is X. */
|
|
37
|
-
X = 0,
|
|
38
|
-
/** Up axis is Y. */
|
|
39
|
-
Y = 1,
|
|
40
|
-
/** Up axis is Z. */
|
|
41
|
-
Z = 2
|
|
42
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Quaternion, Vector3, Vector4 } from "@galacean/engine";
|
|
2
|
-
import { IColliderShape } from "@galacean/engine-design";
|
|
3
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
4
|
-
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
5
|
-
/**
|
|
6
|
-
* Flags which affect the behavior of Shapes.
|
|
7
|
-
*/
|
|
8
|
-
export declare enum ShapeFlag {
|
|
9
|
-
/** The shape will partake in collision in the physical simulation. */
|
|
10
|
-
SIMULATION_SHAPE = 1,
|
|
11
|
-
/** The shape will partake in scene queries (ray casts, overlap tests, sweeps, ...). */
|
|
12
|
-
SCENE_QUERY_SHAPE = 2,
|
|
13
|
-
/** The shape is a trigger which can send reports whenever other shapes enter/leave its volume. */
|
|
14
|
-
TRIGGER_SHAPE = 4
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Abstract class for collider shapes.
|
|
18
|
-
*/
|
|
19
|
-
export declare abstract class PhysXColliderShape implements IColliderShape {
|
|
20
|
-
static readonly halfSqrt: number;
|
|
21
|
-
static transform: {
|
|
22
|
-
translation: Vector3;
|
|
23
|
-
rotation: any;
|
|
24
|
-
};
|
|
25
|
-
protected static _tempVector4: Vector4;
|
|
26
|
-
protected _physXPhysics: PhysXPhysics;
|
|
27
|
-
protected _pxGeometry: any;
|
|
28
|
-
protected _axis: Quaternion;
|
|
29
|
-
protected _physXRotation: Quaternion;
|
|
30
|
-
private _shapeFlags;
|
|
31
|
-
constructor(physXPhysics: PhysXPhysics);
|
|
32
|
-
/**
|
|
33
|
-
* {@inheritDoc IColliderShape.setRotation }
|
|
34
|
-
*/
|
|
35
|
-
setRotation(value: Vector3): void;
|
|
36
|
-
/**
|
|
37
|
-
* {@inheritDoc IColliderShape.setPosition }
|
|
38
|
-
*/
|
|
39
|
-
setPosition(value: Vector3): void;
|
|
40
|
-
/**
|
|
41
|
-
* {@inheritDoc IColliderShape.setWorldScale }
|
|
42
|
-
*/
|
|
43
|
-
setWorldScale(scale: Vector3): void;
|
|
44
|
-
/**
|
|
45
|
-
* {@inheritDoc IColliderShape.setContactOffset }
|
|
46
|
-
* @default 0.02f * PxTolerancesScale::length
|
|
47
|
-
*/
|
|
48
|
-
setContactOffset(offset: number): void;
|
|
49
|
-
/**
|
|
50
|
-
* {@inheritDoc IColliderShape.setMaterial }
|
|
51
|
-
*/
|
|
52
|
-
setMaterial(value: PhysXPhysicsMaterial): void;
|
|
53
|
-
/**
|
|
54
|
-
* {@inheritDoc IColliderShape.setIsTrigger }
|
|
55
|
-
*/
|
|
56
|
-
setIsTrigger(value: boolean): void;
|
|
57
|
-
/**
|
|
58
|
-
* {@inheritDoc IColliderShape.pointDistance }
|
|
59
|
-
*/
|
|
60
|
-
pointDistance(point: Vector3): Vector4;
|
|
61
|
-
/**
|
|
62
|
-
* {@inheritDoc IColliderShape.destroy }
|
|
63
|
-
*/
|
|
64
|
-
destroy(): void;
|
|
65
|
-
protected _setLocalPose(): void;
|
|
66
|
-
protected _initialize(material: PhysXPhysicsMaterial, id: number): void;
|
|
67
|
-
private _modifyFlag;
|
|
68
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IPlaneColliderShape } from "@galacean/engine-design";
|
|
2
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
3
|
-
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
4
|
-
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
5
|
-
/**
|
|
6
|
-
* Plane collider shape in PhysX.
|
|
7
|
-
*/
|
|
8
|
-
export declare class PhysXPlaneColliderShape extends PhysXColliderShape implements IPlaneColliderShape {
|
|
9
|
-
constructor(physXPhysics: PhysXPhysics, uniqueID: number, material: PhysXPhysicsMaterial);
|
|
10
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Vector3 } from "@galacean/engine";
|
|
2
|
-
import { ISphereColliderShape } from "@galacean/engine-design";
|
|
3
|
-
import { PhysXPhysics } from "../PhysXPhysics";
|
|
4
|
-
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
|
|
5
|
-
import { PhysXColliderShape } from "./PhysXColliderShape";
|
|
6
|
-
/**
|
|
7
|
-
* Sphere collider shape in PhysX.
|
|
8
|
-
*/
|
|
9
|
-
export declare class PhysXSphereColliderShape extends PhysXColliderShape implements ISphereColliderShape {
|
|
10
|
-
private _radius;
|
|
11
|
-
private _maxScale;
|
|
12
|
-
constructor(physXPhysics: PhysXPhysics, uniqueID: number, radius: number, material: PhysXPhysicsMaterial);
|
|
13
|
-
/**
|
|
14
|
-
* {@inheritDoc ISphereColliderShape.setRadius }
|
|
15
|
-
*/
|
|
16
|
-
setRadius(value: number): void;
|
|
17
|
-
/**
|
|
18
|
-
* {@inheritDoc IColliderShape.setWorldScale }
|
|
19
|
-
*/
|
|
20
|
-
setWorldScale(scale: Vector3): void;
|
|
21
|
-
}
|