PxTriangleMeshDesc.h
Go to the documentation of this file.
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_COLLISION_NXTRIANGLEMESHDESC
15 #define PX_COLLISION_NXTRIANGLEMESHDESC
16 
20 #include "PxPhysXConfig.h"
22 
23 #ifndef PX_DOXYGEN
24 namespace physx
25 {
26 #endif
27 
38 {
39 public:
40 
58 
68 
73 
77  PX_INLINE void setToDefault();
78 
83  PX_INLINE bool isValid() const;
84 };
85 
86 PX_INLINE PxTriangleMeshDesc::PxTriangleMeshDesc() //constructor sets to default
87 {
89  convexEdgeThreshold = 0.001f;
90 }
91 
93 {
94  *this = PxTriangleMeshDesc();
95 }
96 
98 {
99  if(points.count < 3) //at least 1 trig's worth of points
100  return false;
101  if ((!triangles.data) && (points.count%3)) // Non-indexed mesh => we must ensure the geometry defines an implicit number of triangles // i.e. numVertices can't be divided by 3
102  return false;
103  //add more validity checks here
104  if (materialIndices.data && materialIndices.stride < sizeof(PxMaterialTableIndex))
105  return false;
107 }
108 
109 #ifndef PX_DOXYGEN
110 } // namespace physx
111 #endif
112 
114 #endif


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