ClothingCollision.h
Go to the documentation of this file.
00001 //
00002 // Redistribution and use in source and binary forms, with or without
00003 // modification, are permitted provided that the following conditions
00004 // are met:
00005 //  * Redistributions of source code must retain the above copyright
00006 //    notice, this list of conditions and the following disclaimer.
00007 //  * Redistributions in binary form must reproduce the above copyright
00008 //    notice, this list of conditions and the following disclaimer in the
00009 //    documentation and/or other materials provided with the distribution.
00010 //  * Neither the name of NVIDIA CORPORATION nor the names of its
00011 //    contributors may be used to endorse or promote products derived
00012 //    from this software without specific prior written permission.
00013 //
00014 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
00015 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017 // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00018 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00019 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00020 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00021 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00022 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00023 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00024 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025 //
00026 // Copyright (c) 2018 NVIDIA Corporation. All rights reserved.
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 } // namespace nvidia
00316 } // namespace nvidia
00317 
00318 
00319 #endif // CLOTHING_COLLISION_H

Generated on Sat Dec 1 2018 15:52:05

Copyright © 2012-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.