Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef CLOTHING_COLLISION_H
00031 #define CLOTHING_COLLISION_H
00032
00038 #include "ApexInterface.h"
00039
00040 namespace nvidia
00041 {
00042
00043 namespace apex
00044 {
00045 PX_PUSH_PACK_DEFAULT
00046
00047
00051 struct ClothingCollisionType
00052 {
00056 enum Enum
00057 {
00058 Plane,
00059 Convex,
00060 Sphere,
00061 Capsule,
00062 TriangleMesh
00063 };
00064 };
00065
00066
00067
00068 class ClothingPlane;
00069 class ClothingConvex;
00070 class ClothingSphere;
00071 class ClothingCapsule;
00072 class ClothingTriangleMesh;
00073
00077 class ClothingCollision : public ApexInterface
00078 {
00079 public:
00083 virtual ClothingCollisionType::Enum getType() const = 0;
00084
00088 virtual ClothingPlane* isPlane() = 0;
00089
00093 virtual ClothingConvex* isConvex() = 0;
00094
00098 virtual ClothingSphere* isSphere() = 0;
00099
00103 virtual ClothingCapsule* isCapsule() = 0;
00104
00108 virtual ClothingTriangleMesh* isTriangleMesh() = 0;
00109 };
00110
00111
00112
00116 class ClothingPlane : public ClothingCollision
00117 {
00118 public:
00122 virtual void setPlane(const PxPlane& plane) = 0;
00123
00127 virtual const PxPlane& getPlane() = 0;
00128
00132 virtual uint32_t getRefCount() const = 0;
00133 };
00134
00135
00136
00142 class ClothingConvex : public ClothingCollision
00143 {
00144 public:
00148 virtual uint32_t getNumPlanes() = 0;
00149
00153 virtual ClothingPlane** getPlanes() = 0;
00154
00160 virtual void releaseWithPlanes() = 0;
00161 };
00162
00163
00164
00168 class ClothingSphere : public ClothingCollision
00169 {
00170 public:
00174 virtual void setPosition(const PxVec3& position) = 0;
00175
00179 virtual const PxVec3& getPosition() const = 0;
00180
00188 virtual void setRadius(float radius) = 0;
00189
00193 virtual float getRadius() const = 0;
00194
00198 virtual uint32_t getRefCount() const = 0;
00199 };
00200
00201
00202
00208 class ClothingCapsule : public ClothingCollision
00209 {
00210 public:
00214 virtual ClothingSphere** getSpheres() = 0;
00215
00221 virtual void releaseWithSpheres() = 0;
00222 };
00223
00224
00225
00229 class ClothingTriangleMesh : public ClothingCollision
00230 {
00231 public:
00239 virtual uint32_t lockTriangles(const uint32_t** ids, const PxVec3** triangles) = 0;
00240
00248 virtual uint32_t lockTrianglesWrite(const uint32_t** ids, PxVec3** triangles) = 0;
00249
00253 virtual void unlockTriangles() = 0;
00254
00265 virtual void addTriangle(uint32_t id, const PxVec3& v0, const PxVec3& v1, const PxVec3& v2) = 0;
00266
00277 virtual void addTriangles(const uint32_t* ids, const PxVec3* triangleVertices, uint32_t numTriangles) = 0;
00278
00285 virtual void removeTriangle(uint32_t id) = 0;
00286
00294 virtual void removeTriangles(const uint32_t* ids, uint32_t numTriangles) = 0;
00295
00299 virtual void clearTriangles() = 0;
00300
00304 virtual void setPose(PxMat44 pose) = 0;
00305
00309 virtual const PxMat44& getPose() const = 0;
00310 };
00311
00312
00313
00314 PX_POP_PACK
00315 }
00316 }
00317
00318
00319 #endif // CLOTHING_COLLISION_H