PxTriangleMesh.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and
00007 // any modifications thereto. Any use, reproduction, disclosure, or
00008 // distribution of this software and related documentation without an express
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 //
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 
00031 #ifndef PX_PHYSICS_GEOMUTILS_NX_TRIANGLEMESH
00032 #define PX_PHYSICS_GEOMUTILS_NX_TRIANGLEMESH
00033 
00036 #include "foundation/PxVec3.h"
00037 #include "foundation/PxBounds3.h"
00038 #include "common/PxPhysXCommonConfig.h"
00039 #include "common/PxBase.h"
00040 
00041 #if !PX_DOXYGEN
00042 namespace physx
00043 {
00044 #endif
00045 
00051 #define PX_ENABLE_DYNAMIC_MESH_RTREE 1
00052 
00064 struct PxMeshMidPhase
00065 {
00066     enum Enum
00067     {
00068         eBVH33 = 0,     
00069         eBVH34 = 1,     
00070 
00071         eLAST
00072     };
00073 };
00074 
00080 struct PxTriangleMeshFlag
00081 {
00082     enum Enum
00083     {
00084         e16_BIT_INDICES = (1<<1),   
00085         eADJACENCY_INFO = (1<<2)    
00086     };
00087 };
00088 
00094 typedef PxFlags<PxTriangleMeshFlag::Enum,PxU8> PxTriangleMeshFlags;
00095 PX_FLAGS_OPERATORS(PxTriangleMeshFlag::Enum,PxU8)
00096 
00097 
00126 class PxTriangleMesh : public PxBase
00127 {
00128     public:
00134      virtual    PxU32               getNbVertices()                                 const   = 0;
00135 
00141     virtual const PxVec3*           getVertices()                                   const   = 0;
00142 
00143 #if PX_ENABLE_DYNAMIC_MESH_RTREE
00144 
00163     virtual PxVec3*                 getVerticesForModification() = 0;
00164 
00182     virtual PxBounds3               refitBVH() = 0;
00183 #endif // PX_ENABLE_DYNAMIC_MESH_RTREE
00184 
00190     virtual PxU32                   getNbTriangles()                                const   = 0;
00191 
00203     virtual const void*             getTriangles()                                  const   = 0;
00204 
00214     virtual PxTriangleMeshFlags     getTriangleMeshFlags()                          const = 0;
00215 
00228     virtual const PxU32*            getTrianglesRemap()                         const   = 0;
00229 
00230 
00236     virtual void                    release()                                           = 0;
00237 
00246     virtual PxMaterialTableIndex    getTriangleMaterialIndex(PxTriangleID triangleIndex)    const   = 0;
00247 
00253     virtual PxBounds3               getLocalBounds()                            const   = 0;
00254 
00263     virtual PxU32                   getReferenceCount()                         const   = 0;
00264 
00270     virtual void                    acquireReference()                                  = 0;
00271 
00272 protected:
00273     PX_INLINE                       PxTriangleMesh(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags)    {}
00274     PX_INLINE                       PxTriangleMesh(PxBaseFlags baseFlags) : PxBase(baseFlags)                                       {}
00275     virtual                         ~PxTriangleMesh() {}
00276 
00277     virtual bool                    isKindOf(const char* name) const { return !::strcmp("PxTriangleMesh", name) || PxBase::isKindOf(name); }
00278 };
00279 
00286 class PxBVH33TriangleMesh : public PxTriangleMesh
00287 {
00288     public:
00289 protected:
00290     PX_INLINE                       PxBVH33TriangleMesh(PxType concreteType, PxBaseFlags baseFlags) : PxTriangleMesh(concreteType, baseFlags) {}
00291     PX_INLINE                       PxBVH33TriangleMesh(PxBaseFlags baseFlags) : PxTriangleMesh(baseFlags) {}
00292     virtual                         ~PxBVH33TriangleMesh() {}
00293     virtual bool                    isKindOf(const char* name) const { return !::strcmp("PxBVH33TriangleMesh", name) || PxTriangleMesh::isKindOf(name); }
00294 };
00295 
00302 class PxBVH34TriangleMesh : public PxTriangleMesh
00303 {
00304     public:
00305 protected:
00306     PX_INLINE                       PxBVH34TriangleMesh(PxType concreteType, PxBaseFlags baseFlags) : PxTriangleMesh(concreteType, baseFlags) {}
00307     PX_INLINE                       PxBVH34TriangleMesh(PxBaseFlags baseFlags) : PxTriangleMesh(baseFlags) {}
00308     virtual                         ~PxBVH34TriangleMesh() {}
00309     virtual bool                    isKindOf(const char* name) const { return !::strcmp("PxBVH34TriangleMesh", name) || PxTriangleMesh::isKindOf(name); }
00310 };
00311 
00312 #if !PX_DOXYGEN
00313 } // namespace physx
00314 #endif
00315 
00317 #endif


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