APEX Clothing Module: ClothingCollision.h Source File

NVIDIA APEX

ClothingCollision.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-2017, NVIDIA CORPORATION.  All rights reserved.
00003  *
00004  * NVIDIA CORPORATION and its licensors retain all intellectual property
00005  * and proprietary rights in and to this software, related documentation
00006  * and any modifications thereto.  Any use, reproduction, disclosure or
00007  * distribution of this software and related documentation without an express
00008  * license agreement from NVIDIA CORPORATION is strictly prohibited.
00009  */
00010 
00011 
00012 #ifndef CLOTHING_COLLISION_H
00013 #define CLOTHING_COLLISION_H
00014 
00020 #include "ApexInterface.h"
00021 
00022 namespace nvidia
00023 {
00024 
00025 namespace apex
00026 {
00027 PX_PUSH_PACK_DEFAULT
00028 
00029 
00033 struct ClothingCollisionType
00034 {
00038     enum Enum
00039     {
00040         Plane,
00041         Convex,
00042         Sphere,
00043         Capsule,
00044         TriangleMesh
00045     };
00046 };
00047 
00048 
00049 
00050 class ClothingPlane;
00051 class ClothingConvex;
00052 class ClothingSphere;
00053 class ClothingCapsule;
00054 class ClothingTriangleMesh;
00055 
00059 class ClothingCollision : public ApexInterface
00060 {
00061 public:
00065     virtual ClothingCollisionType::Enum getType() const = 0;
00066 
00070     virtual ClothingPlane* isPlane() = 0;
00071 
00075     virtual ClothingConvex* isConvex() = 0;
00076 
00080     virtual ClothingSphere* isSphere() = 0;
00081 
00085     virtual ClothingCapsule* isCapsule() = 0;
00086 
00090     virtual ClothingTriangleMesh* isTriangleMesh() = 0;
00091 };
00092 
00093 
00094 
00098 class ClothingPlane : public ClothingCollision
00099 {
00100 public:
00104     virtual void setPlane(const PxPlane& plane) = 0;
00105 
00109     virtual const PxPlane& getPlane() = 0;
00110 
00114     virtual uint32_t getRefCount() const = 0;
00115 };
00116 
00117 
00118 
00124 class ClothingConvex : public ClothingCollision
00125 {
00126 public:
00130     virtual uint32_t getNumPlanes() = 0;
00131 
00135     virtual ClothingPlane** getPlanes() = 0;
00136 
00142     virtual void releaseWithPlanes() = 0;
00143 };
00144 
00145 
00146 
00150 class ClothingSphere : public ClothingCollision
00151 {
00152 public:
00156     virtual void setPosition(const PxVec3& position) = 0;
00157 
00161     virtual const PxVec3& getPosition() const = 0;
00162 
00170     virtual void setRadius(float radius) = 0;
00171 
00175     virtual float getRadius() const = 0;
00176 
00180     virtual uint32_t getRefCount() const = 0;
00181 };
00182 
00183 
00184 
00190 class ClothingCapsule : public ClothingCollision
00191 {
00192 public:
00196     virtual ClothingSphere** getSpheres() = 0;
00197 
00203     virtual void releaseWithSpheres() = 0;
00204 };
00205 
00206 
00207 
00211 class ClothingTriangleMesh : public ClothingCollision
00212 {
00213 public:
00221     virtual uint32_t lockTriangles(const uint32_t** ids, const PxVec3** triangles) = 0;
00222 
00230     virtual uint32_t lockTrianglesWrite(const uint32_t** ids, PxVec3** triangles) = 0;
00231 
00235     virtual void unlockTriangles() = 0;
00236 
00247     virtual void addTriangle(uint32_t id, const PxVec3& v0, const PxVec3& v1, const PxVec3& v2) = 0;
00248 
00259     virtual void addTriangles(const uint32_t* ids, const PxVec3* triangleVertices, uint32_t numTriangles) = 0;
00260 
00267     virtual void removeTriangle(uint32_t id) = 0;
00268 
00276     virtual void removeTriangles(const uint32_t* ids, uint32_t numTriangles) = 0;
00277 
00281     virtual void clearTriangles() = 0;
00282 
00286     virtual void setPose(PxMat44 pose) = 0;
00287 
00291     virtual const PxMat44& getPose() const = 0;
00292 };
00293 
00294 
00295 
00296 PX_POP_PACK
00297 } // namespace nvidia
00298 } // namespace nvidia
00299 
00300 
00301 #endif // CLOTHING_COLLISION_H

Generated on Fri Dec 15 2017 13:58:20
Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.