PxClothFabric.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_PHYSICS_NX_CLOTH_FABRIC
15 #define PX_PHYSICS_NX_CLOTH_FABRIC
16 
21 #include "common/PxBase.h"
22 
23 #ifndef PX_DOXYGEN
24 namespace physx
25 {
26 #endif
27 
33 {
34  enum Enum
35  {
41  eCOUNT // internal use only
42  };
43 };
44 
50 {
53 
58 
63 };
64 
67  : phaseType(type)
68  , setIndex(index)
69 {}
70 
76 {
77 public:
80 
85 
89  const PxU32* sets;
90 
92  const PxU32* indices;
95 
102 
107 
111  PX_INLINE void setToDefault();
112 
117  PX_INLINE bool isValid() const;
118 };
119 
121 {
122  setToDefault();
123 }
124 
126 {
127  memset(this, 0, sizeof(PxClothFabricDesc));
128 }
129 
131 {
132  return nbParticles && nbPhases && phases && restvalues && nbSets
133  && sets && indices && (!nbTethers || (tetherAnchors && tetherLengths));
134 }
135 
136 
157 class PxClothFabric : public PxBase
158 {
159 public:
166  virtual void release() = 0;
167 
172  virtual PxU32 getNbParticles() const = 0;
173 
178  virtual PxU32 getNbPhases() const = 0;
179 
184  virtual PxU32 getNbRestvalues() const = 0;
185 
190  virtual PxU32 getNbSets() const = 0;
191 
196  virtual PxU32 getNbParticleIndices() const = 0;
197 
202  virtual PxU32 getNbTethers() const = 0;
203 
214  virtual PxU32 getPhases(PxClothFabricPhase* userPhaseBuffer, PxU32 bufferSize) const = 0;
215 
227  virtual PxU32 getSets(PxU32* userSetBuffer, PxU32 bufferSize) const = 0;
228 
239  virtual PxU32 getParticleIndices(PxU32* userParticleIndexBuffer, PxU32 bufferSize) const = 0;
240 
254  virtual PxU32 getRestvalues(PxReal* userRestvalueBuffer, PxU32 bufferSize) const = 0;
255 
268  virtual PxU32 getTetherAnchors(PxU32* userAnchorBuffer, PxU32 bufferSize) const = 0;
269 
281  virtual PxU32 getTetherLengths(PxReal* userLengthBuffer, PxU32 bufferSize) const = 0;
282 
290  PX_DEPRECATED virtual PxClothFabricPhaseType::Enum getPhaseType(PxU32 phaseIndex) const = 0;
291 
296  virtual void scaleRestlengths(PxReal scale) = 0;
297 
304  virtual PxU32 getReferenceCount() const = 0;
305 
306  virtual const char* getConcreteTypeName() const { return "PxClothFabric"; }
307 
308 protected:
309 
310  PX_INLINE PxClothFabric(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
311  PX_INLINE PxClothFabric(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
312  virtual ~PxClothFabric() {}
313  virtual bool isKindOf(const char* name) const { return !strcmp("PxClothFabric", name) || PxBase::isKindOf(name); }
314 };
315 
316 #ifndef PX_DOXYGEN
317 } // namespace physx
318 #endif
319 
321 #endif


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