| FLEX 1.1.0

NvFlex.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_H
29 #define NV_FLEX_H
30
32 #if _WIN32
33 #define NV_FLEX_API __declspec(dllexport)
34 #else
35 #define NV_FLEX_API
36 #endif
37
38 // least 2 significant digits define minor version, eg: 10 -> version 0.10
39 #define NV_FLEX_VERSION 110
40
42
47 extern "C" {
48
52 typedef struct NvFlexLibrary NvFlexLibrary;
53
57 typedef struct NvFlexSolver NvFlexSolver;
58
62 typedef struct NvFlexBuffer NvFlexBuffer;
63
67 enum NvFlexMapFlags
68 {
69 eNvFlexMapWait = 0,
70 eNvFlexMapDoNotWait = 1,
71 eNvFlexMapDiscard = 2
72 };
73
77 enum NvFlexBufferType
78 {
79 eNvFlexBufferHost = 0,
80 eNvFlexBufferDevice = 1,
81 };
82
86 enum NvFlexRelaxationMode
87 {
88 eNvFlexRelaxationGlobal = 0,
89 eNvFlexRelaxationLocal = 1
90 };
91
92
96 struct NvFlexParams
97 {
98 int numIterations;
99
100 float gravity[3];
101 float radius;
102 float solidRestDistance;
103 float fluidRestDistance;
104
105 // common params
106 float dynamicFriction;
107 float staticFriction;
108 float particleFriction;
109 float restitution;
110 float adhesion;
111 float sleepThreshold;
112
113 float maxSpeed;
114 float maxAcceleration;
115
116 float shockPropagation;
117 float dissipation;
118 float damping;
119
120 // cloth params
121 float wind[3];
122 float drag;
123 float lift;
124
125 // fluid params
126 bool fluid;
127 float cohesion;
128 float surfaceTension;
129 float viscosity;
130 float vorticityConfinement;
131 float anisotropyScale;
132 float anisotropyMin;
133 float anisotropyMax;
134 float smoothing;
135 float solidPressure;
136 float freeSurfaceDrag;
137 float buoyancy;
138
139 // diffuse params
140 float diffuseThreshold;
141 float diffuseBuoyancy;
142 float diffuseDrag;
143 int diffuseBallistic;
144 float diffuseSortAxis[3];
145 float diffuseLifetime;
146
147 // rigid params
148 float plasticThreshold;
149 float plasticCreep;
150
151 // collision params
152 float collisionDistance;
153 float particleCollisionMargin;
154 float shapeCollisionMargin;
155
156 float planes[8][4];
157 int numPlanes;
158
159 NvFlexRelaxationMode relaxationMode;
160 float relaxationFactor;
161 };
162
166 enum NvFlexPhase
167 {
168 eNvFlexPhaseGroupMask = 0x00ffffff,
169
170 eNvFlexPhaseSelfCollide = 1 << 24,
171 eNvFlexPhaseSelfCollideFilter = 1 << 25,
172 eNvFlexPhaseFluid = 1 << 26,
173 };
174
178 NV_FLEX_API inline int NvFlexMakePhase(int group, int flags) { return (group & eNvFlexPhaseGroupMask) | flags; }
179
180
184 struct NvFlexTimers
185 {
186 float predict;
187 float createCellIndices;
188 float sortCellIndices;
189 float createGrid;
190 float reorder;
191 float collideParticles;
192 float collideShapes;
193 float collideTriangles;
194 float collideFields;
195 float calculateDensity;
196 float solveDensities;
197 float solveVelocities;
198 float solveShapes;
199 float solveSprings;
200 float solveContacts;
201 float solveInflatables;
202 float applyDeltas;
203 float calculateAnisotropy;
204 float updateDiffuse;
205 float updateTriangles;
206 float updateNormals;
207 float finalize;
208 float updateBounds;
209 float total;
210 };
211
215 enum NvFlexErrorSeverity
216 {
217 eNvFlexLogError = 0,
218 eNvFlexLogInfo = 1,
219 eNvFlexLogWarning = 2,
220 eNvFlexLogDebug = 4,
221 eNvFlexLogAll = -1,
222 };
223
224
227 enum NvFlexSolverCallbackStage
228 {
229 eNvFlexStageIterationStart,
230 eNvFlexStageIterationEnd,
231 eNvFlexStageSubstepBegin,
232 eNvFlexStageSubstepEnd,
233 eNvFlexStageUpdateEnd,
234 eNvFlexStageCount,
235 };
236
239 enum NvFlexComputeType
240 {
241 eNvFlexCUDA,
242 eNvFlexD3D11,
243 eNvFlexD3D12,
244 };
245
258 struct NvFlexSolverCallbackParams
259 {
260 NvFlexSolver* solver;
261 void* userData;
262
263 float* particles;
264 float* velocities;
265 int* phases;
266
267 int numActive;
268
269 float dt;
270
271 const int* originalToSortedMap;
272 const int* sortedToOriginalMap;
273 };
274
277 struct NvFlexInitDesc
278 {
279 int deviceIndex;
280 bool enableExtensions;
281 void* renderDevice;
282 void* renderContext;
283
284 NvFlexComputeType computeType;
285 };
286
289 struct NvFlexSolverCallback
290 {
292 void* userData;
293
295 void (*function)(NvFlexSolverCallbackParams params);
296 };
297
301 typedef void (*NvFlexErrorCallback)(NvFlexErrorSeverity type, const char* msg, const char* file, int line);
302
312 NV_FLEX_API NvFlexLibrary* NvFlexInit(int version = NV_FLEX_VERSION, NvFlexErrorCallback errorFunc = 0, NvFlexInitDesc * desc = 0);
313
320 NV_FLEX_API void NvFlexShutdown(NvFlexLibrary* lib);
321
325 NV_FLEX_API int NvFlexGetVersion();
326
335 NV_FLEX_API NvFlexSolver* NvFlexCreateSolver(NvFlexLibrary* lib, int maxParticles, int maxDiffuseParticles, int maxNeighborsPerParticle = 96);
341 NV_FLEX_API void NvFlexDestroySolver(NvFlexSolver* solver);
342
349 NV_FLEX_API NvFlexLibrary* NvFlexGetSolverLibrary(NvFlexSolver* solver);
350
359 NV_FLEX_API NvFlexSolverCallback NvFlexRegisterSolverCallback(NvFlexSolver* solver, NvFlexSolverCallback function, NvFlexSolverCallbackStage stage);
360
420 NV_FLEX_API void NvFlexUpdateSolver(NvFlexSolver* solver, float dt, int substeps, bool enableTimers);
421
428 NV_FLEX_API void NvFlexSetParams(NvFlexSolver* solver, const NvFlexParams* params);
429
437 NV_FLEX_API void NvFlexGetParams(NvFlexSolver* solver, NvFlexParams* params);
438
446 NV_FLEX_API void NvFlexSetActive(NvFlexSolver* solver, NvFlexBuffer* indices, int n);
447
454 NV_FLEX_API void NvFlexGetActive(NvFlexSolver* solver, NvFlexBuffer* indices);
455
462 NV_FLEX_API int NvFlexGetActiveCount(NvFlexSolver* solver);
463
472 NV_FLEX_API void NvFlexSetParticles(NvFlexSolver* solver, NvFlexBuffer* p, int n);
473
481 NV_FLEX_API void NvFlexGetParticles(NvFlexSolver* solver, NvFlexBuffer* p, int n);
482
492 NV_FLEX_API void NvFlexSetRestParticles(NvFlexSolver* solver, NvFlexBuffer* p, int n);
493
502 NV_FLEX_API void NvFlexGetRestParticles(NvFlexSolver* solver, NvFlexBuffer* p, int n);
503
504
512 NV_FLEX_API void NvFlexGetSmoothParticles(NvFlexSolver* solver, NvFlexBuffer* p, int n);
513
522 NV_FLEX_API void NvFlexSetVelocities(NvFlexSolver* solver, NvFlexBuffer* v, int n);
530 NV_FLEX_API void NvFlexGetVelocities(NvFlexSolver* solver, NvFlexBuffer* v, int n);
531
548 NV_FLEX_API void NvFlexSetPhases(NvFlexSolver* solver, NvFlexBuffer* phases, int n);
556 NV_FLEX_API void NvFlexGetPhases(NvFlexSolver* solver, NvFlexBuffer* phases, int n);
557
566 NV_FLEX_API void NvFlexSetNormals(NvFlexSolver* solver, NvFlexBuffer* normals, int n);
567
575 NV_FLEX_API void NvFlexGetNormals(NvFlexSolver* solver, NvFlexBuffer* normals, int n);
576
577
590 NV_FLEX_API void NvFlexSetSprings(NvFlexSolver* solver, NvFlexBuffer* indices, NvFlexBuffer* restLengths, NvFlexBuffer* stiffness, int numSprings);
600 NV_FLEX_API void NvFlexGetSprings(NvFlexSolver* solver, NvFlexBuffer* indices, NvFlexBuffer* restLengths, NvFlexBuffer* stiffness, int numSprings);
601
618 NV_FLEX_API void NvFlexSetRigids(NvFlexSolver* solver, NvFlexBuffer* offsets, NvFlexBuffer* indices, NvFlexBuffer* restPositions, NvFlexBuffer* restNormals, NvFlexBuffer* stiffness, NvFlexBuffer* rotations, NvFlexBuffer* translations, int numRigids, int numIndices);
619
620
628 NV_FLEX_API void NvFlexGetRigidTransforms(NvFlexSolver* solver, NvFlexBuffer* rotations, NvFlexBuffer* translations);
629
633 typedef unsigned int NvFlexTriangleMeshId;
634
638 typedef unsigned int NvFlexDistanceFieldId;
639
645 typedef unsigned int NvFlexConvexMeshId;
646
653 NV_FLEX_API NvFlexTriangleMeshId NvFlexCreateTriangleMesh(NvFlexLibrary* lib);
654
661 NV_FLEX_API void NvFlexDestroyTriangleMesh(NvFlexLibrary* lib, NvFlexTriangleMeshId mesh);
662
676 NV_FLEX_API void NvFlexUpdateTriangleMesh(NvFlexLibrary* lib, NvFlexTriangleMeshId mesh, NvFlexBuffer* vertices, NvFlexBuffer* indices, int numVertices, int numTriangles, const float* lower, const float* upper);
677
686 NV_FLEX_API void NvFlexGetTriangleMeshBounds(NvFlexLibrary* lib, const NvFlexTriangleMeshId mesh, float* lower, float* upper);
687
694 NV_FLEX_API NvFlexDistanceFieldId NvFlexCreateDistanceField(NvFlexLibrary* lib);
695
702 NV_FLEX_API void NvFlexDestroyDistanceField(NvFlexLibrary* lib, NvFlexDistanceFieldId sdf);
703
715 NV_FLEX_API void NvFlexUpdateDistanceField(NvFlexLibrary* lib, NvFlexDistanceFieldId sdf, int dimx, int dimy, int dimz, NvFlexBuffer* field);
716
723 NV_FLEX_API NvFlexConvexMeshId NvFlexCreateConvexMesh(NvFlexLibrary* lib);
724
731 NV_FLEX_API void NvFlexDestroyConvexMesh(NvFlexLibrary* lib, NvFlexConvexMeshId convex);
732
743 NV_FLEX_API void NvFlexUpdateConvexMesh(NvFlexLibrary* lib, NvFlexConvexMeshId convex, NvFlexBuffer* planes, int numPlanes, float* lower, float* upper);
744
753 NV_FLEX_API void NvFlexGetConvexMeshBounds(NvFlexLibrary* lib, NvFlexConvexMeshId mesh, float* lower, float* upper);
754
758 struct NvFlexSphereGeometry
759 {
760 float radius;
761 };
762
766 struct NvFlexCapsuleGeometry
767 {
768 float radius;
769 float halfHeight;
770 };
771
775 struct NvFlexBoxGeometry
776 {
777 float halfExtents[3];
778 };
779
783 struct NvFlexConvexMeshGeometry
784 {
785 float scale[3];
786 NvFlexConvexMeshId mesh;
787 };
788
792 struct NvFlexTriangleMeshGeometry
793 {
794 float scale[3];
795 NvFlexTriangleMeshId mesh;
796 };
797
802 struct NvFlexSDFGeometry
803 {
804 float scale;
805 NvFlexDistanceFieldId field;
806 };
807
812 union NvFlexCollisionGeometry
813 {
814 NvFlexSphereGeometry sphere;
815 NvFlexCapsuleGeometry capsule;
816 NvFlexBoxGeometry box;
817 NvFlexConvexMeshGeometry convexMesh;
818 NvFlexTriangleMeshGeometry triMesh;
819 NvFlexSDFGeometry sdf;
820 };
821
822 enum NvFlexCollisionShapeType
823 {
824 eNvFlexShapeSphere = 0,
825 eNvFlexShapeCapsule = 1,
826 eNvFlexShapeBox = 2,
827 eNvFlexShapeConvexMesh = 3,
828 eNvFlexShapeTriangleMesh = 4,
829 eNvFlexShapeSDF = 5,
830 };
831
832 enum NvFlexCollisionShapeFlags
833 {
834 eNvFlexShapeFlagTypeMask = 0x7,
835 eNvFlexShapeFlagDynamic = 8,
836 eNvFlexShapeFlagTrigger = 16,
837
838 eNvFlexShapeFlagReserved = 0xffffff00
839 };
840
844 NV_FLEX_API inline int NvFlexMakeShapeFlags(NvFlexCollisionShapeType type, bool dynamic) { return type | (dynamic?eNvFlexShapeFlagDynamic:0); }
845
859 NV_FLEX_API void NvFlexSetShapes(NvFlexSolver* solver, NvFlexBuffer* geometry, NvFlexBuffer* shapePositions, NvFlexBuffer* shapeRotations, NvFlexBuffer* shapePrevPositions, NvFlexBuffer* shapePrevRotations, NvFlexBuffer* shapeFlags, int numShapes);
860
871 NV_FLEX_API void NvFlexSetDynamicTriangles(NvFlexSolver* solver, NvFlexBuffer* indices, NvFlexBuffer* normals, int numTris);
880 NV_FLEX_API void NvFlexGetDynamicTriangles(NvFlexSolver* solver, NvFlexBuffer* indices, NvFlexBuffer* normals, int numTris);
881
896 NV_FLEX_API void NvFlexSetInflatables(NvFlexSolver* solver, NvFlexBuffer* startTris, NvFlexBuffer* numTris, NvFlexBuffer* restVolumes, NvFlexBuffer* overPressures, NvFlexBuffer* constraintScales, int numInflatables);
897
905 NV_FLEX_API void NvFlexGetDensities(NvFlexSolver* solver, NvFlexBuffer* densities, int n);
906
920 NV_FLEX_API void NvFlexGetAnisotropy(NvFlexSolver* solver, NvFlexBuffer* q1, NvFlexBuffer* q2, NvFlexBuffer* q3);
930 NV_FLEX_API int NvFlexGetDiffuseParticles(NvFlexSolver* solver, NvFlexBuffer* p, NvFlexBuffer* v, NvFlexBuffer* indices);
931
942 NV_FLEX_API void NvFlexSetDiffuseParticles(NvFlexSolver* solver, NvFlexBuffer* p, NvFlexBuffer* v, int n);
943
953 NV_FLEX_API void NvFlexGetContacts(NvFlexSolver* solver, NvFlexBuffer* planes, NvFlexBuffer* velocities, NvFlexBuffer* indices, NvFlexBuffer* counts);
954
963 NV_FLEX_API void NvFlexGetBounds(NvFlexSolver* solver, NvFlexBuffer* lower, NvFlexBuffer* upper);
964
973 NV_FLEX_API float NvFlexGetDeviceLatency(NvFlexSolver* solver);
974
985 NV_FLEX_API void NvFlexGetTimers(NvFlexSolver* solver, NvFlexTimers* timers);
986
990 struct NvFlexDetailTimer
991 {
992 char* name;
993 float time;
994 };
995
1008 NV_FLEX_API int NvFlexGetDetailTimers(NvFlexSolver* solver, NvFlexDetailTimer** timers);
1009
1019 NV_FLEX_API NvFlexBuffer* NvFlexAllocBuffer(NvFlexLibrary* lib, int elementCount, int elementByteStride, NvFlexBufferType type);
1020
1026 NV_FLEX_API void NvFlexFreeBuffer(NvFlexBuffer* buf);
1027
1037 NV_FLEX_API void* NvFlexMap(NvFlexBuffer* buffer, int flags);
1038
1044 NV_FLEX_API void NvFlexUnmap(NvFlexBuffer* buffer);
1045
1075 NV_FLEX_API NvFlexBuffer* NvFlexRegisterOGLBuffer(NvFlexLibrary* lib, int buf, int elementCount, int elementByteStride);
1076
1082 NV_FLEX_API void NvFlexUnregisterOGLBuffer(NvFlexBuffer* buf);
1083
1093 NV_FLEX_API NvFlexBuffer* NvFlexRegisterD3DBuffer(NvFlexLibrary* lib, void* buffer, int elementCount, int elementByteStride);
1094
1100 NV_FLEX_API void NvFlexUnregisterD3DBuffer(NvFlexBuffer* buf);
1101
1107 NV_FLEX_API void NvFlexAcquireContext(NvFlexLibrary* lib);
1108
1113 NV_FLEX_API void NvFlexRestoreContext(NvFlexLibrary* lib);
1114
1120 NV_FLEX_API const char* NvFlexGetDeviceName(NvFlexLibrary* lib);
1121
1131 NV_FLEX_API void NvFlexGetDeviceAndContext(NvFlexLibrary* lib, void** device, void** context);
1132
1133
1139 NV_FLEX_API void NvFlexFlush(NvFlexLibrary* lib);
1140
1142
1147 NV_FLEX_API void NvFlexSetDebug(NvFlexSolver* solver, bool enable);
1148 NV_FLEX_API void NvFlexGetShapeBVH(NvFlexSolver* solver, void* bvh);
1149 NV_FLEX_API void NvFlexCopySolver(NvFlexSolver* dst, NvFlexSolver* src);
1150
1152
1153 } // extern "C"
1154
1155 #endif // NV_FLEX_H
NvFlexGetActiveCount
NV_FLEX_API int NvFlexGetActiveCount(NvFlexSolver *solver)
NvFlexTimers::solveShapes
float solveShapes
Time spent solving rigid body constraints.
Definition: NvFlex.h:198
NvFlexRegisterSolverCallback
NV_FLEX_API NvFlexSolverCallback NvFlexRegisterSolverCallback(NvFlexSolver *solver, NvFlexSolverCallback function, NvFlexSolverCallbackStage stage)
NvFlexSphereGeometry::radius
float radius
Definition: NvFlex.h:760
eNvFlexLogWarning
Warning messages.
Definition: NvFlex.h:219
NvFlexTimers::solveSprings
float solveSprings
Time spent solving distance constraints.
Definition: NvFlex.h:199
NvFlexMapFlags
NvFlexMapFlags
Definition: NvFlex.h:67
NvFlexGetRestParticles
NV_FLEX_API void NvFlexGetRestParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
NvFlexErrorCallback
void(* NvFlexErrorCallback)(NvFlexErrorSeverity type, const char *msg, const char *file, int line)
Definition: NvFlex.h:301
eNvFlexLogInfo
Information messages.
Definition: NvFlex.h:218
NvFlexParams::smoothing
float smoothing
Control the strength of Laplacian smoothing in particles for rendering, if zero then smoothed positio...
Definition: NvFlex.h:134
NvFlexSetParams
NV_FLEX_API void NvFlexSetParams(NvFlexSolver *solver, const NvFlexParams *params)
eNvFlexStageUpdateEnd
Called at the end of solver update after the final substep has completed.
Definition: NvFlex.h:233
NvFlexSetRigids
NV_FLEX_API void NvFlexSetRigids(NvFlexSolver *solver, NvFlexBuffer *offsets, NvFlexBuffer *indices, NvFlexBuffer *restPositions, NvFlexBuffer *restNormals, NvFlexBuffer *stiffness, NvFlexBuffer *rotations, NvFlexBuffer *translations, int numRigids, int numIndices)
NvFlexGetSmoothParticles
NV_FLEX_API void NvFlexGetSmoothParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
NvFlexUpdateTriangleMesh
NV_FLEX_API void NvFlexUpdateTriangleMesh(NvFlexLibrary *lib, NvFlexTriangleMeshId mesh, NvFlexBuffer *vertices, NvFlexBuffer *indices, int numVertices, int numTriangles, const float *lower, const float *upper)
NvFlexUnmap
NV_FLEX_API void NvFlexUnmap(NvFlexBuffer *buffer)
eNvFlexPhaseSelfCollide
If set this particle will interact with particles of the same group.
Definition: NvFlex.h:170
NvFlexTimers::createCellIndices
float createCellIndices
Time spent creating grid indices.
Definition: NvFlex.h:187
NvFlexParams::shapeCollisionMargin
float shapeCollisionMargin
Increases the radius used during contact finding against kinematic shapes.
Definition: NvFlex.h:154
NvFlexSDFGeometry::scale
float scale
Uniform scale of SDF, this corresponds to the world space width of the shape.
Definition: NvFlex.h:804
NvFlexGetActive
NV_FLEX_API void NvFlexGetActive(NvFlexSolver *solver, NvFlexBuffer *indices)
NvFlexParams::diffuseBallistic
int diffuseBallistic
The number of neighbors below which a diffuse particle is considered ballistic.
Definition: NvFlex.h:143
NvFlexRelaxationMode
NvFlexRelaxationMode
Definition: NvFlex.h:86
NvFlexParams::drag
float drag
Drag force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in th...
Definition: NvFlex.h:122
NvFlexErrorSeverity
NvFlexErrorSeverity
Definition: NvFlex.h:215
NvFlexParams::maxSpeed
float maxSpeed
The magnitude of particle velocity will be clamped to this value at the end of each step...
Definition: NvFlex.h:113
NvFlexParams::planes
float planes[8][4]
Collision planes in the form ax + by + cz + d = 0.
Definition: NvFlex.h:156
NvFlexParams::cohesion
float cohesion
Control how strongly particles hold each other together, default: 0.025, range [0.0, +inf].
Definition: NvFlex.h:127
NvFlexParams::staticFriction
float staticFriction
Coefficient of static friction used when colliding against shapes.
Definition: NvFlex.h:107
NvFlexTimers::collideParticles
float collideParticles
Time spent finding particle neighbors.
Definition: NvFlex.h:191
NvFlexCollisionGeometry::capsule
NvFlexCapsuleGeometry capsule
Definition: NvFlex.h:815
NvFlexTimers::predict
float predict
Time spent in prediction.
Definition: NvFlex.h:186
NvFlexConvexMeshGeometry
Definition: NvFlex.h:783
NvFlexTimers::updateDiffuse
float updateDiffuse
Time spent updating diffuse particles.
Definition: NvFlex.h:204
NvFlexCollisionGeometry::sphere
NvFlexSphereGeometry sphere
Definition: NvFlex.h:814
NvFlexParams::collisionDistance
float collisionDistance
Distance particles maintain against shapes, note that for robust collision against triangle meshes th...
Definition: NvFlex.h:152
NvFlexCollisionGeometry::triMesh
NvFlexTriangleMeshGeometry triMesh
Definition: NvFlex.h:818
NvFlexTimers::solveContacts
float solveContacts
Time spent solving contact constraints.
Definition: NvFlex.h:200
eNvFlexShapeFlagReserved
Definition: NvFlex.h:838
NvFlexInitDesc::computeType
NvFlexComputeType computeType
Set to eNvFlexD3D11 if DirectX 11 should be used, eNvFlexD3D12 for DirectX 12, this must match the li...
Definition: NvFlex.h:284
NvFlexDestroyDistanceField
NV_FLEX_API void NvFlexDestroyDistanceField(NvFlexLibrary *lib, NvFlexDistanceFieldId sdf)
eNvFlexD3D11
Use DirectX 11 compute for Flex, the application must link against the D3D libraries.
Definition: NvFlex.h:242
NvFlexDestroySolver
NV_FLEX_API void NvFlexDestroySolver(NvFlexSolver *solver)
eNvFlexShapeFlagTypeMask
Lower 3 bits holds the type of the collision shape.
Definition: NvFlex.h:834
NvFlexSolverCallbackParams::originalToSortedMap
const int * originalToSortedMap
Device pointer that maps the sorted callback data to the original position given by SetParticles() ...
Definition: NvFlex.h:271
NvFlexCapsuleGeometry::halfHeight
float halfHeight
Definition: NvFlex.h:769
eNvFlexMapWait
Calling thread will be blocked until buffer is ready for access, default.
Definition: NvFlex.h:69
NvFlexSetDiffuseParticles
NV_FLEX_API void NvFlexSetDiffuseParticles(NvFlexSolver *solver, NvFlexBuffer *p, NvFlexBuffer *v, int n)
NvFlexSolver
struct NvFlexSolver NvFlexSolver
Definition: NvFlex.h:57
eNvFlexStageSubstepEnd
Called at the end of each substep after the velocity has been updated by the constraints.
Definition: NvFlex.h:232
NvFlexSolverCallbackParams::particles
float * particles
Device pointer to the active particle basic data in the form x,y,z,1/m.
Definition: NvFlex.h:263
NvFlexSetInflatables
NV_FLEX_API void NvFlexSetInflatables(NvFlexSolver *solver, NvFlexBuffer *startTris, NvFlexBuffer *numTris, NvFlexBuffer *restVolumes, NvFlexBuffer *overPressures, NvFlexBuffer *constraintScales, int numInflatables)
NvFlexSphereGeometry
Definition: NvFlex.h:758
eNvFlexStageIterationStart
Called at the beginning of each constraint iteration.
Definition: NvFlex.h:229
NvFlexGetTriangleMeshBounds
NV_FLEX_API void NvFlexGetTriangleMeshBounds(NvFlexLibrary *lib, const NvFlexTriangleMeshId mesh, float *lower, float *upper)
NvFlexSolverCallbackParams
Definition: NvFlex.h:258
NvFlexCreateConvexMesh
NV_FLEX_API NvFlexConvexMeshId NvFlexCreateConvexMesh(NvFlexLibrary *lib)
NvFlexMap
NV_FLEX_API void * NvFlexMap(NvFlexBuffer *buffer, int flags)
NvFlexDetailTimer::time
float time
Definition: NvFlex.h:993
NvFlexCollisionGeometry
Definition: NvFlex.h:812
NvFlexTimers::updateNormals
float updateNormals
Time spent updating vertex normals.
Definition: NvFlex.h:206
NvFlexTriangleMeshId
unsigned int NvFlexTriangleMeshId
Definition: NvFlex.h:633
eNvFlexRelaxationLocal
The relaxation factor is a fixed multiplier on each constraint's delta divided by the particle's cons...
Definition: NvFlex.h:89
NvFlexRegisterD3DBuffer
NV_FLEX_API NvFlexBuffer * NvFlexRegisterD3DBuffer(NvFlexLibrary *lib, void *buffer, int elementCount, int elementByteStride)
eNvFlexMapDiscard
Buffer contents will be discarded, this allows for efficent buffer reuse.
Definition: NvFlex.h:71
eNvFlexShapeFlagTrigger
Indicates that the shape is a trigger volume, this means it will not perform any collision response...
Definition: NvFlex.h:836
eNvFlexShapeSphere
A sphere shape, see FlexSphereGeometry.
Definition: NvFlex.h:824
eNvFlexShapeSDF
A signed distance field shape, see FlexSDFGeometry.
Definition: NvFlex.h:829
NvFlexInitDesc::deviceIndex
int deviceIndex
The GPU device index that should be used, if there is already a CUDA context on the calling thread th...
Definition: NvFlex.h:279
NvFlexParams::fluid
bool fluid
If true then particles with phase 0 are considered fluid particles and interact using the position ba...
Definition: NvFlex.h:126
NvFlexParams::viscosity
float viscosity
Smoothes particle velocities using XSPH viscosity.
Definition: NvFlex.h:129
NvFlexTriangleMeshGeometry::mesh
NvFlexTriangleMeshId mesh
A triangle mesh pointer created by NvFlexCreateTriangleMesh()
Definition: NvFlex.h:795
NvFlexGetVelocities
NV_FLEX_API void NvFlexGetVelocities(NvFlexSolver *solver, NvFlexBuffer *v, int n)
NvFlexMakePhase
NV_FLEX_API int NvFlexMakePhase(int group, int flags)
Definition: NvFlex.h:178
NvFlexParams::adhesion
float adhesion
Controls how strongly particles stick to surfaces they hit, default 0.0, range [0.0, +inf].
Definition: NvFlex.h:110
NvFlexUnregisterOGLBuffer
NV_FLEX_API void NvFlexUnregisterOGLBuffer(NvFlexBuffer *buf)
NvFlexBoxGeometry::halfExtents
float halfExtents[3]
Definition: NvFlex.h:777
NvFlexBoxGeometry
Definition: NvFlex.h:775
NvFlexGetPhases
NV_FLEX_API void NvFlexGetPhases(NvFlexSolver *solver, NvFlexBuffer *phases, int n)
NvFlexCreateDistanceField
NV_FLEX_API NvFlexDistanceFieldId NvFlexCreateDistanceField(NvFlexLibrary *lib)
NvFlexSolverCallbackParams::phases
int * phases
Device pointer to the active particle phase data.
Definition: NvFlex.h:265
NvFlexFlush
NV_FLEX_API void NvFlexFlush(NvFlexLibrary *lib)
NvFlexGetBounds
NV_FLEX_API void NvFlexGetBounds(NvFlexSolver *solver, NvFlexBuffer *lower, NvFlexBuffer *upper)
eNvFlexBufferHost
Host mappable buffer, pinned memory on CUDA, staging buffer on DX.
Definition: NvFlex.h:79
NvFlexSolverCallbackParams::numActive
int numActive
The number of active particles returned, the callback data only return pointers to active particle da...
Definition: NvFlex.h:267
NvFlexGetSolverLibrary
NV_FLEX_API NvFlexLibrary * NvFlexGetSolverLibrary(NvFlexSolver *solver)
NvFlexBuffer
struct NvFlexBuffer NvFlexBuffer
Definition: NvFlex.h:62
NvFlexTimers::sortCellIndices
float sortCellIndices
Time spent sorting grid indices.
Definition: NvFlex.h:188
NvFlexParams::radius
float radius
The maximum interaction radius for particles.
Definition: NvFlex.h:101
NvFlexGetContacts
NV_FLEX_API void NvFlexGetContacts(NvFlexSolver *solver, NvFlexBuffer *planes, NvFlexBuffer *velocities, NvFlexBuffer *indices, NvFlexBuffer *counts)
NvFlexCollisionGeometry::box
NvFlexBoxGeometry box
Definition: NvFlex.h:816
NvFlexSolverCallbackParams::velocities
float * velocities
Device pointer to the active particle velocity data in the form x,y,z,w (last component is not used) ...
Definition: NvFlex.h:264
NvFlexParams::anisotropyMin
float anisotropyMin
Clamp the anisotropy scale to this fraction of the radius.
Definition: NvFlex.h:132
NvFlexTimers::applyDeltas
float applyDeltas
Time spent adding position deltas to particles.
Definition: NvFlex.h:202
NvFlexSDFGeometry::field
NvFlexDistanceFieldId field
A signed distance field pointer created by NvFlexCreateDistanceField()
Definition: NvFlex.h:805
NvFlexTimers::calculateDensity
float calculateDensity
Time spent calculating fluid density.
Definition: NvFlex.h:195
NvFlexSolverCallback::userData
void * userData
Definition: NvFlex.h:292
eNvFlexShapeCapsule
A capsule shape, see FlexCapsuleGeometry.
Definition: NvFlex.h:825
NvFlexCreateTriangleMesh
NV_FLEX_API NvFlexTriangleMeshId NvFlexCreateTriangleMesh(NvFlexLibrary *lib)
NvFlexSetRestParticles
NV_FLEX_API void NvFlexSetRestParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
NvFlexShutdown
NV_FLEX_API void NvFlexShutdown(NvFlexLibrary *lib)
NvFlexSolverCallbackParams::solver
NvFlexSolver * solver
Pointer to the solver that the callback is registered to.
Definition: NvFlex.h:260
eNvFlexPhaseFluid
If set this particle will generate fluid density constraints for its overlapping neighbors.
Definition: NvFlex.h:172
NvFlexPhase
NvFlexPhase
Definition: NvFlex.h:166
NvFlexUnregisterD3DBuffer
NV_FLEX_API void NvFlexUnregisterD3DBuffer(NvFlexBuffer *buf)
NvFlexParams::sleepThreshold
float sleepThreshold
Particles with a velocity magnitude < this threshold will be considered fixed.
Definition: NvFlex.h:111
NvFlexGetDensities
NV_FLEX_API void NvFlexGetDensities(NvFlexSolver *solver, NvFlexBuffer *densities, int n)
NvFlexGetVersion
NV_FLEX_API int NvFlexGetVersion()
NvFlexParams::anisotropyMax
float anisotropyMax
Clamp the anisotropy scale to this fraction of the radius.
Definition: NvFlex.h:133
NvFlexTimers::collideTriangles
float collideTriangles
Time spent colliding triangle shapes.
Definition: NvFlex.h:193
NvFlexGetDetailTimers
NV_FLEX_API int NvFlexGetDetailTimers(NvFlexSolver *solver, NvFlexDetailTimer **timers)
NvFlexSetVelocities
NV_FLEX_API void NvFlexSetVelocities(NvFlexSolver *solver, NvFlexBuffer *v, int n)
NvFlexGetConvexMeshBounds
NV_FLEX_API void NvFlexGetConvexMeshBounds(NvFlexLibrary *lib, NvFlexConvexMeshId mesh, float *lower, float *upper)
eNvFlexShapeFlagDynamic
Indicates the shape is dynamic and should have lower priority over static collision shapes...
Definition: NvFlex.h:835
eNvFlexMapDoNotWait
Calling thread will check if buffer is ready for access, if not ready then the method will return NUL...
Definition: NvFlex.h:70
NvFlexGetNormals
NV_FLEX_API void NvFlexGetNormals(NvFlexSolver *solver, NvFlexBuffer *normals, int n)
NvFlexParams::shockPropagation
float shockPropagation
Artificially decrease the mass of particles based on height from a fixed reference point...
Definition: NvFlex.h:116
NvFlexGetDeviceName
NV_FLEX_API const char * NvFlexGetDeviceName(NvFlexLibrary *lib)
NvFlexDestroyConvexMesh
NV_FLEX_API void NvFlexDestroyConvexMesh(NvFlexLibrary *lib, NvFlexConvexMeshId convex)
NvFlexTimers::collideFields
float collideFields
Time spent colliding signed distance field shapes.
Definition: NvFlex.h:194
NvFlexTimers::calculateAnisotropy
float calculateAnisotropy
Time spent calculating particle anisotropy for fluid.
Definition: NvFlex.h:203
NvFlexInitDesc::renderContext
void * renderContext
Direct3D context to use for simulation, if none is specified a new context will be created...
Definition: NvFlex.h:282
NvFlexLibrary
struct NvFlexLibrary NvFlexLibrary
Definition: NvFlex.h:52
NvFlexAcquireContext
NV_FLEX_API void NvFlexAcquireContext(NvFlexLibrary *lib)
NvFlexInit
NV_FLEX_API NvFlexLibrary * NvFlexInit(int version=NV_FLEX_VERSION, NvFlexErrorCallback errorFunc=0, NvFlexInitDesc *desc=0)
NvFlexParams::freeSurfaceDrag
float freeSurfaceDrag
Drag force applied to boundary fluid particles.
Definition: NvFlex.h:136
NvFlexGetDeviceLatency
NV_FLEX_API float NvFlexGetDeviceLatency(NvFlexSolver *solver)
NvFlexCollisionGeometry::sdf
NvFlexSDFGeometry sdf
Definition: NvFlex.h:819
NvFlexParams::maxAcceleration
float maxAcceleration
The magnitude of particle acceleration will be clamped to this value at the end of each step (limits ...
Definition: NvFlex.h:114
NvFlexParams::wind
float wind[3]
Constant acceleration applied to particles that belong to dynamic triangles, drag needs to be > 0 for...
Definition: NvFlex.h:121
NvFlexUpdateDistanceField
NV_FLEX_API void NvFlexUpdateDistanceField(NvFlexLibrary *lib, NvFlexDistanceFieldId sdf, int dimx, int dimy, int dimz, NvFlexBuffer *field)
NvFlexTimers
Definition: NvFlex.h:184
NvFlexParams::surfaceTension
float surfaceTension
Controls how strongly particles attempt to minimize surface area, default: 0.0, range: [0...
Definition: NvFlex.h:128
NvFlexSolverCallbackParams::dt
float dt
The per-update time-step, this is the value passed to NvFlexUpdateSolver()
Definition: NvFlex.h:269
NvFlexParams::diffuseSortAxis
float diffuseSortAxis[3]
Diffuse particles will be sorted by depth along this axis if non-zero.
Definition: NvFlex.h:144
NvFlexParams::fluidRestDistance
float fluidRestDistance
The distance fluid particles are spaced at the rest density, must be in the range (0...
Definition: NvFlex.h:103
NvFlexTimers::reorder
float reorder
Time spent reordering particles.
Definition: NvFlex.h:190
NvFlexDistanceFieldId
unsigned int NvFlexDistanceFieldId
Definition: NvFlex.h:638
eNvFlexShapeTriangleMesh
A triangle mesh shape, see FlexTriangleMeshGeometry.
Definition: NvFlex.h:828
eNvFlexPhaseSelfCollideFilter
If set this particle will ignore collisions with particles closer than the radius in the rest pose...
Definition: NvFlex.h:171
NvFlexGetAnisotropy
NV_FLEX_API void NvFlexGetAnisotropy(NvFlexSolver *solver, NvFlexBuffer *q1, NvFlexBuffer *q2, NvFlexBuffer *q3)
NvFlexGetTimers
NV_FLEX_API void NvFlexGetTimers(NvFlexSolver *solver, NvFlexTimers *timers)
NvFlexConvexMeshGeometry::mesh
NvFlexConvexMeshId mesh
Definition: NvFlex.h:786
NvFlexCollisionGeometry::convexMesh
NvFlexConvexMeshGeometry convexMesh
Definition: NvFlex.h:817
NvFlexSolverCallbackStage
NvFlexSolverCallbackStage
Definition: NvFlex.h:227
NvFlexParams::dissipation
float dissipation
Damps particle velocity based on how many particle contacts it has.
Definition: NvFlex.h:117
NvFlexCollisionShapeType
NvFlexCollisionShapeType
Definition: NvFlex.h:822
eNvFlexLogDebug
Used only in debug version of dll.
Definition: NvFlex.h:220
eNvFlexCUDA
Use CUDA compute for Flex, the application must link against the CUDA libraries.
Definition: NvFlex.h:241
NvFlexParams::relaxationMode
NvFlexRelaxationMode relaxationMode
How the relaxation is applied inside the solver.
Definition: NvFlex.h:159
NvFlexParams::lift
float lift
Lift force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in th...
Definition: NvFlex.h:123
NvFlexGetDeviceAndContext
NV_FLEX_API void NvFlexGetDeviceAndContext(NvFlexLibrary *lib, void **device, void **context)
NvFlexInitDesc::renderDevice
void * renderDevice
Direct3D device to use for simulation, if none is specified a new device and context will be created...
Definition: NvFlex.h:281
eNvFlexShapeBox
A box shape, see FlexBoxGeometry.
Definition: NvFlex.h:826
NvFlexParams::damping
float damping
Viscous drag force, applies a force proportional, and opposite to the particle velocity.
Definition: NvFlex.h:118
NvFlexSetDynamicTriangles
NV_FLEX_API void NvFlexSetDynamicTriangles(NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *normals, int numTris)
NvFlexCollisionShapeFlags
NvFlexCollisionShapeFlags
Definition: NvFlex.h:832
NvFlexParams::numPlanes
int numPlanes
Num collision planes.
Definition: NvFlex.h:157
NvFlexUpdateConvexMesh
NV_FLEX_API void NvFlexUpdateConvexMesh(NvFlexLibrary *lib, NvFlexConvexMeshId convex, NvFlexBuffer *planes, int numPlanes, float *lower, float *upper)
NvFlexAllocBuffer
NV_FLEX_API NvFlexBuffer * NvFlexAllocBuffer(NvFlexLibrary *lib, int elementCount, int elementByteStride, NvFlexBufferType type)
NvFlexParams
Definition: NvFlex.h:96
NvFlexTimers::collideShapes
float collideShapes
Time spent colliding convex shapes.
Definition: NvFlex.h:192
NvFlexParams::particleFriction
float particleFriction
Coefficient of friction used when colliding particles.
Definition: NvFlex.h:108
NvFlexUpdateSolver
NV_FLEX_API void NvFlexUpdateSolver(NvFlexSolver *solver, float dt, int substeps, bool enableTimers)
NvFlexSetNormals
NV_FLEX_API void NvFlexSetNormals(NvFlexSolver *solver, NvFlexBuffer *normals, int n)
NvFlexGetRigidTransforms
NV_FLEX_API void NvFlexGetRigidTransforms(NvFlexSolver *solver, NvFlexBuffer *rotations, NvFlexBuffer *translations)
NvFlexTimers::createGrid
float createGrid
Time spent creating grid.
Definition: NvFlex.h:189
eNvFlexPhaseGroupMask
Low 24 bits represent the particle group for controlling collisions.
Definition: NvFlex.h:168
NvFlexGetParticles
NV_FLEX_API void NvFlexGetParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
NvFlexParams::buoyancy
float buoyancy
Gravity is scaled by this value for fluid particles.
Definition: NvFlex.h:137
eNvFlexLogAll
All log types.
Definition: NvFlex.h:221
NvFlexSetShapes
NV_FLEX_API void NvFlexSetShapes(NvFlexSolver *solver, NvFlexBuffer *geometry, NvFlexBuffer *shapePositions, NvFlexBuffer *shapeRotations, NvFlexBuffer *shapePrevPositions, NvFlexBuffer *shapePrevRotations, NvFlexBuffer *shapeFlags, int numShapes)
NvFlexSetParticles
NV_FLEX_API void NvFlexSetParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
eNvFlexD3D12
Use DirectX 12 compute for Flex, the application must link against the D3D libraries.
Definition: NvFlex.h:243
NvFlexTriangleMeshGeometry::scale
float scale[3]
The scale of the object from local space to world space.
Definition: NvFlex.h:794
NvFlexTimers::solveDensities
float solveDensities
Time spent solving density constraints.
Definition: NvFlex.h:196
NvFlexParams::plasticThreshold
float plasticThreshold
Particles belonging to rigid shapes that move with a position delta magnitude > threshold will be per...
Definition: NvFlex.h:148
NvFlexDestroyTriangleMesh
NV_FLEX_API void NvFlexDestroyTriangleMesh(NvFlexLibrary *lib, NvFlexTriangleMeshId mesh)
NvFlexParams::gravity
float gravity[3]
Constant acceleration applied to all particles.
Definition: NvFlex.h:100
eNvFlexStageIterationEnd
Called at the end of each constraint iteration.
Definition: NvFlex.h:230
eNvFlexLogError
Error messages.
Definition: NvFlex.h:217
NvFlexFreeBuffer
NV_FLEX_API void NvFlexFreeBuffer(NvFlexBuffer *buf)
NvFlexTimers::solveInflatables
float solveInflatables
Time spent solving pressure constraints.
Definition: NvFlex.h:201
eNvFlexStageSubstepBegin
Called at the beginning of each substep after the prediction step has been completed.
Definition: NvFlex.h:231
NvFlexSetPhases
NV_FLEX_API void NvFlexSetPhases(NvFlexSolver *solver, NvFlexBuffer *phases, int n)
NvFlexInitDesc
Definition: NvFlex.h:277
eNvFlexRelaxationGlobal
The relaxation factor is a fixed multiplier on each constraint's position delta.
Definition: NvFlex.h:88
NvFlexCapsuleGeometry
Definition: NvFlex.h:766
NvFlexTimers::total
float total
Sum of all timers above.
Definition: NvFlex.h:209
NvFlexSolverCallbackParams::userData
void * userData
Pointer to the user data provided to NvFlexRegisterSolverCallback()
Definition: NvFlex.h:261
NvFlexCapsuleGeometry::radius
float radius
Definition: NvFlex.h:768
NvFlexGetDynamicTriangles
NV_FLEX_API void NvFlexGetDynamicTriangles(NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *normals, int numTris)
NvFlexMakeShapeFlags
NV_FLEX_API int NvFlexMakeShapeFlags(NvFlexCollisionShapeType type, bool dynamic)
Definition: NvFlex.h:844
NvFlexRegisterOGLBuffer
NV_FLEX_API NvFlexBuffer * NvFlexRegisterOGLBuffer(NvFlexLibrary *lib, int buf, int elementCount, int elementByteStride)
NvFlexDetailTimer
Definition: NvFlex.h:990
NvFlexParams::relaxationFactor
float relaxationFactor
Control the convergence rate of the parallel solver, default: 1, values greater than 1 may lead to in...
Definition: NvFlex.h:160
NvFlexSetSprings
NV_FLEX_API void NvFlexSetSprings(NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *restLengths, NvFlexBuffer *stiffness, int numSprings)
NvFlexTimers::finalize
float finalize
Time spent finalizing state.
Definition: NvFlex.h:207
NvFlexSolverCallbackParams::sortedToOriginalMap
const int * sortedToOriginalMap
Device pointer that maps the original particle index to the index in the callback data structure...
Definition: NvFlex.h:272
NvFlexComputeType
NvFlexComputeType
Definition: NvFlex.h:239
NvFlexSetActive
NV_FLEX_API void NvFlexSetActive(NvFlexSolver *solver, NvFlexBuffer *indices, int n)
NvFlexParams::dynamicFriction
float dynamicFriction
Coefficient of friction used when colliding against shapes.
Definition: NvFlex.h:106
NvFlexParams::plasticCreep
float plasticCreep
Controls the rate at which particles in the rest pose are deformed for particles passing the deformat...
Definition: NvFlex.h:149
NvFlexSDFGeometry
Definition: NvFlex.h:802
NvFlexConvexMeshGeometry::scale
float scale[3]
Definition: NvFlex.h:785
NvFlexSolverCallback
Definition: NvFlex.h:289
NvFlexParams::diffuseBuoyancy
float diffuseBuoyancy
Scales force opposing gravity that diffuse particles receive.
Definition: NvFlex.h:141
NvFlexTimers::updateBounds
float updateBounds
Time spent updating particle bounds.
Definition: NvFlex.h:208
NvFlexDetailTimer::name
char * name
Definition: NvFlex.h:992
NvFlexParams::solidRestDistance
float solidRestDistance
The distance non-fluid particles attempt to maintain from each other, must be in the range (0...
Definition: NvFlex.h:102
NvFlexParams::solidPressure
float solidPressure
Add pressure from solid surfaces to particles.
Definition: NvFlex.h:135
NvFlexTimers::solveVelocities
float solveVelocities
Time spent solving velocity constraints.
Definition: NvFlex.h:197
eNvFlexStageCount
Number of stages.
Definition: NvFlex.h:234
NvFlexParams::restitution
float restitution
Coefficient of restitution used when colliding against shapes, particle collisions are always inelast...
Definition: NvFlex.h:109
NvFlexTriangleMeshGeometry
Definition: NvFlex.h:792
NvFlexParams::numIterations
int numIterations
Number of solver iterations to perform per-substep.
Definition: NvFlex.h:98
NvFlexRestoreContext
NV_FLEX_API void NvFlexRestoreContext(NvFlexLibrary *lib)
NvFlexGetParams
NV_FLEX_API void NvFlexGetParams(NvFlexSolver *solver, NvFlexParams *params)
NvFlexCreateSolver
NV_FLEX_API NvFlexSolver * NvFlexCreateSolver(NvFlexLibrary *lib, int maxParticles, int maxDiffuseParticles, int maxNeighborsPerParticle=96)
NvFlexParams::anisotropyScale
float anisotropyScale
Control how much anisotropy is present in resulting ellipsoids for rendering, if zero then anisotropy...
Definition: NvFlex.h:131
NvFlexParams::vorticityConfinement
float vorticityConfinement
Increases vorticity by applying rotational forces to particles.
Definition: NvFlex.h:130
NvFlexGetDiffuseParticles
NV_FLEX_API int NvFlexGetDiffuseParticles(NvFlexSolver *solver, NvFlexBuffer *p, NvFlexBuffer *v, NvFlexBuffer *indices)
NvFlexParams::diffuseLifetime
float diffuseLifetime
Time in seconds that a diffuse particle will live for after being spawned, particles will be spawned ...
Definition: NvFlex.h:145
NvFlexParams::diffuseDrag
float diffuseDrag
Scales force diffuse particles receive in direction of neighbor fluid particles.
Definition: NvFlex.h:142
NvFlexParams::particleCollisionMargin
float particleCollisionMargin
Increases the radius used during neighbor finding, this is useful if particles are expected to move s...
Definition: NvFlex.h:153
NvFlexParams::diffuseThreshold
float diffuseThreshold
Particles with kinetic energy + divergence above this threshold will spawn new diffuse particles...
Definition: NvFlex.h:140
eNvFlexBufferDevice
Device memory buffer, mapping this on CUDA will return a device memory pointer, and will return a buf...
Definition: NvFlex.h:80
NvFlexGetSprings
NV_FLEX_API void NvFlexGetSprings(NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *restLengths, NvFlexBuffer *stiffness, int numSprings)
eNvFlexShapeConvexMesh
A convex mesh shape, see FlexConvexMeshGeometry.
Definition: NvFlex.h:827
NvFlexTimers::updateTriangles
float updateTriangles
Time spent updating dynamic triangles.
Definition: NvFlex.h:205
NvFlexBufferType
NvFlexBufferType
Definition: NvFlex.h:77
NvFlexInitDesc::enableExtensions
bool enableExtensions
Enable or disable NVIDIA/AMD extensions in DirectX, can lead to improved performance.
Definition: NvFlex.h:280
NvFlexConvexMeshId
unsigned int NvFlexConvexMeshId
Definition: NvFlex.h:645