@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.
@@ -0,0 +1,62 @@
1
+ import { IColliderShape } from "@galacean/engine-design";
2
+ import { Quaternion, Vector3 } from "@galacean/engine";
3
+ import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
4
+ /**
5
+ * Flags which affect the behavior of Shapes.
6
+ */
7
+ export declare enum ShapeFlag {
8
+ /** The shape will partake in collision in the physical simulation. */
9
+ SIMULATION_SHAPE = 1,
10
+ /** The shape will partake in scene queries (ray casts, overlap tests, sweeps, ...). */
11
+ SCENE_QUERY_SHAPE = 2,
12
+ /** The shape is a trigger which can send reports whenever other shapes enter/leave its volume. */
13
+ TRIGGER_SHAPE = 4
14
+ }
15
+ /**
16
+ * Abstract class for collider shapes.
17
+ */
18
+ export declare abstract class PhysXColliderShape implements IColliderShape {
19
+ static readonly halfSqrt: number;
20
+ static transform: {
21
+ translation: Vector3;
22
+ rotation: any;
23
+ };
24
+ protected _scale: Vector3;
25
+ protected _position: Vector3;
26
+ protected _rotation: Vector3;
27
+ protected _axis: Quaternion;
28
+ protected _physxRotation: Quaternion;
29
+ private _shapeFlags;
30
+ /**
31
+ * {@inheritDoc IColliderShape.setRotation }
32
+ */
33
+ setRotation(value: Vector3): void;
34
+ /**
35
+ * {@inheritDoc IColliderShape.setPosition }
36
+ */
37
+ setPosition(value: Vector3): void;
38
+ /**
39
+ * {@inheritDoc IColliderShape.setWorldScale }
40
+ */
41
+ abstract setWorldScale(scale: Vector3): void;
42
+ /**
43
+ * {@inheritDoc IColliderShape.setContactOffset }
44
+ * @default 0.02f * PxTolerancesScale::length
45
+ */
46
+ setContactOffset(offset: number): void;
47
+ /**
48
+ * {@inheritDoc IColliderShape.setMaterial }
49
+ */
50
+ setMaterial(value: PhysXPhysicsMaterial): void;
51
+ /**
52
+ * {@inheritDoc IColliderShape.setIsTrigger }
53
+ */
54
+ setIsTrigger(value: boolean): void;
55
+ /**
56
+ * {@inheritDoc IColliderShape.destroy }
57
+ */
58
+ destroy(): void;
59
+ protected _setLocalPose(): void;
60
+ protected _initialize(material: PhysXPhysicsMaterial, id: number): void;
61
+ private _modifyFlag;
62
+ }
@@ -0,0 +1,19 @@
1
+ import { IPlaneColliderShape } from "@galacean/engine-design";
2
+ import { Vector3 } from "@galacean/engine";
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
+ /**
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;
19
+ }
@@ -0,0 +1,26 @@
1
+ import { ISphereColliderShape } from "@galacean/engine-design";
2
+ import { PhysXColliderShape } from "./PhysXColliderShape";
3
+ import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
4
+ import { Vector3 } from "@galacean/engine";
5
+ /**
6
+ * Sphere collider shape in PhysX.
7
+ */
8
+ export declare class PhysXSphereColliderShape extends PhysXColliderShape implements ISphereColliderShape {
9
+ private _radius;
10
+ 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);
18
+ /**
19
+ * {@inheritDoc ISphereColliderShape.setRadius }
20
+ */
21
+ setRadius(value: number): void;
22
+ /**
23
+ * {@inheritDoc IColliderShape.setWorldScale }
24
+ */
25
+ setWorldScale(scale: Vector3): void;
26
+ }