@galacean/engine-physics-physx 0.9.0-beta.80

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 ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@galacean/engine-physics-physx",
3
+ "version": "0.9.0-beta.80",
4
+ "publishConfig": {
5
+ "access": "public",
6
+ "registry": "https://registry.npmjs.org"
7
+ },
8
+ "license": "MIT",
9
+ "main": "dist/main.js",
10
+ "module": "dist/module.js",
11
+ "debug": "src/index.ts",
12
+ "browser": "dist/browser.js",
13
+ "types": "types/index.d.ts",
14
+ "files": [
15
+ "dist/**/*",
16
+ "libs/**/*",
17
+ "types/**/*"
18
+ ],
19
+ "devDependencies": {
20
+ "@galacean/engine": "0.9.0-beta.80",
21
+ "@galacean/engine-design": "0.9.0-beta.80"
22
+ },
23
+ "peerDependencies": {
24
+ "@galacean/engine": "0.9.0-beta.80"
25
+ },
26
+ "scripts": {
27
+ "b:types": "tsc"
28
+ }
29
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * High-performance unordered array, delete uses exchange method to improve performance, internal capacity only increases.
3
+ */
4
+ export declare class DisorderedArray<T> {
5
+ _elements: T[];
6
+ length: number;
7
+ constructor(count?: number);
8
+ add(element: T): void;
9
+ delete(element: T): void;
10
+ get(index: number): T;
11
+ /**
12
+ *
13
+ * @param index
14
+ * @returns The replaced item is used to reset its index.
15
+ */
16
+ deleteByIndex(index: number): T;
17
+ garbageCollection(): void;
18
+ }
@@ -0,0 +1,48 @@
1
+ import { ICharacterController } from "@galacean/engine-design";
2
+ import { Vector3 } from "@galacean/engine";
3
+ import { PhysXColliderShape } from "./shape/PhysXColliderShape";
4
+ /**
5
+ * Base class for character controllers.
6
+ */
7
+ export declare class PhysXCharacterController implements ICharacterController {
8
+ /**
9
+ * {@inheritDoc ICharacterController.move }
10
+ */
11
+ move(disp: Vector3, minDist: number, elapsedTime: number): number;
12
+ /**
13
+ * {@inheritDoc ICharacterController.setWorldPosition }
14
+ */
15
+ setWorldPosition(position: Vector3): void;
16
+ /**
17
+ * {@inheritDoc ICharacterController.getWorldPosition }
18
+ */
19
+ getWorldPosition(position: Vector3): void;
20
+ /**
21
+ * {@inheritDoc ICharacterController.setStepOffset }
22
+ */
23
+ setStepOffset(offset: number): void;
24
+ /**
25
+ * {@inheritDoc ICharacterController.setNonWalkableMode }
26
+ */
27
+ setNonWalkableMode(flag: number): void;
28
+ /**
29
+ * {@inheritDoc ICharacterController.setUpDirection }
30
+ */
31
+ setUpDirection(up: Vector3): void;
32
+ /**
33
+ * {@inheritDoc ICharacterController.setSlopeLimit }
34
+ */
35
+ setSlopeLimit(slopeLimit: number): void;
36
+ /**
37
+ * {@inheritDoc ICharacterController.addShape }
38
+ */
39
+ addShape(shape: PhysXColliderShape): void;
40
+ /**
41
+ * {@inheritDoc ICharacterController.removeShape }
42
+ */
43
+ removeShape(shape: PhysXColliderShape): void;
44
+ /**
45
+ * {@inheritDoc ICharacterController.destroy }
46
+ */
47
+ destroy(): void;
48
+ }
@@ -0,0 +1,29 @@
1
+ import { ICollider } from "@galacean/engine-design";
2
+ import { Quaternion, Vector3 } from "@galacean/engine";
3
+ import { PhysXColliderShape } from "./shape/PhysXColliderShape";
4
+ /**
5
+ * Abstract class of physical collider.
6
+ */
7
+ export declare abstract class PhysXCollider implements ICollider {
8
+ private static _tempTransform;
9
+ /**
10
+ * {@inheritDoc ICollider.addShape }
11
+ */
12
+ addShape(shape: PhysXColliderShape): void;
13
+ /**
14
+ * {@inheritDoc ICollider.removeShape }
15
+ */
16
+ removeShape(shape: PhysXColliderShape): void;
17
+ /**
18
+ * {@inheritDoc ICollider.setWorldTransform }
19
+ */
20
+ setWorldTransform(position: Vector3, rotation: Quaternion): void;
21
+ /**
22
+ * {@inheritDoc ICollider.getWorldTransform }
23
+ */
24
+ getWorldTransform(outPosition: Vector3, outRotation: Quaternion): void;
25
+ /**
26
+ * {@inheritDoc ICollider.destroy }
27
+ */
28
+ destroy(): void;
29
+ }
@@ -0,0 +1,101 @@
1
+ import { IDynamicCollider } from "@galacean/engine-design";
2
+ import { Quaternion, Vector3 } from "@galacean/engine";
3
+ import { PhysXCollider } from "./PhysXCollider";
4
+ /**
5
+ * The collision detection mode constants used for PhysXDynamicCollider.collisionDetectionMode.
6
+ * */
7
+ export declare enum CollisionDetectionMode {
8
+ /** Continuous collision detection is off for this dynamic collider. */
9
+ Discrete = 0,
10
+ /** Continuous collision detection is on for colliding with static mesh geometry. */
11
+ Continuous = 1,
12
+ /** Continuous collision detection is on for colliding with static and dynamic geometry. */
13
+ ContinuousDynamic = 2,
14
+ /** Speculative continuous collision detection is on for static and dynamic geometries */
15
+ ContinuousSpeculative = 3
16
+ }
17
+ /**
18
+ * A dynamic collider can act with self-defined movement or physical force
19
+ */
20
+ export declare class PhysXDynamicCollider extends PhysXCollider implements IDynamicCollider {
21
+ private static _tempTranslation;
22
+ private static _tempRotation;
23
+ constructor(position: Vector3, rotation: Quaternion);
24
+ /**
25
+ * {@inheritDoc IDynamicCollider.setLinearDamping }
26
+ */
27
+ setLinearDamping(value: number): void;
28
+ /**
29
+ * {@inheritDoc IDynamicCollider.setAngularDamping }
30
+ */
31
+ setAngularDamping(value: number): void;
32
+ /**
33
+ * {@inheritDoc IDynamicCollider.setLinearVelocity }
34
+ */
35
+ setLinearVelocity(value: Vector3): void;
36
+ /**
37
+ * {@inheritDoc IDynamicCollider.setAngularVelocity }
38
+ */
39
+ setAngularVelocity(value: Vector3): void;
40
+ /**
41
+ * {@inheritDoc IDynamicCollider.setMass }
42
+ */
43
+ setMass(value: number): void;
44
+ /**
45
+ * {@inheritDoc IDynamicCollider.setCenterOfMass }
46
+ */
47
+ setCenterOfMass(position: Vector3): void;
48
+ /**
49
+ * {@inheritDoc IDynamicCollider.setInertiaTensor }
50
+ */
51
+ setInertiaTensor(value: Vector3): void;
52
+ /**
53
+ * {@inheritDoc IDynamicCollider.setMaxAngularVelocity }
54
+ */
55
+ setMaxAngularVelocity(value: number): void;
56
+ /**
57
+ * {@inheritDoc IDynamicCollider.setMaxDepenetrationVelocity }
58
+ */
59
+ setMaxDepenetrationVelocity(value: number): void;
60
+ /**
61
+ * {@inheritDoc IDynamicCollider.setSleepThreshold }
62
+ * @default 1e-5f * PxTolerancesScale::speed * PxTolerancesScale::speed
63
+ */
64
+ setSleepThreshold(value: number): void;
65
+ /**
66
+ * {@inheritDoc IDynamicCollider.setSolverIterations }
67
+ */
68
+ setSolverIterations(value: number): void;
69
+ /**
70
+ * {@inheritDoc IDynamicCollider.setCollisionDetectionMode }
71
+ */
72
+ setCollisionDetectionMode(value: number): void;
73
+ /**
74
+ * {@inheritDoc IDynamicCollider.setIsKinematic }
75
+ */
76
+ setIsKinematic(value: boolean): void;
77
+ /**
78
+ * {@inheritDoc IDynamicCollider.setConstraints }
79
+ */
80
+ setConstraints(flags: number): void;
81
+ /**
82
+ * {@inheritDoc IDynamicCollider.addForce }
83
+ */
84
+ addForce(force: Vector3): void;
85
+ /**
86
+ * {@inheritDoc IDynamicCollider.addTorque }
87
+ */
88
+ addTorque(torque: Vector3): void;
89
+ /**
90
+ * {@inheritDoc IDynamicCollider.move }
91
+ */
92
+ move(positionOrRotation: Vector3 | Quaternion, rotation?: Quaternion): void;
93
+ /**
94
+ * {@inheritDoc IDynamicCollider.sleep }
95
+ */
96
+ sleep(): void;
97
+ /**
98
+ * {@inheritDoc IDynamicCollider.wakeUp }
99
+ */
100
+ wakeUp(): void;
101
+ }
@@ -0,0 +1,69 @@
1
+ import { IBoxColliderShape, ICapsuleColliderShape, ICharacterController, IDynamicCollider, IFixedJoint, IHingeJoint, IPhysicsManager, IPhysicsMaterial, IPlaneColliderShape, ISphereColliderShape, ISpringJoint, IStaticCollider } from "@galacean/engine-design";
2
+ import { Quaternion, Vector3 } from "@galacean/engine";
3
+ import { PhysXRuntimeMode } from "./enum/PhysXRuntimeMode";
4
+ import { PhysXCollider } from "./PhysXCollider";
5
+ import { PhysXPhysicsMaterial } from "./PhysXPhysicsMaterial";
6
+ /**
7
+ * PhysX object creation.
8
+ */
9
+ export declare class PhysXPhysics {
10
+ /**
11
+ * Initialize PhysXPhysics.
12
+ * @param runtimeMode - Runtime mode
13
+ * @returns Promise object
14
+ */
15
+ static initialize(runtimeMode?: PhysXRuntimeMode): Promise<void>;
16
+ /**
17
+ * Destroy PhysXPhysics.
18
+ */
19
+ static destroy(): void;
20
+ /**
21
+ * {@inheritDoc IPhysics.createPhysicsManager }
22
+ */
23
+ static 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
+ /**
25
+ * {@inheritDoc IPhysics.createStaticCollider }
26
+ */
27
+ static createStaticCollider(position: Vector3, rotation: Quaternion): IStaticCollider;
28
+ /**
29
+ * {@inheritDoc IPhysics.createDynamicCollider }
30
+ */
31
+ static createDynamicCollider(position: Vector3, rotation: Quaternion): IDynamicCollider;
32
+ /**
33
+ * {@inheritDoc IPhysics.createCharacterController }
34
+ */
35
+ static createCharacterController(): ICharacterController;
36
+ /**
37
+ * {@inheritDoc IPhysics.createPhysicsMaterial }
38
+ */
39
+ static createPhysicsMaterial(staticFriction: number, dynamicFriction: number, bounciness: number, frictionCombine: number, bounceCombine: number): IPhysicsMaterial;
40
+ /**
41
+ * {@inheritDoc IPhysics.createBoxColliderShape }
42
+ */
43
+ static createBoxColliderShape(uniqueID: number, size: Vector3, material: PhysXPhysicsMaterial): IBoxColliderShape;
44
+ /**
45
+ * {@inheritDoc IPhysics.createSphereColliderShape }
46
+ */
47
+ static createSphereColliderShape(uniqueID: number, radius: number, material: PhysXPhysicsMaterial): ISphereColliderShape;
48
+ /**
49
+ * {@inheritDoc IPhysics.createPlaneColliderShape }
50
+ */
51
+ static createPlaneColliderShape(uniqueID: number, material: PhysXPhysicsMaterial): IPlaneColliderShape;
52
+ /**
53
+ * {@inheritDoc IPhysics.createCapsuleColliderShape }
54
+ */
55
+ static createCapsuleColliderShape(uniqueID: number, radius: number, height: number, material: PhysXPhysicsMaterial): ICapsuleColliderShape;
56
+ /**
57
+ * {@inheritDoc IPhysics.createFixedJoint }
58
+ */
59
+ static createFixedJoint(collider: PhysXCollider): IFixedJoint;
60
+ /**
61
+ * {@inheritDoc IPhysics.createHingeJoint }
62
+ */
63
+ static createHingeJoint(collider: PhysXCollider): IHingeJoint;
64
+ /**
65
+ * {@inheritDoc IPhysics.createSpringJoint }
66
+ */
67
+ static createSpringJoint(collider: PhysXCollider): ISpringJoint;
68
+ private static _init;
69
+ }
@@ -0,0 +1,66 @@
1
+ import { IPhysicsManager } from "@galacean/engine-design";
2
+ import { Ray, Vector3 } from "@galacean/engine";
3
+ import { PhysXCharacterController } from "./PhysXCharacterController";
4
+ import { PhysXCollider } from "./PhysXCollider";
5
+ import { PhysXColliderShape } from "./shape/PhysXColliderShape";
6
+ /**
7
+ * A manager is a collection of colliders and constraints which can interact.
8
+ */
9
+ export declare class PhysXPhysicsManager implements IPhysicsManager {
10
+ private static _tempPosition;
11
+ private static _tempNormal;
12
+ private static _pxRaycastHit;
13
+ private static _pxFilterData;
14
+ static _init(): void;
15
+ private _pxScene;
16
+ private readonly _onContactEnter?;
17
+ private readonly _onContactExit?;
18
+ private readonly _onContactStay?;
19
+ private readonly _onTriggerEnter?;
20
+ private readonly _onTriggerExit?;
21
+ private readonly _onTriggerStay?;
22
+ private _currentEvents;
23
+ private _eventMap;
24
+ 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
+ /**
27
+ * {@inheritDoc IPhysicsManager.setGravity }
28
+ */
29
+ setGravity(value: Vector3): void;
30
+ /**
31
+ * {@inheritDoc IPhysicsManager.addColliderShape }
32
+ */
33
+ addColliderShape(colliderShape: PhysXColliderShape): void;
34
+ /**
35
+ * {@inheritDoc IPhysicsManager.removeColliderShape }
36
+ */
37
+ removeColliderShape(colliderShape: PhysXColliderShape): void;
38
+ /**
39
+ * {@inheritDoc IPhysicsManager.addCollider }
40
+ */
41
+ addCollider(collider: PhysXCollider): void;
42
+ /**
43
+ * {@inheritDoc IPhysicsManager.removeCollider }
44
+ */
45
+ removeCollider(collider: PhysXCollider): void;
46
+ /**
47
+ * {@inheritDoc IPhysicsManager.addCharacterController }
48
+ */
49
+ addCharacterController(characterController: PhysXCharacterController): void;
50
+ /**
51
+ * {@inheritDoc IPhysicsManager.removeCharacterController }
52
+ */
53
+ removeCharacterController(characterController: PhysXCharacterController): void;
54
+ /**
55
+ * {@inheritDoc IPhysicsManager.update }
56
+ */
57
+ update(elapsedTime: number): void;
58
+ /**
59
+ * {@inheritDoc IPhysicsManager.raycast }
60
+ */
61
+ raycast(ray: Ray, distance: number, onRaycast: (obj: number) => boolean, hit?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void): boolean;
62
+ private _simulate;
63
+ private _fetchResults;
64
+ private _getTrigger;
65
+ private _fireEvent;
66
+ }
@@ -0,0 +1,45 @@
1
+ import { IPhysicsMaterial } from "@galacean/engine-design";
2
+ /**
3
+ * Physics material describes how to handle colliding objects (friction, bounciness).
4
+ */
5
+ export declare class PhysXPhysicsMaterial implements IPhysicsMaterial {
6
+ constructor(staticFriction: number, dynamicFriction: number, bounciness: number, frictionCombine: CombineMode, bounceCombine: CombineMode);
7
+ /**
8
+ * {@inheritDoc IPhysicsMaterial.setBounciness }
9
+ */
10
+ setBounciness(value: number): void;
11
+ /**
12
+ * {@inheritDoc IPhysicsMaterial.setDynamicFriction }
13
+ */
14
+ setDynamicFriction(value: number): void;
15
+ /**
16
+ * {@inheritDoc IPhysicsMaterial.setStaticFriction }
17
+ */
18
+ setStaticFriction(value: number): void;
19
+ /**
20
+ * {@inheritDoc IPhysicsMaterial.setBounceCombine }
21
+ */
22
+ setBounceCombine(value: CombineMode): void;
23
+ /**
24
+ * {@inheritDoc IPhysicsMaterial.setFrictionCombine }
25
+ */
26
+ setFrictionCombine(value: CombineMode): void;
27
+ /**
28
+ * {@inheritDoc IPhysicsMaterial.destroy }
29
+ */
30
+ destroy(): void;
31
+ }
32
+ /**
33
+ * Describes how physics materials of the colliding objects are combined.
34
+ */
35
+ declare enum CombineMode {
36
+ /** Averages the friction/bounce of the two colliding materials. */
37
+ Average = 0,
38
+ /** Uses the smaller friction/bounce of the two colliding materials. */
39
+ Minimum = 1,
40
+ /** Multiplies the friction/bounce of the two colliding materials. */
41
+ Multiply = 2,
42
+ /** Uses the larger friction/bounce of the two colliding materials. */
43
+ Maximum = 3
44
+ }
45
+ export {};
@@ -0,0 +1,15 @@
1
+ import { IStaticCollider } from "@galacean/engine-design";
2
+ import { PhysXCollider } from "./PhysXCollider";
3
+ import { Quaternion, Vector3 } from "@galacean/engine";
4
+ /**
5
+ * A static collider component that will not move.
6
+ * @remarks Mostly used for object which always stays at the same place and never moves around.
7
+ */
8
+ 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);
15
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Static interface implement decorator.
3
+ * https://stackoverflow.com/questions/13955157/how-to-define-static-property-in-typescript-interface
4
+ */
5
+ export declare function StaticInterfaceImplement<T>(): <U extends T>(constructor: U) => void;
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ export { PhysXPhysics } from "./PhysXPhysics";
2
+ export { PhysXRuntimeMode } from "./enum/PhysXRuntimeMode";
@@ -0,0 +1,9 @@
1
+ import { PhysXJoint } from "./PhysXJoint";
2
+ import { IFixedJoint } from "@galacean/engine-design";
3
+ import { PhysXCollider } from "../PhysXCollider";
4
+ /**
5
+ * A fixed joint permits no relative movement between two colliders. ie the bodies are glued together.
6
+ */
7
+ export declare class PhysXFixedJoint extends PhysXJoint implements IFixedJoint {
8
+ constructor(collider: PhysXCollider);
9
+ }
@@ -0,0 +1,53 @@
1
+ import { PhysXCollider } from "../PhysXCollider";
2
+ import { PhysXJoint } from "./PhysXJoint";
3
+ import { IHingeJoint } from "@galacean/engine-design";
4
+ import { Vector3 } from "@galacean/engine";
5
+ /**
6
+ * A joint which behaves in a similar way to a hinge or axle.
7
+ */
8
+ export declare class PhysXHingeJoint extends PhysXJoint implements IHingeJoint {
9
+ private _axisRotationQuaternion;
10
+ private _swingOffset;
11
+ private _velocity;
12
+ constructor(collider: PhysXCollider);
13
+ /**
14
+ * {@inheritDoc IHingeJoint.setAxis }
15
+ */
16
+ setAxis(value: Vector3): void;
17
+ /**
18
+ * {@inheritDoc IHingeJoint.setSwingOffset }
19
+ */
20
+ setSwingOffset(value: Vector3): void;
21
+ /**
22
+ * {@inheritDoc IHingeJoint.getAngle }
23
+ */
24
+ getAngle(): number;
25
+ /**
26
+ * {@inheritDoc IHingeJoint.getVelocity }
27
+ */
28
+ getVelocity(): Readonly<Vector3>;
29
+ /**
30
+ * {@inheritDoc IHingeJoint.setHardLimitCone }
31
+ */
32
+ setHardLimit(lowerLimit: number, upperLimit: number, contactDist: number): void;
33
+ /**
34
+ * {@inheritDoc IHingeJoint.setHardLimitCone }
35
+ */
36
+ setSoftLimit(lowerLimit: number, upperLimit: number, stiffness: number, damping: number): void;
37
+ /**
38
+ * {@inheritDoc IHingeJoint.setDriveVelocity }
39
+ */
40
+ setDriveVelocity(velocity: number): void;
41
+ /**
42
+ * {@inheritDoc IHingeJoint.setDriveForceLimit }
43
+ */
44
+ setDriveForceLimit(limit: number): void;
45
+ /**
46
+ * {@inheritDoc IHingeJoint.setDriveGearRatio }
47
+ */
48
+ setDriveGearRatio(ratio: number): void;
49
+ /**
50
+ * {@inheritDoc IHingeJoint.setHingeJointFlag }
51
+ */
52
+ setHingeJointFlag(flag: number, value: boolean): void;
53
+ }
@@ -0,0 +1,55 @@
1
+ import { IJoint } from "@galacean/engine-design";
2
+ import { PhysXCollider } from "../PhysXCollider";
3
+ import { Quaternion, Vector3 } from "@galacean/engine";
4
+ /**
5
+ * a base interface providing common functionality for PhysX joints
6
+ */
7
+ export declare class PhysXJoint implements IJoint {
8
+ protected static _xAxis: Vector3;
9
+ protected static _defaultVec: Vector3;
10
+ protected static _defaultQuat: Quaternion;
11
+ protected _pxJoint: any;
12
+ protected _collider: PhysXCollider;
13
+ private _connectedAnchor;
14
+ private _breakForce;
15
+ private _breakTorque;
16
+ /**
17
+ * {@inheritDoc IJoint.setConnectedCollider }
18
+ */
19
+ setConnectedCollider(value: PhysXCollider): void;
20
+ /**
21
+ * {@inheritDoc IJoint.setConnectedAnchor }
22
+ */
23
+ setConnectedAnchor(value: Vector3): void;
24
+ /**
25
+ * {@inheritDoc IJoint.setConnectedMassScale }
26
+ */
27
+ setConnectedMassScale(value: number): void;
28
+ /**
29
+ * {@inheritDoc IJoint.setConnectedInertiaScale }
30
+ */
31
+ setConnectedInertiaScale(value: number): void;
32
+ /**
33
+ * {@inheritDoc IJoint.setMassScale }
34
+ */
35
+ setMassScale(value: number): void;
36
+ /**
37
+ * {@inheritDoc IJoint.setInertiaScale }
38
+ */
39
+ setInertiaScale(value: number): void;
40
+ /**
41
+ * {@inheritDoc IJoint.setBreakForce }
42
+ */
43
+ setBreakForce(value: number): void;
44
+ /**
45
+ * {@inheritDoc IJoint.setBreakTorque }
46
+ */
47
+ setBreakTorque(value: number): void;
48
+ /**
49
+ * Set the joint local pose for an actor.
50
+ * @param actor 0 for the first actor, 1 for the second actor.
51
+ * @param position the local position for the actor this joint
52
+ * @param rotation the local rotation for the actor this joint
53
+ */
54
+ protected _setLocalPose(actor: number, position: Vector3, rotation: Quaternion): void;
55
+ }
@@ -0,0 +1,35 @@
1
+ import { PhysXJoint } from "./PhysXJoint";
2
+ import { ISpringJoint } from "@galacean/engine-design";
3
+ import { PhysXCollider } from "../PhysXCollider";
4
+ import { Vector3 } from "@galacean/engine";
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
+ private _swingOffset;
10
+ constructor(collider: PhysXCollider);
11
+ /**
12
+ * {@inheritDoc ISpringJoint.setSwingOffset }
13
+ */
14
+ setSwingOffset(value: Vector3): void;
15
+ /**
16
+ * {@inheritDoc ISpringJoint.setMinDistance }
17
+ */
18
+ setMinDistance(distance: number): void;
19
+ /**
20
+ * {@inheritDoc ISpringJoint.setMaxDistance }
21
+ */
22
+ setMaxDistance(distance: number): void;
23
+ /**
24
+ * {@inheritDoc ISpringJoint.setTolerance }
25
+ */
26
+ setTolerance(tolerance: number): void;
27
+ /**
28
+ * {@inheritDoc ISpringJoint.setStiffness }
29
+ */
30
+ setStiffness(stiffness: number): void;
31
+ /**
32
+ * {@inheritDoc ISpringJoint.setDamping }
33
+ */
34
+ setDamping(damping: number): void;
35
+ }
@@ -0,0 +1,25 @@
1
+ import { IBoxColliderShape } from "@galacean/engine-design";
2
+ import { Vector3 } from "@galacean/engine";
3
+ import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
4
+ import { PhysXColliderShape } from "./PhysXColliderShape";
5
+ /**
6
+ * Box collider shape in PhysX.
7
+ */
8
+ export declare class PhysXBoxColliderShape extends PhysXColliderShape implements IBoxColliderShape {
9
+ 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);
17
+ /**
18
+ * {@inheritDoc IBoxColliderShape.setSize }
19
+ */
20
+ setSize(value: Vector3): void;
21
+ /**
22
+ * {@inheritDoc IColliderShape.setWorldScale }
23
+ */
24
+ setWorldScale(scale: Vector3): void;
25
+ }
@@ -0,0 +1,46 @@
1
+ import { ICapsuleColliderShape } from "@galacean/engine-design";
2
+ import { Vector3 } from "@galacean/engine";
3
+ import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
4
+ import { PhysXColliderShape } from "./PhysXColliderShape";
5
+ /**
6
+ * Capsule collider shape in PhysX.
7
+ */
8
+ export declare class PhysXCapsuleColliderShape extends PhysXColliderShape implements ICapsuleColliderShape {
9
+ 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);
18
+ /**
19
+ * {@inheritDoc ICapsuleColliderShape.setRadius }
20
+ */
21
+ setRadius(value: number): void;
22
+ /**
23
+ * {@inheritDoc ICapsuleColliderShape.setHeight }
24
+ */
25
+ setHeight(value: number): void;
26
+ /**
27
+ * {@inheritDoc ICapsuleColliderShape.setUpAxis }
28
+ */
29
+ setUpAxis(upAxis: ColliderShapeUpAxis): void;
30
+ /**
31
+ * {@inheritDoc IColliderShape.setWorldScale }
32
+ */
33
+ setWorldScale(scale: Vector3): void;
34
+ }
35
+ /**
36
+ * The up axis of the collider shape.
37
+ */
38
+ declare enum ColliderShapeUpAxis {
39
+ /** Up axis is X. */
40
+ X = 0,
41
+ /** Up axis is Y. */
42
+ Y = 1,
43
+ /** Up axis is Z. */
44
+ Z = 2
45
+ }
46
+ export {};