1 | /* |
2 | * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. |
3 | * |
4 | * NVIDIA CORPORATION and its licensors retain all intellectual property |
5 | * and proprietary rights in and to this software, related documentation |
6 | * and any modifications thereto. Any use, reproduction, disclosure or |
7 | * distribution of this software and related documentation without an express |
8 | * license agreement from NVIDIA CORPORATION is strictly prohibited. |
9 | */ |
10 | // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. |
11 | // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. |
12 | |
13 | |
14 | #ifndef PX_PHYSICS_NX_CLOTH_COLLISION_DATA |
15 | #define PX_PHYSICS_NX_CLOTH_COLLISION_DATA |
16 | /** \addtogroup cloth |
17 | @{ |
18 | */ |
19 | |
20 | #include "PxPhysXConfig.h" |
21 | #include "foundation/PxVec3.h" |
22 | |
23 | #ifndef PX_DOXYGEN |
24 | namespace physx |
25 | { |
26 | #endif |
27 | |
28 | /** |
29 | \brief Sphere representation used for cloth-sphere and cloth-capsule collision. |
30 | \details Cloth can collide with spheres and capsules. Each capsule is represented by |
31 | a pair of spheres with possibly different radii. |
32 | */ |
33 | struct PxClothCollisionSphere |
34 | { |
35 | PxVec3 pos; //!< position of the sphere |
36 | PxReal radius; //!< radius of the sphere. |
37 | |
38 | /** |
39 | \brief Default constructor, performs no initialization. |
40 | */ |
41 | PxClothCollisionSphere() {} |
42 | PxClothCollisionSphere(const PxVec3& p, PxReal r) |
43 | : pos(p), radius(r) {} |
44 | }; |
45 | |
46 | /** |
47 | \brief Plane representation used for cloth-convex collision. |
48 | \details Cloth can collide with convexes. Each convex is represented by |
49 | a mask of the planes that make up the convex. |
50 | */ |
51 | struct PxClothCollisionPlane |
52 | { |
53 | PxVec3 normal; //!< The normal to the plane |
54 | PxReal distance; //!< The distance to the origin (in the normal direction) |
55 | |
56 | /** |
57 | \brief Default constructor, performs no initialization. |
58 | */ |
59 | PxClothCollisionPlane() {} |
60 | PxClothCollisionPlane(const PxVec3& normal_, PxReal distance_) |
61 | : normal(normal_), distance(distance_) {} |
62 | }; |
63 | |
64 | /** |
65 | \brief Triangle representation used for cloth-mesh collision. |
66 | */ |
67 | struct PxClothCollisionTriangle |
68 | { |
69 | PxVec3 vertex0; |
70 | PxVec3 vertex1; |
71 | PxVec3 vertex2; |
72 | |
73 | /** |
74 | \brief Default constructor, performs no initialization. |
75 | */ |
76 | PxClothCollisionTriangle() {} |
77 | PxClothCollisionTriangle( |
78 | const PxVec3& v0, |
79 | const PxVec3& v1, |
80 | const PxVec3& v2) : |
81 | vertex0(v0), |
82 | vertex1(v1), |
83 | vertex2(v2) {} |
84 | }; |
85 | |
86 | |
87 | #ifndef PX_DOXYGEN |
88 | } // namespace physx |
89 | #endif |
90 | |
91 | /** @} */ |
92 | #endif |
93 | |