FLEX  1.1.0
NvFlexExt.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2013-2017 NVIDIA Corporation. All rights reserved.
27 
28 #ifndef NV_FLEX_EXT_H
29 #define NV_FLEX_EXT_H
30 
36 #include "NvFlex.h"
37 
38 #include <cassert>
39 #include <cstddef>
40 
41 // A vector type that wraps a NvFlexBuffer, behaves like a standard vector for POD types (no construction)
42 // The vector must be mapped using map() before any read/write access to elements or resize operation
43 
44 template <typename T>
46 {
47  NvFlexVector(NvFlexLibrary* l, int size=0) : lib(l), buffer(NULL), mappedPtr(NULL), count(0), capacity(0)
48  {
49  if (size)
50  {
51  resize(size);
52 
53  // resize implicitly maps, unmap initial allocation
54  unmap();
55  }
56  }
57 
58  NvFlexVector(NvFlexLibrary* l, const T* ptr, int size) : lib(l), buffer(NULL), mappedPtr(NULL), count(0), capacity(0)
59  {
60  assign(ptr, size);
61  unmap();
62  }
63 
64 
66  {
67  destroy();
68  }
69 
72 
74  int count;
75  int capacity;
76 
77  // reinitialize the vector leaving it unmapped
78  void init(int size)
79  {
80  destroy();
81  resize(size);
82  unmap();
83  }
84 
85  void destroy()
86  {
87  if (mappedPtr)
88  NvFlexUnmap(buffer);
89 
90  if (buffer)
91  NvFlexFreeBuffer(buffer);
92 
93  mappedPtr = NULL;
94  buffer = NULL;
95  capacity = 0;
96  count = 0;
97  }
98 
99  void map(int flags=eNvFlexMapWait)
100  {
101  if (!buffer)
102  return;
103 
104  assert(!mappedPtr);
105  mappedPtr = (T*)NvFlexMap(buffer, flags);
106  }
107 
108  void unmap()
109  {
110  if (!buffer)
111  return;
112 
113  assert(mappedPtr);
114 
115  NvFlexUnmap(buffer);
116  mappedPtr = 0;
117  }
118 
119  const T& operator[](int index) const
120  {
121  assert(mappedPtr);
122  assert(index < count);
123 
124  return mappedPtr[index];
125  }
126 
127  T& operator[](int index)
128  {
129  assert(mappedPtr);
130  assert(index < count);
131 
132  return mappedPtr[index];
133  }
134 
135  void push_back(const T& t)
136  {
137  assert(mappedPtr || !buffer);
138 
139  reserve(count+1);
140 
141  // copy element
142  mappedPtr[count++] = t;
143  }
144 
145  void assign(const T* srcPtr, int newCount)
146  {
147  assert(mappedPtr || !buffer);
148 
149  resize(newCount);
150 
151  memcpy(mappedPtr, srcPtr, newCount*sizeof(T));
152  }
153 
154  void copyto(T* dest, int count)
155  {
156  assert(mappedPtr);
157 
158  memcpy(dest, mappedPtr, sizeof(T)*count);
159  }
160 
161  int size() const { return count; }
162 
163  bool empty() const { return size() == 0; }
164 
165  const T& back() const
166  {
167  assert(mappedPtr);
168  assert(!empty());
169 
170  return mappedPtr[count-1];
171  }
172 
173  void reserve(int minCapacity)
174  {
175  if (minCapacity > capacity)
176  {
177  // growth factor of 1.5
178  const int newCapacity = minCapacity*3/2;
179 
180  NvFlexBuffer* newBuf = NvFlexAllocBuffer(lib, newCapacity, sizeof(T), eNvFlexBufferHost);
181 
182  // copy contents to new buffer
183  void* newPtr = NvFlexMap(newBuf, eNvFlexMapWait);
184  memcpy(newPtr, mappedPtr, count*sizeof(T));
185 
186  // unmap old buffer, but leave new buffer mapped
187  unmap();
188 
189  if (buffer)
190  NvFlexFreeBuffer(buffer);
191 
192  // swap
193  buffer = newBuf;
194  mappedPtr = (T*)newPtr;
195  capacity = newCapacity;
196  }
197  }
198 
199  // resizes mapped buffer and leaves new buffer mapped
200  void resize(int newCount)
201  {
202  assert(mappedPtr || !buffer);
203 
204  reserve(newCount);
205 
206  // resize but do not initialize new entries
207  count = newCount;
208  }
209 
210  void resize(int newCount, const T& val)
211  {
212  assert(mappedPtr || !buffer);
213 
214  const int startInit = count;
215  const int endInit = newCount;
216 
217  resize(newCount);
218 
219  // init any new entries
220  for (int i=startInit; i < endInit; ++i)
221  mappedPtr[i] = val;
222  }
223 };
224 
225 extern "C" {
226 
231 {
232  float position[3];
233  float rotation[4];
234 
235  float velocity[3];
236  float omega[3];
237 
238  float acceleration[3];
239  float tau[3];
240 
241  float delta[4][4];
242 };
243 
280 NV_FLEX_API void NvFlexExtMovingFrameInit(NvFlexExtMovingFrame* frame, const float* worldTranslation, const float* worldRotation);
281 
282 /* Update a frame to a new position, this will automatically update the velocity and acceleration of
283  * the frame, which can then be used to calculate inertial forces. This should be called once per-frame
284  * with the new position and time-step used when moving the frame.
285  *
286  * @param[in] frame A pointer to a user-allocated NvFlexExtMovingFrame struct
287  * @param[in] worldTranslation A pointer to a vec3 storing the frame's initial translation in world space
288  * @param[in] worldRotation A pointer to a quaternion storing the frame's initial rotation in world space
289  * @param[in] dt The time that elapsed since the last call to the frame update
290  */
291 NV_FLEX_API void NvFlexExtMovingFrameUpdate(NvFlexExtMovingFrame* frame, const float* worldTranslation, const float* worldRotation, float dt);
292 
293 /* Teleport particles to the frame's new position and apply the inertial forces
294  *
295  * @param[in] frame A pointer to a user-allocated NvFlexExtMovingFrame struct
296  * @param[in] positions A pointer to an array of particle positions in (x, y, z, 1/m) format
297  * @param[in] velocities A pointer to an array of particle velocities in (vx, vy, vz) format
298  * @param[in] numParticles The number of particles to update
299  * @param[in] linearScale How strongly the translational inertial forces should be applied, 0.0 corresponds to a purely local space simulation removing all inertial forces, 1.0 corresponds to no inertial damping and has no benefit over regular world space simulation
300  * @param[in] angularScale How strongly the angular inertial forces should be applied, 0.0 corresponds to a purely local space simulation, 1.0 corresponds to no inertial damping
301  * @param[in] dt The time that elapsed since the last call to the frame update, should match the value passed to NvFlexExtMovingFrameUpdate()
302  */
303 NV_FLEX_API void NvFlexExtMovingFrameApply(NvFlexExtMovingFrame* frame, float* positions, float* velocities, int numParticles, float linearScale, float angularScale, float dt);
304 
305 
311 {
312  // particles
313  float* particles;
316 
317  // springs
322 
323  // shapes
328  float* shapeCenters;
329  int numShapes;
330 
331  // faces for cloth
334 
335  // inflatable params
336  bool inflatable;
340 };
341 
346 {
349 
353 
355  float* shapeRotations;
356 
358 
359  void* userData;
360 };
361 
366 
378 NV_FLEX_API int NvFlexExtCreateWeldedMeshIndices(const float* vertices, int numVertices, int* uniqueVerts, int* originalToUniqueMap, float threshold);
379 
395 NV_FLEX_API NvFlexExtAsset* NvFlexExtCreateClothFromMesh(const float* particles, int numParticles, const int* indices, int numTriangles, float stretchStiffness, float bendStiffness, float tetherStiffness, float tetherGive, float pressure);
396 
415 NV_FLEX_API NvFlexExtAsset* NvFlexExtCreateTearingClothFromMesh(const float* particles, int numParticles, int maxParticles, const int* indices, int numTriangles, float stretchStiffness, float bendStiffness, float pressure);
416 
421 NV_FLEX_API void NvFlexExtDestroyTearingCloth(NvFlexExtAsset* asset);
422 
429 {
430  int srcIndex;
432 };
433 
442 {
443  int triIndex; // index into the triangle indices array to update
444  int newParticleIndex; // new value for the index
445 };
446 
461 NV_FLEX_API void NvFlexExtTearClothMesh(NvFlexExtAsset* asset, float maxStrain, int maxSplits, NvFlexExtTearingParticleClone* particleCopies, int* numParticleCopies, int maxCopies, NvFlexExtTearingMeshEdit* triangleEdits, int* numTriangleEdits, int maxEdits);
462 
474 NV_FLEX_API NvFlexExtAsset* NvFlexExtCreateRigidFromMesh(const float* vertices, int numVertices, const int* indices, int numTriangleIndices, float radius, float expand);
475 
494 NV_FLEX_API NvFlexExtAsset* NvFlexExtCreateSoftFromMesh(const float* vertices, int numVertices, const int* indices, int numTriangleIndices, float particleSpacing, float volumeSampling, float surfaceSampling, float clusterSpacing, float clusterRadius, float clusterStiffness, float linkRadius, float linkStiffness, float globalStiffness);
495 
500 NV_FLEX_API void NvFlexExtDestroyAsset(NvFlexExtAsset* asset);
501 
514 NV_FLEX_API void NvFlexExtCreateSoftMeshSkinning(const float* vertices, int numVertices, const float* bones, int numBones, float falloff, float maxDistance, float* skinningWeights, int* skinningIndices);
515 
524 NV_FLEX_API NvFlexExtContainer* NvFlexExtCreateContainer(NvFlexLibrary* lib, NvFlexSolver* solver, int maxParticles);
525 
531 NV_FLEX_API void NvFlexExtDestroyContainer(NvFlexExtContainer* container);
532 
540 NV_FLEX_API int NvFlexExtAllocParticles(NvFlexExtContainer* container, int n, int* indices);
541 
549 NV_FLEX_API void NvFlexExtFreeParticles(NvFlexExtContainer* container, int n, const int* indices);
550 
551 
559 NV_FLEX_API int NvFlexExtGetActiveList(NvFlexExtContainer* container, int* indices);
560 
561 
563 {
564  float* particles;
565  float* restParticles;
566  float* velocities;
567  int* phases;
568  float* normals;
569 
570  const float* lower;
571  const float* upper;
572 };
573 
581 NV_FLEX_API void NvFlexExtUnmapParticleData(NvFlexExtContainer* container);
582 
584 {
585  int* indices;
586  float* normals;
587 };
588 
595 
599 NV_FLEX_API void NvFlexExtUnmapTriangleData(NvFlexExtContainer* container);
600 
602 {
603  float* rotations;
604  float* positions;
605  int n;
606 };
607 
614 
618 NV_FLEX_API void NvFlexExtUnmapShapeData(NvFlexExtContainer* container);
619 
635 NV_FLEX_API NvFlexExtInstance* NvFlexExtCreateInstance(NvFlexExtContainer* container, NvFlexExtParticleData* particleData, const NvFlexExtAsset* asset, const float* transform, float vx, float vy, float vz, int phase, float invMassScale);
636 
642 NV_FLEX_API void NvFlexExtDestroyInstance(NvFlexExtContainer* container, const NvFlexExtInstance* instance);
643 
650 NV_FLEX_API void NvFlexExtNotifyAssetChanged(NvFlexExtContainer* container, const NvFlexExtAsset* asset);
651 
681 NV_FLEX_API void NvFlexExtTickContainer(NvFlexExtContainer* container, float dt, int numSubsteps, bool enableTimers=false);
682 
688 NV_FLEX_API void NvFlexExtPushToDevice(NvFlexExtContainer* container);
689 
695 NV_FLEX_API void NvFlexExtPullFromDevice(NvFlexExtContainer* container);
696 
702 NV_FLEX_API void NvFlexExtUpdateInstances(NvFlexExtContainer* container);
703 
704 
709 {
712 
715 
718 };
719 
724 {
725  float mPosition[3];
726  float mRadius;
727  float mStrength;
730 };
731 
737 
746 
753 
761 NV_FLEX_API void NvFlexExtSetForceFields(NvFlexExtForceFieldCallback* callback, const NvFlexExtForceField* forceFields, int numForceFields);
762 
763 
764 
765 } // extern "C"
766 
767 #endif // NV_FLEX_EXT_H
768 
bool mLinearFalloff
Linear or no falloff.
Definition: NvFlexExt.h:729
void destroy()
Definition: NvFlexExt.h:85
int numParticles
Number of particles.
Definition: NvFlexExt.h:314
float * shapeCenters
The position of the center of mass of each shape, an array of vec3s mNumShapes in length...
Definition: NvFlexExt.h:328
NV_FLEX_API void NvFlexExtSetForceFields(NvFlexExtForceFieldCallback *callback, const NvFlexExtForceField *forceFields, int numForceFields)
NV_FLEX_API void NvFlexExtMovingFrameApply(NvFlexExtMovingFrame *frame, float *positions, float *velocities, int numParticles, float linearScale, float angularScale, float dt)
NV_FLEX_API NvFlexExtAsset * NvFlexExtCreateSoftFromMesh(const float *vertices, int numVertices, const int *indices, int numTriangleIndices, float particleSpacing, float volumeSampling, float surfaceSampling, float clusterSpacing, float clusterRadius, float clusterStiffness, float linkRadius, float linkStiffness, float globalStiffness)
float * shapeRotations
Shape matching group rotations (quaternions)
Definition: NvFlexExt.h:355
int n
Number of valid tranforms.
Definition: NvFlexExt.h:605
NvFlexLibrary * lib
Definition: NvFlexExt.h:70
float * particles
Local space particle positions, x,y,z,1/mass.
Definition: NvFlexExt.h:313
int * shapeOffsets
Each entry stores the end of the shape's indices in the indices array (exclusive prefix sum of shape ...
Definition: NvFlexExt.h:326
int newParticleIndex
Definition: NvFlexExt.h:444
NV_FLEX_API void NvFlexUnmap(NvFlexBuffer *buffer)
NV_FLEX_API void NvFlexExtDestroyInstance(NvFlexExtContainer *container, const NvFlexExtInstance *instance)
NV_FLEX_API void NvFlexExtMovingFrameUpdate(NvFlexExtMovingFrame *frame, const float *worldTranslation, const float *worldRotation, float dt)
void init(int size)
Definition: NvFlexExt.h:78
NV_FLEX_API NvFlexExtAsset * NvFlexExtCreateRigidFromMesh(const float *vertices, int numVertices, const int *indices, int numTriangleIndices, float radius, float expand)
float * springRestLengths
Spring rest-lengths.
Definition: NvFlexExt.h:320
int size() const
Definition: NvFlexExt.h:161
NV_FLEX_API void NvFlexExtTickContainer(NvFlexExtContainer *container, float dt, int numSubsteps, bool enableTimers=false)
Definition: NvFlexExt.h:562
int numParticles
Number of simulation particles.
Definition: NvFlexExt.h:348
NV_FLEX_API void NvFlexExtUnmapParticleData(NvFlexExtContainer *container)
struct NvFlexExtContainer NvFlexExtContainer
Definition: NvFlexExt.h:365
T & operator[](int index)
Definition: NvFlexExt.h:127
NvFlexVector(NvFlexLibrary *l, const T *ptr, int size)
Definition: NvFlexExt.h:58
void * userData
User data pointer.
Definition: NvFlexExt.h:359
NV_FLEX_API void NvFlexExtPullFromDevice(NvFlexExtContainer *container)
void resize(int newCount, const T &val)
Definition: NvFlexExt.h:210
int * triangleIndices
Indexed triangle mesh indices for clothing.
Definition: NvFlexExt.h:332
int capacity
Definition: NvFlexExt.h:75
int * particleIndices
Simulation particle indices.
Definition: NvFlexExt.h:347
float mRadius
Radius of the force field.
Definition: NvFlexExt.h:726
int numTriangles
Number of triangles.
Definition: NvFlexExt.h:333
Calling thread will be blocked until buffer is ready for access, default.
Definition: NvFlex.h:69
struct NvFlexSolver NvFlexSolver
Definition: NvFlex.h:57
NV_FLEX_API NvFlexExtAsset * NvFlexExtCreateClothFromMesh(const float *particles, int numParticles, const int *indices, int numTriangles, float stretchStiffness, float bendStiffness, float tetherStiffness, float tetherGive, float pressure)
Definition: NvFlexExt.h:723
int numShapeIndices
Total number of indices for shape constraints.
Definition: NvFlexExt.h:325
NV_FLEX_API void NvFlexExtDestroyTearingCloth(NvFlexExtAsset *asset)
float * rotations
Receives a pointer to the array quaternion rotation data in [x, y z, w] format.
Definition: NvFlexExt.h:603
NV_FLEX_API int NvFlexExtGetActiveList(NvFlexExtContainer *container, int *indices)
int shapeIndex
Index in the container's shape body constraints array.
Definition: NvFlexExt.h:351
Definition: NvFlexExt.h:45
NV_FLEX_API void NvFlexExtDestroyForceFieldCallback(NvFlexExtForceFieldCallback *callback)
NV_FLEX_API void * NvFlexMap(NvFlexBuffer *buffer, int flags)
int * springIndices
Spring indices.
Definition: NvFlexExt.h:318
void reserve(int minCapacity)
Definition: NvFlexExt.h:173
~NvFlexVector()
Definition: NvFlexExt.h:65
int maxParticles
Maximum number of particles, allows extra space for tearable assets which duplicate particles...
Definition: NvFlexExt.h:315
void push_back(const T &t)
Definition: NvFlexExt.h:135
NV_FLEX_API void NvFlexExtDestroyContainer(NvFlexExtContainer *container)
float tau[3]
Definition: NvFlexExt.h:239
float omega[3]
Definition: NvFlexExt.h:236
NV_FLEX_API void NvFlexExtCreateSoftMeshSkinning(const float *vertices, int numVertices, const float *bones, int numBones, float falloff, float maxDistance, float *skinningWeights, int *skinningIndices)
bool empty() const
Definition: NvFlexExt.h:163
Definition: NvFlexExt.h:441
NV_FLEX_API NvFlexExtContainer * NvFlexExtCreateContainer(NvFlexLibrary *lib, NvFlexSolver *solver, int maxParticles)
NV_FLEX_API NvFlexExtInstance * NvFlexExtCreateInstance(NvFlexExtContainer *container, NvFlexExtParticleData *particleData, const NvFlexExtAsset *asset, const float *transform, float vx, float vy, float vz, int phase, float invMassScale)
float rotation[4]
Definition: NvFlexExt.h:233
float inflatableVolume
The rest volume for the inflatable constraint.
Definition: NvFlexExt.h:337
Host mappable buffer, pinned memory on CUDA, staging buffer on DX.
Definition: NvFlex.h:79
NV_FLEX_API void NvFlexExtUnmapShapeData(NvFlexExtContainer *container)
struct NvFlexBuffer NvFlexBuffer
Definition: NvFlex.h:62
NV_FLEX_API NvFlexExtShapeData NvFlexExtMapShapeData(NvFlexExtContainer *container)
Apply field value as an impulse.
Definition: NvFlexExt.h:714
float * particles
Receives a pointer to the particle position / mass data.
Definition: NvFlexExt.h:564
float * springCoefficients
Spring coefficients.
Definition: NvFlexExt.h:319
float * restParticles
Receives a pointer to the particle's rest position (used for self collision culling) ...
Definition: NvFlexExt.h:565
float * positions
Receives a pointer to an array of shape body translations in [x, y, z] format.
Definition: NvFlexExt.h:604
Definition: NvFlexExt.h:230
const T & operator[](int index) const
Definition: NvFlexExt.h:119
void unmap()
Definition: NvFlexExt.h:108
Definition: NvFlexExt.h:345
NV_FLEX_API void NvFlexExtUpdateInstances(NvFlexExtContainer *container)
float mPosition[3]
Center of force field.
Definition: NvFlexExt.h:725
int * indices
Receives a pointer to the array of triangle index data.
Definition: NvFlexExt.h:585
float * normals
Receives a pointer to an array of triangle normal data stored with 16 byte stride, i.e.: [nx, ny, nz].
Definition: NvFlexExt.h:586
NV_FLEX_API void NvFlexExtTearClothMesh(NvFlexExtAsset *asset, float maxStrain, int maxSplits, NvFlexExtTearingParticleClone *particleCopies, int *numParticleCopies, int maxCopies, NvFlexExtTearingMeshEdit *triangleEdits, int *numTriangleEdits, int maxEdits)
float acceleration[3]
Definition: NvFlexExt.h:238
Apply field value as a force.
Definition: NvFlexExt.h:711
float inflatableStiffness
How stiff the inflatable is.
Definition: NvFlexExt.h:339
struct NvFlexLibrary NvFlexLibrary
Definition: NvFlex.h:52
int triIndex
Definition: NvFlexExt.h:443
float * normals
Receives a pointer to the particle normal data with 16 byte stride in format [nx, ny...
Definition: NvFlexExt.h:568
NV_FLEX_API NvFlexExtTriangleData NvFlexExtMapTriangleData(NvFlexExtContainer *container)
int destIndex
Definition: NvFlexExt.h:431
float mStrength
Strength of the force field.
Definition: NvFlexExt.h:727
float position[3]
Definition: NvFlexExt.h:232
void resize(int newCount)
Definition: NvFlexExt.h:200
Definition: NvFlexExt.h:310
NV_FLEX_API void NvFlexExtPushToDevice(NvFlexExtContainer *container)
struct NvFlexExtForceFieldCallback NvFlexExtForceFieldCallback
Definition: NvFlexExt.h:736
int count
Definition: NvFlexExt.h:74
NvFlexExtForceMode
Definition: NvFlexExt.h:708
float * shapeCoefficients
The stiffness coefficient for each shape.
Definition: NvFlexExt.h:327
void map(int flags=eNvFlexMapWait)
Definition: NvFlexExt.h:99
Apply field value as a velocity change.
Definition: NvFlexExt.h:717
NV_FLEX_API NvFlexExtAsset * NvFlexExtCreateTearingClothFromMesh(const float *particles, int numParticles, int maxParticles, const int *indices, int numTriangles, float stretchStiffness, float bendStiffness, float pressure)
Definition: NvFlexExt.h:601
NV_FLEX_API void NvFlexExtMovingFrameInit(NvFlexExtMovingFrame *frame, const float *worldTranslation, const float *worldRotation)
float inflatablePressure
How much over the rest volume the inflatable should attempt to maintain.
Definition: NvFlexExt.h:338
const float * upper
Receive a pointer to the particle upper bounds [x, y, z].
Definition: NvFlexExt.h:571
NV_FLEX_API NvFlexBuffer * NvFlexAllocBuffer(NvFlexLibrary *lib, int elementCount, int elementByteStride, NvFlexBufferType type)
int inflatableIndex
Index in the container's inflatables array.
Definition: NvFlexExt.h:352
NvFlexVector(NvFlexLibrary *l, int size=0)
Definition: NvFlexExt.h:47
NV_FLEX_API void NvFlexExtFreeParticles(NvFlexExtContainer *container, int n, const int *indices)
int * shapeIndices
The indices of the shape matching constraints.
Definition: NvFlexExt.h:324
NV_FLEX_API int NvFlexExtCreateWeldedMeshIndices(const float *vertices, int numVertices, int *uniqueVerts, int *originalToUniqueMap, float threshold)
NV_FLEX_API NvFlexExtParticleData NvFlexExtMapParticleData(NvFlexExtContainer *container)
void assign(const T *srcPtr, int newCount)
Definition: NvFlexExt.h:145
const NvFlexExtAsset * asset
Source asset used to create this instance.
Definition: NvFlexExt.h:357
T * mappedPtr
Definition: NvFlexExt.h:73
float delta[4][4]
Definition: NvFlexExt.h:241
const float * lower
Receive a pointer to the particle lower bounds [x, y, z].
Definition: NvFlexExt.h:570
int triangleIndex
Index in the container's triangle array.
Definition: NvFlexExt.h:350
Definition: NvFlexExt.h:583
NvFlexExtForceMode mMode
Mode of field application.
Definition: NvFlexExt.h:728
NV_FLEX_API int NvFlexExtAllocParticles(NvFlexExtContainer *container, int n, int *indices)
int * phases
Receives a pointer to the particle phase data.
Definition: NvFlexExt.h:567
NV_FLEX_API void NvFlexFreeBuffer(NvFlexBuffer *buf)
int numShapes
The number of shape matching constraints.
Definition: NvFlexExt.h:329
NV_FLEX_API void NvFlexExtUnmapTriangleData(NvFlexExtContainer *container)
void copyto(T *dest, int count)
Definition: NvFlexExt.h:154
NV_FLEX_API void NvFlexExtDestroyAsset(NvFlexExtAsset *asset)
int srcIndex
Definition: NvFlexExt.h:430
float * shapeTranslations
Shape matching group translations (vec3s)
Definition: NvFlexExt.h:354
float velocity[3]
Definition: NvFlexExt.h:235
Definition: NvFlexExt.h:428
NvFlexBuffer * buffer
Definition: NvFlexExt.h:71
float * velocities
Receives a pointer to the particle velocity data.
Definition: NvFlexExt.h:566
const T & back() const
Definition: NvFlexExt.h:165
NV_FLEX_API NvFlexExtForceFieldCallback * NvFlexExtCreateForceFieldCallback(NvFlexSolver *solver)
bool inflatable
Whether an inflatable constraint should be added.
Definition: NvFlexExt.h:336
int numSprings
Number of springs.
Definition: NvFlexExt.h:321
NV_FLEX_API void NvFlexExtNotifyAssetChanged(NvFlexExtContainer *container, const NvFlexExtAsset *asset)