From 688b5f42e9bfe498d7af7075d4d8f4429867f3a3 Mon Sep 17 00:00:00 2001 From: Miles Macklin Date: Fri, 9 Jun 2017 13:41:15 +1200 Subject: 1.2.0.beta.1 --- doc/_static/api/_nv_flex_8h.html | 942 +++++++++++---- doc/_static/api/_nv_flex_8h_source.html | 1227 +++++++++++--------- doc/_static/api/_nv_flex_device_8h.html | 4 +- doc/_static/api/_nv_flex_device_8h_source.html | 4 +- doc/_static/api/_nv_flex_ext_8h.html | 42 +- doc/_static/api/_nv_flex_ext_8h_source.html | 905 ++++++++------- .../api/dir_d44c64559bbebec7f509842c48db8b23.html | 4 +- doc/_static/api/files.html | 4 +- doc/_static/api/globals.html | 121 +- doc/_static/api/globals_enum.html | 7 +- doc/_static/api/globals_eval.html | 49 +- doc/_static/api/globals_func.html | 73 +- doc/_static/api/globals_type.html | 4 +- doc/_static/api/index.html | 4 +- .../api/struct_nv_flex_solver_callback.html | 4 +- doc/_static/api/struct_nv_flex_vector.html | 48 +- 16 files changed, 2122 insertions(+), 1320 deletions(-) (limited to 'doc/_static/api') diff --git a/doc/_static/api/_nv_flex_8h.html b/doc/_static/api/_nv_flex_8h.html index 837b040..ca04c36 100644 --- a/doc/_static/api/_nv_flex_8h.html +++ b/doc/_static/api/_nv_flex_8h.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -55,10 +55,14 @@ Data Structures   struct  NvFlexSolverCallbackParams   -struct  NvFlexInitDesc -  struct  NvFlexSolverCallback   +struct  NvFlexInitDesc +  +struct  NvFlexSolverDesc +  +struct  NvFlexCopyDesc +  struct  NvFlexSphereGeometry   struct  NvFlexCapsuleGeometry @@ -98,9 +102,7 @@ Enumerations enum  NvFlexMapFlags {
  eNvFlexMapWait = 0,
-  eNvFlexMapDoNotWait = 1, -
-  eNvFlexMapDiscard = 2 +  eNvFlexMapDoNotWait = 1
}   @@ -119,13 +121,35 @@ Enumerations }   enum  NvFlexPhase {
-  eNvFlexPhaseGroupMask = 0x00ffffff, +  eNvFlexPhaseGroupMask = 0x000fffff, +
+  eNvFlexPhaseFlagsMask = 0x00f00000, +
+  eNvFlexPhaseShapeChannelMask = 0xff000000, +
+  eNvFlexPhaseSelfCollide = 1 << 20, +
+  eNvFlexPhaseSelfCollideFilter = 1 << 21, +
+  eNvFlexPhaseFluid = 1 << 22, +
+  eNvFlexPhaseUnused = 1 << 23, +
+  eNvFlexPhaseShapeChannel0 = 1 << 24, +
+  eNvFlexPhaseShapeChannel1 = 1 << 25, +
+  eNvFlexPhaseShapeChannel2 = 1 << 26, +
+  eNvFlexPhaseShapeChannel3 = 1 << 27,
-  eNvFlexPhaseSelfCollide = 1 << 24, +  eNvFlexPhaseShapeChannel4 = 1 << 28,
-  eNvFlexPhaseSelfCollideFilter = 1 << 25, +  eNvFlexPhaseShapeChannel5 = 1 << 29,
-  eNvFlexPhaseFluid = 1 << 26 +  eNvFlexPhaseShapeChannel6 = 1 << 30, +
+  eNvFlexPhaseShapeChannel7 = 1 << 31
}   @@ -166,6 +190,15 @@ Enumerations
}   +enum  NvFlexFeatureMode {
+  eNvFlexFeatureModeDefault = 0, +
+  eNvFlexFeatureModeSimpleSolids = 1, +
+  eNvFlexFeatureModeSimpleFluids = 2 +
+ } +  enum  NvFlexCollisionShapeType {
  eNvFlexShapeSphere = 0,
@@ -184,9 +217,9 @@ Enumerations enum  NvFlexCollisionShapeFlags {
  eNvFlexShapeFlagTypeMask = 0x7,
-  eNvFlexShapeFlagDynamic = 8, +  eNvFlexShapeFlagDynamic = 0x8,
-  eNvFlexShapeFlagTrigger = 16, +  eNvFlexShapeFlagTrigger = 0x10,
  eNvFlexShapeFlagReserved = 0xffffff00
@@ -195,20 +228,26 @@ Enumerations - - + + + + - - + + + + + + @@ -217,42 +256,44 @@ Functions - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + @@ -271,10 +312,12 @@ Functions - - + + + + @@ -285,20 +328,22 @@ Functions - - - - - - + + + + + + + + - - + + @@ -329,6 +374,8 @@ Functions + +

Functions

NV_FLEX_API int NvFlexMakePhase (int group, int flags)
 
NV_FLEX_API int NvFlexMakePhaseWithChannels (int group, int particleFlags, int shapeChannels)
 
NV_FLEX_API int NvFlexMakePhase (int group, int particleFlags)
 
NV_FLEX_API NvFlexLibraryNvFlexInit (int version=NV_FLEX_VERSION, NvFlexErrorCallback errorFunc=0, NvFlexInitDesc *desc=0)
 
NV_FLEX_API void NvFlexShutdown (NvFlexLibrary *lib)
 
NV_FLEX_API int NvFlexGetVersion ()
 
NV_FLEX_API NvFlexSolverNvFlexCreateSolver (NvFlexLibrary *lib, int maxParticles, int maxDiffuseParticles, int maxNeighborsPerParticle=96)
 
NV_FLEX_API void NvFlexSetSolverDescDefaults (NvFlexSolverDesc *desc)
 
NV_FLEX_API NvFlexSolverNvFlexCreateSolver (NvFlexLibrary *lib, const NvFlexSolverDesc *desc)
 
NV_FLEX_API void NvFlexDestroySolver (NvFlexSolver *solver)
 
NV_FLEX_API NvFlexLibraryNvFlexGetSolverLibrary (NvFlexSolver *solver)
 
NV_FLEX_API void NvFlexGetSolverDesc (NvFlexSolver *solver, NvFlexSolverDesc *desc)
 
NV_FLEX_API NvFlexSolverCallback NvFlexRegisterSolverCallback (NvFlexSolver *solver, NvFlexSolverCallback function, NvFlexSolverCallbackStage stage)
 
NV_FLEX_API void NvFlexUpdateSolver (NvFlexSolver *solver, float dt, int substeps, bool enableTimers)
 
NV_FLEX_API void NvFlexGetParams (NvFlexSolver *solver, NvFlexParams *params)
 
NV_FLEX_API void NvFlexSetActive (NvFlexSolver *solver, NvFlexBuffer *indices, int n)
 
NV_FLEX_API void NvFlexGetActive (NvFlexSolver *solver, NvFlexBuffer *indices)
 
NV_FLEX_API void NvFlexSetActive (NvFlexSolver *solver, NvFlexBuffer *indices, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetActive (NvFlexSolver *solver, NvFlexBuffer *indices, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexSetActiveCount (NvFlexSolver *solver, int n)
 
NV_FLEX_API int NvFlexGetActiveCount (NvFlexSolver *solver)
 
NV_FLEX_API void NvFlexSetParticles (NvFlexSolver *solver, NvFlexBuffer *p, int n)
 
NV_FLEX_API void NvFlexGetParticles (NvFlexSolver *solver, NvFlexBuffer *p, int n)
 
NV_FLEX_API void NvFlexSetRestParticles (NvFlexSolver *solver, NvFlexBuffer *p, int n)
 
NV_FLEX_API void NvFlexGetRestParticles (NvFlexSolver *solver, NvFlexBuffer *p, int n)
 
NV_FLEX_API void NvFlexGetSmoothParticles (NvFlexSolver *solver, NvFlexBuffer *p, int n)
 
NV_FLEX_API void NvFlexSetVelocities (NvFlexSolver *solver, NvFlexBuffer *v, int n)
 
NV_FLEX_API void NvFlexGetVelocities (NvFlexSolver *solver, NvFlexBuffer *v, int n)
 
NV_FLEX_API void NvFlexSetPhases (NvFlexSolver *solver, NvFlexBuffer *phases, int n)
 
NV_FLEX_API void NvFlexGetPhases (NvFlexSolver *solver, NvFlexBuffer *phases, int n)
 
NV_FLEX_API void NvFlexSetNormals (NvFlexSolver *solver, NvFlexBuffer *normals, int n)
 
NV_FLEX_API void NvFlexGetNormals (NvFlexSolver *solver, NvFlexBuffer *normals, int n)
 
NV_FLEX_API void NvFlexSetParticles (NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetParticles (NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexSetRestParticles (NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetRestParticles (NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetSmoothParticles (NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexSetVelocities (NvFlexSolver *solver, NvFlexBuffer *v, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetVelocities (NvFlexSolver *solver, NvFlexBuffer *v, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexSetPhases (NvFlexSolver *solver, NvFlexBuffer *phases, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetPhases (NvFlexSolver *solver, NvFlexBuffer *phases, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexSetNormals (NvFlexSolver *solver, NvFlexBuffer *normals, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetNormals (NvFlexSolver *solver, NvFlexBuffer *normals, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexSetSprings (NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *restLengths, NvFlexBuffer *stiffness, int numSprings)
 
NV_FLEX_API void NvFlexGetSprings (NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *restLengths, NvFlexBuffer *stiffness, int numSprings)
 
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)
 
NV_FLEX_API void NvFlexGetRigidTransforms (NvFlexSolver *solver, NvFlexBuffer *rotations, NvFlexBuffer *translations)
 
NV_FLEX_API void NvFlexSetRigids (NvFlexSolver *solver, NvFlexBuffer *offsets, NvFlexBuffer *indices, NvFlexBuffer *restPositions, NvFlexBuffer *restNormals, NvFlexBuffer *stiffness, NvFlexBuffer *thresholds, NvFlexBuffer *creeps, NvFlexBuffer *rotations, NvFlexBuffer *translations, int numRigids, int numIndices)
 
NV_FLEX_API void NvFlexGetRigids (NvFlexSolver *solver, NvFlexBuffer *offsets, NvFlexBuffer *indices, NvFlexBuffer *restPositions, NvFlexBuffer *restNormals, NvFlexBuffer *stiffness, NvFlexBuffer *thresholds, NvFlexBuffer *creeps, NvFlexBuffer *rotations, NvFlexBuffer *translations)
 
NV_FLEX_API NvFlexTriangleMeshId NvFlexCreateTriangleMesh (NvFlexLibrary *lib)
 
NV_FLEX_API void NvFlexDestroyTriangleMesh (NvFlexLibrary *lib, NvFlexTriangleMeshId mesh)
 
NV_FLEX_API void NvFlexDestroyConvexMesh (NvFlexLibrary *lib, NvFlexConvexMeshId convex)
 
NV_FLEX_API void NvFlexUpdateConvexMesh (NvFlexLibrary *lib, NvFlexConvexMeshId convex, NvFlexBuffer *planes, int numPlanes, float *lower, float *upper)
 
NV_FLEX_API void NvFlexUpdateConvexMesh (NvFlexLibrary *lib, NvFlexConvexMeshId convex, NvFlexBuffer *planes, int numPlanes, const float *lower, const float *upper)
 
NV_FLEX_API void NvFlexGetConvexMeshBounds (NvFlexLibrary *lib, NvFlexConvexMeshId mesh, float *lower, float *upper)
 
NV_FLEX_API int NvFlexMakeShapeFlagsWithChannels (NvFlexCollisionShapeType type, bool dynamic, int shapeChannels)
 
NV_FLEX_API int NvFlexMakeShapeFlags (NvFlexCollisionShapeType type, bool dynamic)
 
NV_FLEX_API void NvFlexSetShapes (NvFlexSolver *solver, NvFlexBuffer *geometry, NvFlexBuffer *shapePositions, NvFlexBuffer *shapeRotations, NvFlexBuffer *shapePrevPositions, NvFlexBuffer *shapePrevRotations, NvFlexBuffer *shapeFlags, int numShapes)
 
NV_FLEX_API void NvFlexSetInflatables (NvFlexSolver *solver, NvFlexBuffer *startTris, NvFlexBuffer *numTris, NvFlexBuffer *restVolumes, NvFlexBuffer *overPressures, NvFlexBuffer *constraintScales, int numInflatables)
 
NV_FLEX_API void NvFlexGetDensities (NvFlexSolver *solver, NvFlexBuffer *densities, int n)
 
NV_FLEX_API void NvFlexGetAnisotropy (NvFlexSolver *solver, NvFlexBuffer *q1, NvFlexBuffer *q2, NvFlexBuffer *q3)
 
NV_FLEX_API int NvFlexGetDiffuseParticles (NvFlexSolver *solver, NvFlexBuffer *p, NvFlexBuffer *v, NvFlexBuffer *indices)
 
NV_FLEX_API void NvFlexGetDensities (NvFlexSolver *solver, NvFlexBuffer *densities, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetAnisotropy (NvFlexSolver *solver, NvFlexBuffer *q1, NvFlexBuffer *q2, NvFlexBuffer *q3, const NvFlexCopyDesc *desc)
 
NV_FLEX_API void NvFlexGetDiffuseParticles (NvFlexSolver *solver, NvFlexBuffer *p, NvFlexBuffer *v, NvFlexBuffer *count)
 
NV_FLEX_API void NvFlexSetDiffuseParticles (NvFlexSolver *solver, NvFlexBuffer *p, NvFlexBuffer *v, int n)
 
NV_FLEX_API void NvFlexGetContacts (NvFlexSolver *solver, NvFlexBuffer *planes, NvFlexBuffer *velocities, NvFlexBuffer *indices, NvFlexBuffer *counts)
 
NV_FLEX_API void NvFlexGetNeighbors (NvFlexSolver *solver, NvFlexBuffer *neighbors, NvFlexBuffer *counts, NvFlexBuffer *remap)
 
NV_FLEX_API void NvFlexGetBounds (NvFlexSolver *solver, NvFlexBuffer *lower, NvFlexBuffer *upper)
 
NV_FLEX_API float NvFlexGetDeviceLatency (NvFlexSolver *solver)
 
NV_FLEX_API float NvFlexGetDeviceLatency (NvFlexSolver *solver, unsigned long long *begin, unsigned long long *end, unsigned long long *frequency)
 
NV_FLEX_API void NvFlexGetTimers (NvFlexSolver *solver, NvFlexTimers *timers)
 
NV_FLEX_API int NvFlexGetDetailTimers (NvFlexSolver *solver, NvFlexDetailTimer **timers)
 
NV_FLEX_API void NvFlexFlush (NvFlexLibrary *lib)
 
NV_FLEX_API void NvFlexWait (NvFlexLibrary *lib)
 

Detailed Description

The main include file for the core Flex solver.

@@ -460,12 +507,6 @@ lift Lift force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in the direction perpendicular to velocity and (if possible), parallel to the plane normal. -bool - -fluid - -If true then particles with phase 0 are considered fluid particles and interact using the position based fluids method. - float cohesion @@ -494,7 +535,7 @@ Increases vorticity by applying rotational forces to particles. anisotropyScale -Control how much anisotropy is present in resulting ellipsoids for rendering, if zero then anisotropy will not be calculated, see NvFlexGetAnisotropy() +Control how much anisotropy is present in resulting ellipsoids for rendering, if zero then anisotropy will not be calculated, see NvFlexGetAnisotropy() float @@ -512,7 +553,7 @@ Clamp the anisotropy scale to this fraction of the radius. smoothing -Control the strength of Laplacian smoothing in particles for rendering, if zero then smoothed positions will not be calculated, see NvFlexGetSmoothParticles() +Control the strength of Laplacian smoothing in particles for rendering, if zero then smoothed positions will not be calculated, see NvFlexGetSmoothParticles() float @@ -556,30 +597,12 @@ diffuseBallistic The number of neighbors below which a diffuse particle is considered ballistic. -float - -diffuseSortAxis[3] - -Diffuse particles will be sorted by depth along this axis if non-zero. - float diffuseLifetime Time in seconds that a diffuse particle will live for after being spawned, particles will be spawned with a random lifetime in the range [0, diffuseLifetime]. -float - -plasticThreshold - -Particles belonging to rigid shapes that move with a position delta magnitude > threshold will be permanently deformed in the rest pose. - -float - -plasticCreep - -Controls the rate at which particles in the rest pose are deformed for particles passing the deformation threshold. - float collisionDistance @@ -895,8 +918,20 @@ Direct3D device to use for simulation, if none is specified a new device and con renderContext +Direct3D context that the app is using for rendering. In DirectX 12 this should be a ID3D12CommandQueue pointer. + +void * + +computeContext + Direct3D context to use for simulation, if none is specified a new context will be created, in DirectX 12 this should be a pointer to the ID3D12CommandQueue where compute operations will take place. +bool + +useComputeQueue + +If true, run Flex on a D3D12 compute queue, or vendor specific D3D11 compute queue. This allows compute and graphics to run in parallel on some GPUs. + NvFlexComputeType computeType @@ -904,6 +939,80 @@ computeType Set to eNvFlexD3D11 if DirectX 11 should be used, eNvFlexD3D12 for DirectX 12, this must match the libraries used to link the application. +
+ + +
+
+ + + + +
struct NvFlexSolverDesc
+
+

Describes the creation time parameters for the solver

+
+ + + + + + + + + + + + + +
Data Fields
+NvFlexFeatureMode +featureMode +Control which features are enabled.
+int +maxParticles +Maximum number of regular particles in the solver.
+int +maxDiffuseParticles +Maximum number of diffuse particles in the solver.
+int +maxNeighborsPerParticle +Maximum number of neighbors per-particle, for solids this can be around 32, for fluids up to 128 may be necessary depending on smoothing radius.
+ +
+
+ +
+
+ + + + +
struct NvFlexCopyDesc
+
+

Describes a source and destination buffer region for performing a copy operation.

+
+ + + + + + + + + + +
Data Fields
+int +srcOffset +
+int +dstOffset +
+int +elementCount +
+
@@ -1252,9 +1361,6 @@ time eNvFlexMapDoNotWait 

Calling thread will check if buffer is ready for access, if not ready then the method will return NULL immediately.

-eNvFlexMapDiscard  -

Buffer contents will be discarded, this allows for efficent buffer reuse.

- @@ -1271,10 +1377,10 @@ time

Controls memory space of a NvFlexBuffer, see NvFlexAllocBuffer()

Enumerator
eNvFlexBufferHost  -

Host mappable buffer, pinned memory on CUDA, staging buffer on DX.

+

A host mappable buffer, pinned memory on CUDA, staging buffer on DX.

eNvFlexBufferDevice  -

Device memory buffer, mapping this on CUDA will return a device memory pointer, and will return a buffer pointer on DX.

+

A device memory buffer, mapping this on CUDA will return a device memory pointer, and will return a buffer pointer on DX.

@@ -1310,20 +1416,53 @@ time
-

Flags that control the a particle's behavior and grouping, use NvFlexMakePhase() to construct a valid 32bit phase identifier

+

Flags that control a particle's behavior and grouping, use NvFlexMakePhase() to construct a valid 32bit phase identifier

+ + + + + + + + + + +
Enumerator
eNvFlexPhaseGroupMask  -

Low 24 bits represent the particle group for controlling collisions.

+

Bits [ 0, 19] represent the particle group for controlling collisions.

+
eNvFlexPhaseFlagsMask  +

Bits [20, 23] hold flags about how the particle behave.

+
eNvFlexPhaseShapeChannelMask  +

Bits [24, 31] hold flags representing what shape collision channels particles will collide with, see NvFlexMakeShapeFlags()

eNvFlexPhaseSelfCollide 

If set this particle will interact with particles of the same group.

eNvFlexPhaseSelfCollideFilter  -

If set this particle will ignore collisions with particles closer than the radius in the rest pose, this flag should not be specified unless valid rest positions have been specified using NvFlexSetRestParticles()

+

If set this particle will ignore collisions with particles closer than the radius in the rest pose, this flag should not be specified unless valid rest positions have been specified using NvFlexSetRestParticles()

eNvFlexPhaseFluid 

If set this particle will generate fluid density constraints for its overlapping neighbors.

eNvFlexPhaseUnused  +

Reserved.

+
eNvFlexPhaseShapeChannel0  +

Particle will collide with shapes with channel 0 set (see NvFlexMakeShapeFlags())

+
eNvFlexPhaseShapeChannel1  +

Particle will collide with shapes with channel 1 set (see NvFlexMakeShapeFlags())

+
eNvFlexPhaseShapeChannel2  +

Particle will collide with shapes with channel 2 set (see NvFlexMakeShapeFlags())

+
eNvFlexPhaseShapeChannel3  +

Particle will collide with shapes with channel 3 set (see NvFlexMakeShapeFlags())

+
eNvFlexPhaseShapeChannel4  +

Particle will collide with shapes with channel 4 set (see NvFlexMakeShapeFlags())

+
eNvFlexPhaseShapeChannel5  +

Particle will collide with shapes with channel 5 set (see NvFlexMakeShapeFlags())

+
eNvFlexPhaseShapeChannel6  +

Particle will collide with shapes with channel 6 set (see NvFlexMakeShapeFlags())

+
eNvFlexPhaseShapeChannel7  +

Particle will collide with shapes with channel 7 set (see NvFlexMakeShapeFlags())

+
@@ -1400,7 +1539,7 @@ time
-

Defines the different DirectX compute modes that Flex can use

+

Defines the different compute backends that Flex can use

Enumerator
eNvFlexCUDA 

Use CUDA compute for Flex, the application must link against the CUDA libraries.

@@ -1413,6 +1552,30 @@ time
+
+ + +
+
+ + + + +
enum NvFlexFeatureMode
+
+

Controls which features are enabled, choosing a simple option will disable features and can lead to better performance and reduced memory usage

+ + + + +
Enumerator
eNvFlexFeatureModeDefault  +

All features enabled.

+
eNvFlexFeatureModeSimpleSolids  +

Simple per-particle collision (no per-particle SDF normals, no fluids)

+
eNvFlexFeatureModeSimpleFluids  +

Simple single phase fluid-only particles (no solids)

+
+
@@ -1458,7 +1621,7 @@ time

Function Documentation

- + +
+
+
Enumerator
eNvFlexShapeFlagTypeMask  -

Lower 3 bits holds the type of the collision shape.

+

Lower 3 bits holds the type of the collision shape given by the NvFlexCollisionShapeType enum.

eNvFlexShapeFlagDynamic 

Indicates the shape is dynamic and should have lower priority over static collision shapes.

@@ -1473,7 +1636,56 @@ time
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
NV_FLEX_API int NvFlexMakePhaseWithChannels (int group,
int particleFlags,
int shapeChannels 
)
+
+inline
+
+

Generate a bit set for the particle phase, this is a helper method to simply combine the group id and bit flags into a single integer.

+
Parameters
+ + + + +
[in]groupThe index of the group for this particle, should be an integer < 2^20
[in]particleFlagsA combination of the phase flags which should be a combination of eNvFlexPhaseSelfCollide, eNvFlexPhaseSelfCollideFilter, and eNvFlexPhaseFluid
[in]shapeChannelsA combination of eNvFlexPhaseShapeChannel* flags that control which shapes will be collided against, particles will only collide against shapes that share at least one set channel, see NvFlexMakeShapeFlagsWithChannels()
+
+
+ +
+ +
@@ -1490,7 +1702,7 @@ time - + @@ -1504,7 +1716,7 @@ time
int flags particleFlags 
-

Generate a bit set for the particle phase, the group should be an integer < 2^24, and the flags should be a combination of FlexPhase enum values

+

Deprecated helper method to generates a phase with all shape channels set

@@ -1589,33 +1801,43 @@ time - +
- + - - - - - + + - - +
NV_FLEX_API NvFlexSolver* NvFlexCreateSolver NV_FLEX_API void NvFlexSetSolverDescDefaults (NvFlexLibrarylib,
NvFlexSolverDescdesc) int maxParticles,
+
+

Initialize the solver desc to its default values

Parameters
+ + +
[in]descPointer to a description structure that will be initialized to default values
+
+
+ +
+
+ +
+
+ - - - - + + + + - - + + @@ -1628,9 +1850,7 @@ time
Parameters
int maxDiffuseParticles, NV_FLEX_API NvFlexSolver* NvFlexCreateSolver (NvFlexLibrarylib,
int maxNeighborsPerParticle = 96 const NvFlexSolverDescdesc 
- - - +
[in]libThe library instance to use
[in]maxParticlesMaximum number of simulation particles possible for this solver
[in]maxDiffuseParticlesMaximum number of diffuse (non-simulation) particles possible for this solver
[in]maxNeighborsPerParticleMaximum number of neighbors per particle possible for this solver
[in]descPointer to a solver description structure used to create the solver
@@ -1653,7 +1873,7 @@ time

Delete a particle solver

Parameters
- +
[in]solverA valid solver pointer created from NvFlexCreateSolver()
[in]solverA valid solver pointer created from NvFlexCreateSolver()
@@ -1676,12 +1896,46 @@ time

Return the library associated with a solver

Parameters
- +
[in]solverA valid solver created with NvFlexCreateSolver()
[in]solverA valid solver created with NvFlexCreateSolver()
Returns
A library pointer
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NV_FLEX_API void NvFlexGetSolverDesc (NvFlexSolversolver,
NvFlexSolverDescdesc 
)
+
+

Return the solver desc that was used to create a solver

+
Parameters
+ + + +
[in]solverPointer to a valid Flex solver
[in]descPointer to a desc structure
+
+
+
@@ -1763,7 +2017,7 @@ time

Integrate particle solver forward in time. Below is an example of how to step Flex in the context of a simple game loop:

-
NvFlexSolver* solver = NvFlexCreateSolver(library);
+
NvFlexSolver* solver = NvFlexCreateSolver(library);
NvFlexBuffer* particleBuffer = NvFlexAllocBuffer(library, n, sizeof(Vec4), eNvFlexBufferHost);
NvFlexBuffer* velocityBuffer = NvFlexAllocBuffer(library, n, sizeof(Vec4), eNvFlexBufferHost);
@@ -1788,17 +2042,17 @@ time
NvFlexUnmap(phaseBuffer);
// write to device (async)
-
NvFlexSetParticles(particleBuffer, n);
-
NvFlexSetVelocities(velocityBuffer, n);
-
NvFlexSetPhases(phaseBuffer, n);
+
NvFlexSetParticles(particleBuffer, n);
+
NvFlexSetVelocities(velocityBuffer, n);
+
NvFlexSetPhases(phaseBuffer, n);
// tick
NvFlexUpdateSolver(solver, dt, 1, NULL);
// read back (async)
-
NvFlexGetParticles(particleBuffer, n);
-
NvFlexGetVelocities(velocityBuffer, n);
-
NvFlexGetPhases(phaseBuffer, n);
+
NvFlexGetParticles(particleBuffer, n);
+
NvFlexGetVelocities(velocityBuffer, n);
+
NvFlexGetPhases(phaseBuffer, n);
}
NvFlexFreeBuffer(particleBuffer);
@@ -1887,7 +2141,7 @@ time
- +
@@ -1906,8 +2160,8 @@ time - - + + @@ -1921,14 +2175,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[in]indicesHolds the indices of particles that have been made active
[in]nNumber of particles to allocate
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -1942,7 +2196,13 @@ time - + + + + + + + @@ -1956,6 +2216,41 @@ time
NvFlexBufferindices indices,
const NvFlexCopyDescdesc 
+ +
[in]solverA valid solver
[out]indicesa buffer of indices at least activeCount in length
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
+ + + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NV_FLEX_API void NvFlexSetActiveCount (NvFlexSolversolver,
int n 
)
+
+

Set the total number of active particles

+
Parameters
+ + +
[in]solverA valid solver
[in]nThe number of active particles, the first n indices in the active particles array will be used as the active count
@@ -1986,7 +2281,7 @@ time
- +
@@ -2005,8 +2300,8 @@ time - - + + @@ -2020,14 +2315,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[in]pPointer to a buffer of particle data, should be 4*n in length
[in]nThe number of particles to set
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2046,8 +2341,8 @@ time - - + + @@ -2061,14 +2356,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[out]pPointer to a buffer of 4*n floats that will be filled out with the particle data, can be either a host or device pointer
[in]nThe number of particles to get, must be less than max particles passed to NvFlexCreateSolver
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2087,8 +2382,8 @@ time - - + + @@ -2102,14 +2397,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[in]pPointer to a buffer of particle data, should be 4*n in length
[in]nThe number of particles to set
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2128,8 +2423,8 @@ time - - + + @@ -2143,14 +2438,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[in]pPointer to a buffer of particle data, should be 4*n in length
[in]nThe number of particles to set
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2169,8 +2464,8 @@ time - - + + @@ -2184,14 +2479,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[out]pPointer to a buffer of 4*n floats that will be filled out with the data, can be either a host or device pointer
[in]nThe number of smooth particles to return
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2210,8 +2505,8 @@ time - - + + @@ -2225,14 +2520,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[in]vPointer to a buffer of 3*n floats
[in]nThe number of velocities to set
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2251,8 +2546,8 @@ time - - + + @@ -2266,14 +2561,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[out]vPointer to a buffer of 3*n floats that will be filled out with the data, can be either a host or device pointer
[in]nThe number of velocities to get
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2292,8 +2587,8 @@ time - - + + @@ -2309,14 +2604,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[in]phasesPointer to a buffer of n integers containing the phases
[in]nThe number of phases to set
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2335,8 +2630,8 @@ time - - + + @@ -2350,14 +2645,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[out]phasesPointer to a buffer of n integers that will be filled with the phase data, can be either a host or device pointer
[in]nThe number of phases to get
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2376,8 +2671,8 @@ time - - + + @@ -2391,14 +2686,14 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[in]normalsPointer to a buffer of normals, should be 4*n in length
[in]nThe number of normals to set
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
- +
@@ -2417,8 +2712,8 @@ time - - + + @@ -2432,7 +2727,7 @@ time
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[out]normalsPointer to a buffer of normals, should be 4*n in length
[in]nThe number of normals to get
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
@@ -2549,7 +2844,7 @@ time
- +
@@ -2589,6 +2884,18 @@ time + + + + + + + + + + + + @@ -2629,6 +2936,8 @@ time + + @@ -2639,16 +2948,58 @@ time - +
NvFlexBuffer stiffness,
NvFlexBufferthresholds,
NvFlexBuffercreeps,
[in]restPositionsPointer to a buffer of local space positions relative to the rigid's center of mass (average position), this should be at least 3*numIndices in length in the format x,y,z
[in]restNormalsPointer to a buffer of local space normals, this should be at least 4*numIndices in length in the format x,y,z,w where w is the (negative) signed distance of the particle inside its shape
[in]stiffnessPointer to a buffer of rigid stiffness coefficents, should be numRigids in length, valid values in range [0, 1]
[in]thresholdsPointer to a buffer of plastic deformation threshold coefficients, should be numRigids in length
[in]creepsPointer to a buffer of plastic deformation creep coefficients, should be numRigids in length, valid values in range [0, 1]
[in]rotationsPointer to a buffer of quaternions (4*numRigids in length)
[in]translationsPointer to a buffer of translations of the center of mass (3*numRigids in length)
[in]numRigidsThe number of rigid bodies to set
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2668,12 +3019,19 @@ time
NV_FLEX_API void NvFlexGetRigidTransforms NV_FLEX_API void NvFlexGetRigids ( NvFlexSolver solver,
NvFlexBufferoffsets,
NvFlexBufferindices,
NvFlexBufferrestPositions,
NvFlexBufferrestNormals,
NvFlexBufferstiffness,
NvFlexBufferthresholds,
NvFlexBuffercreeps,
-

Get the rotation matrices for the rigid bodies in the solver

+

Retrive the rigid body shape matching constraints and transforms, if any buffer pointers are NULL then they will be ignored This method supersedes the previous NvFlexGetRigidTransforms method and can be used to retrieve modified rest positions from plastic deformation.

Parameters
- - + + + + + + + + +
[in]solverA valid solver
[out]rotationsPointer to a buffer of quaternions, should be 4*numRigids floats in length
[out]translationsPointer to a buffer of vectors to hold the rigid translations, should be 3*numRigids floats in length
[in]offsetsPointer to a buffer of start offsets for a rigid in the indices array, should be numRigids+1 in length, the first entry must be 0
[in]indicesPointer to a buffer of indices for the rigid bodies, the indices for the jth rigid body start at indices[offsets[j]] and run to indices[offsets[j+1]] exclusive
[in]restPositionsPointer to a buffer of local space positions relative to the rigid's center of mass (average position), this should be at least 3*numIndices in length in the format x,y,z
[in]restNormalsPointer to a buffer of local space normals, this should be at least 4*numIndices in length in the format x,y,z,w where w is the (negative) signed distance of the particle inside its shape
[in]stiffnessPointer to a buffer of rigid stiffness coefficents, should be numRigids in length, valid values in range [0, 1]
[in]thresholdsPointer to a buffer of plastic deformation threshold coefficients, should be numRigids in length
[in]creepsPointer to a buffer of plastic deformation creep coefficients, should be numRigids in length, valid values in range [0, 1]
[in]rotationsPointer to a buffer of quaternions (4*numRigids in length with the imaginary elements in the x,y,z components)
[in]translationsPointer to a buffer of translations of the center of mass (3*numRigids in length)
@@ -2995,7 +3353,7 @@ time
-

Create a convex mesh collision shapes, see NvFlexConvexMeshId for details.

+

Create a convex mesh collision shape, see NvFlexConvexMeshId for details.

Parameters
@@ -3040,7 +3398,7 @@ time - +
[in]libThe library instance to use
@@ -3071,13 +3429,13 @@ time - + - + @@ -3093,7 +3451,7 @@ time - +
float * const float *  lower,
float * const float *  upper 
[in]libThe library instance to use
[in]convexA valid convex mesh shape created from NvFlexCreateConvexMesh()
[in]planesAn array of planes, each plane consists of 4 floats in the form a*x + b*y + c*z + d = 0
[in]numPlanesThe number of planes in the convex
[in]numPlanesThe number of planes in the convex, must be less than 64 planes per-convex
[in]lowerThe local space lower bound of the convex shape
[in]upperThe local space upper bound of the convex shape
@@ -3137,7 +3495,7 @@ time
-

Retrieve the local space bounds of the mesh, these are the same values specified to NvFlexUpdateConvexMesh()

+

Retrieve the local space bounds of the mesh, these are the same values specified to NvFlexUpdateConvexMesh()

Parameters
@@ -3148,6 +3506,55 @@ time + + + +
+
+
[in]libThe library instance to use
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
NV_FLEX_API int NvFlexMakeShapeFlagsWithChannels (NvFlexCollisionShapeType type,
bool dynamic,
int shapeChannels 
)
+
+inline
+
+

Helper function to combine shape type, flags, and phase/shape collision channels into a 32bit value

+
Parameters
+ + + + +
[in]typeThe type of the shape, see NvFlexCollisionShapeType
[in]dynamicSee eNvFlexShapeFlagDynamic
[in]shapeChannelsA combination of the eNvFlexPhaseShapeChannel* flags, collisions will only be processed between a particle and a shape if a channel is set on both the particle and shape, see NvFlexMakePhaseWithChannels()
+
+
+
@@ -3181,7 +3588,7 @@ time
-

Combines geometry type and static/dynamic flags

+

Deprecrated helper method that creates shape flags that by default have all collision channels enabled

@@ -3426,7 +3833,7 @@ time - +
@@ -3445,8 +3852,8 @@ time - - + + @@ -3459,15 +3866,15 @@ time
Parameters
int n const NvFlexCopyDescdesc 
- +
[in]solverA valid solver
[in]nThe number of particle densities to return
[out]densitiesPointer to a buffer of floats, should be maxParticles in length, density values are normalized between [0, 1] where 1 represents the rest density
[in]descPointer to a descriptor specifying the contents to read back
- +
@@ -3493,7 +3900,13 @@ time - + + + + + + + @@ -3510,18 +3923,19 @@ time +
NvFlexBufferq3 q3,
const NvFlexCopyDescdesc 
[out]q1Pointer to a buffer of floats that receive the first basis vector and scale, should be 4*maxParticles in length
[out]q2Pointer to a buffer of floats that receive the second basis vector and scale, should be 4*maxParticles in length
[out]q3Pointer to a buffer of floats that receive the third basis vector and scale, should be 4*maxParticles in length
[in]descPointer to a descriptor specifying the contents to read back
- +
- + @@ -3542,7 +3956,7 @@ time - + @@ -3557,7 +3971,7 @@ time - +
NV_FLEX_API int NvFlexGetDiffuseParticles NV_FLEX_API void NvFlexGetDiffuseParticles ( NvFlexSolver solver, NvFlexBufferindices count 
[in]solverA valid solver
[out]pPointer to a buffer of floats, should be 4*maxParticles in length, the w component represents the particles lifetime with 1 representing a new particle, and 0 representing an inactive particle
[out]vPointer to a buffer of floats, should be 4*maxParticles in length, the w component is not used
[out]indicesPointer to a buffer of ints that specify particle indices in depth sorted order, should be maxParticles in length, see NvFlexParams::mDiffuseSortDir
[out]countPointer to a buffer of a single int that holds the current particle count (this may be updated by the GPU which is why it is passed back in a buffer)
@@ -3605,7 +4019,7 @@ time [in]solverA valid solver [in]pPointer to a buffer of floats, should be 4*n in length, the w component represents the particles lifetime with 1 representing a new particle, and 0 representing an inactive particle [in]vPointer to a buffer of floats, should be 4*n in length, the w component is not used - [in]nNumber of diffuse particles to set + [in]nThe number of active diffuse particles @@ -3657,13 +4071,90 @@ time
Parameters
- - - - + + + + +
[in]solverA valid solver
[out]planesPointer to a destination buffer containing the contact planes for the particle, each particle can have up to 4 contact planes so this buffer should be 16*maxParticles in length
[out]velocitiesPointer to a destination buffer containing the velocity of the contact point on the shape in world space, the index of the shape (corresponding to the shape in NvFlexSetShapes() is stored in the w component), each particle can have up to 4 contact planes so this buffer should be 16*maxParticles in length
[out]indicesPointer to a buffer of indices into the contacts buffer, the first contact plane for the i'th particle is given by planes[indices[i]*sizeof(float)*4] and subsequent contacts for that particle are stored sequentially, this array should be maxParticles in length
[out]countsPointer to a buffer of contact counts for each particle (will be <= 4), this buffer should be maxParticles in length
[out]planesPointer to a destination buffer containing the contact planes for the particle, each particle can have up to 6 contact planes so this buffer should be 4*6*maxParticles floats in length
[out]velocitiesPointer to a destination buffer containing the velocity of the contact point on the shape in world space, the index of the shape (corresponding to the shape in NvFlexSetShapes() is stored in the w component), each particle can have up to 6 contact planes so this buffer should be 4*6*maxParticles floats in length
[out]indicesPointer to a buffer of indices into the contacts buffer, the first contact plane for the i'th particle is given by planes[indices[i]*sizeof(float)*4*6] and subsequent contact planes for that particle are stored sequentially, this array should be maxParticles in length
[out]countsPointer to a buffer of contact counts for each particle (will be <= 6), this buffer should be maxParticles in length
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NV_FLEX_API void NvFlexGetNeighbors (NvFlexSolversolver,
NvFlexBufferneighbors,
NvFlexBuffercounts,
NvFlexBufferremap 
)
+
+

Get the particle neighbor lists, these are stored in a strided format, and can be iterated in the following manner:

+
NvFlexGetNeighbors(solver, neighborsBuffer, countsBuffer, indicesBuffer);
+
+
int* neighbors = (int*)NvFlexMap(neighborsBuffer, 0);
+
int* counts = (int*)NvFlexMap(countsBuffer, 0);
+
int* remap = (int*)NvFlexMap(remapBuffer, 0);
+
+
// neighbors are stored in a strided format so that the first neighbor
+
// of each particle is stored sequentially, then the second, and so on
+
+
int stride = maxParticles;
+
+
for (int i=0; i < maxParticles; ++i)
+
{
+
// find offset in the neighbors buffer
+
int offset = remap[i];
+
int count = counts[offset];
+
+
for (int c=0; c < count; ++c)
+
{
+
int neighbor = remap[neighbors[c*stride + offset]];
+
+
printf("Particle %d's neighbor %d is particle %d\n", i, c, neighbor);
+
}
+
}
+
+
NvFlexUnmap(neighborsBuffer);
+
NvFlexUnmap(countsBuffer);
+
NvFlexUnmap(remapBuffer);
+
Parameters
+ + + + +
[in]solverA valid solver
[out]neighborsPointer to a destination buffer containing the the neighbors for all particles, this should be maxParticles*maxParticleNeighbors ints (passed to NvFlexInit() in length)
[out]countsPointer to a buffer of neighbor counts per-particle, should be maxParticles ints in length
[out]remapPointer to a buffer of indices, because Flex internally re-orders particles these are used to map from an API particle index to it internal index
+
Note
Neighbors are only valid after a call to NvFlexUpdateSolver() has completed, the returned neighbors correspond to the last substep of the last update
@@ -3708,7 +4199,7 @@ time - +
@@ -3716,14 +4207,39 @@ time - + + + + + + + + + + + + + + + + + + + + + + +
NV_FLEX_API float NvFlexGetDeviceLatency ( NvFlexSolversolver)solver,
unsigned long long * begin,
unsigned long long * end,
unsigned long long * frequency 
)
Parameters
+ + +
[in]solverA valid solver
[out]beginOptional pointer to a 64 bit unsigned to receive the value of the GPU clock when Flex update began (in cycles)
[out]endOptional pointer to a 64 bit unsigned to receive the value of the GPU clock when Flex update ended (in cycles)
[out]frequencyOptional pointer to a 64 bit unsigned to receive the frequency of the clock used to measure begin and end
@@ -3898,7 +4414,7 @@ time
-

Maps a buffer for reading and writing. When the buffer is created with NvFlexBufferType::eHost, then the returned pointer will be a host memory address that can be read/written. Mapping a buffer implicitly synchronizes with the GPU to ensure that any reads or writes from the buffer (e.g.: from the NvFlexGet*() or NvFlexSet*()) methods have completed.

+

Maps a buffer for reading and writing. When the buffer is created with NvFlexBufferType::eHost, then the returned pointer will be a host memory address that can be read/written. Mapping a buffer implicitly synchronizes with the GPU to ensure that any reads or writes from the buffer (e.g.: from the NvFlexGet*() or NvFlexSet*() methods) have completed.

Parameters
@@ -3980,7 +4496,7 @@ time
...
// copy directly from Flex into render buffer
-
NvFlexGetParticles(vboBuffer, n);
+
NvFlexGetParticles(vboBuffer, n);
// render
...
@@ -4217,12 +4733,28 @@ time + + + +
+
+
[in]bufferA buffer allocated with NvFlexAllocBuffer()
+ + + + + + + +
NV_FLEX_API void NvFlexWait (NvFlexLibrarylib)
+
+
diff --git a/doc/_static/api/_nv_flex_8h_source.html b/doc/_static/api/_nv_flex_8h_source.html index 434a362..c4cd011 100644 --- a/doc/_static/api/_nv_flex_8h_source.html +++ b/doc/_static/api/_nv_flex_8h_source.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -76,7 +76,7 @@
36 #endif
37 
38 // least 2 significant digits define minor version, eg: 10 -> version 0.10
-
39 #define NV_FLEX_VERSION 110
+
39 #define NV_FLEX_VERSION 120
40 
42 
47 extern "C" {
@@ -91,644 +91,725 @@
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 };
+
71 };
+
72 
+
76 enum NvFlexBufferType
+
77 {
+
78  eNvFlexBufferHost = 0,
+
79  eNvFlexBufferDevice = 1,
+
80 };
+
81 
+
85 enum NvFlexRelaxationMode
+
86 {
+
87  eNvFlexRelaxationGlobal = 0,
+
88  eNvFlexRelaxationLocal = 1
+
89 };
+
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;
+
95 struct NvFlexParams
+
96 {
+
97  int numIterations;
+
98 
+
99  float gravity[3];
+
100  float radius;
+
101  float solidRestDistance;
+
102  float fluidRestDistance;
+
103 
+
104  // common params
+
105  float dynamicFriction;
+
106  float staticFriction;
+
107  float particleFriction;
+
108  float restitution;
+
109  float adhesion;
+
110  float sleepThreshold;
+
111 
+
112  float maxSpeed;
+
113  float maxAcceleration;
+
114 
+
115  float shockPropagation;
+
116  float dissipation;
+
117  float damping;
+
118 
+
119  // cloth params
+
120  float wind[3];
+
121  float drag;
+
122  float lift;
+
123 
+
124  // fluid params
+
125  float cohesion;
+
126  float surfaceTension;
+
127  float viscosity;
+
128  float vorticityConfinement;
+
129  float anisotropyScale;
+
130  float anisotropyMin;
+
131  float anisotropyMax;
+
132  float smoothing;
+
133  float solidPressure;
+
134  float freeSurfaceDrag;
+
135  float buoyancy;
+
136 
+
137  // diffuse params
+
138  float diffuseThreshold;
+
139  float diffuseBuoyancy;
+
140  float diffuseDrag;
+
141  int diffuseBallistic;
+
142  float diffuseLifetime;
+
143 
+
144  // collision params
+
145  float collisionDistance;
+
146  float particleCollisionMargin;
+
147  float shapeCollisionMargin;
+
148 
+
149  float planes[8][4];
+
150  int numPlanes;
+
151 
+
152  NvFlexRelaxationMode relaxationMode;
+
153  float relaxationFactor;
+
154 };
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 
+
156 
+
160 enum NvFlexPhase
+
161 {
+
162  eNvFlexPhaseGroupMask = 0x000fffff,
+
163  eNvFlexPhaseFlagsMask = 0x00f00000,
+
164  eNvFlexPhaseShapeChannelMask = 0xff000000,
+
165 
+
166  eNvFlexPhaseSelfCollide = 1 << 20,
+
167  eNvFlexPhaseSelfCollideFilter = 1 << 21,
+
168  eNvFlexPhaseFluid = 1 << 22,
+
169  eNvFlexPhaseUnused = 1 << 23,
+
170 
+
171  eNvFlexPhaseShapeChannel0 = 1 << 24,
+
172  eNvFlexPhaseShapeChannel1 = 1 << 25,
+
173  eNvFlexPhaseShapeChannel2 = 1 << 26,
+
174  eNvFlexPhaseShapeChannel3 = 1 << 27,
+
175  eNvFlexPhaseShapeChannel4 = 1 << 28,
+
176  eNvFlexPhaseShapeChannel5 = 1 << 29,
+
177  eNvFlexPhaseShapeChannel6 = 1 << 30,
+
178  eNvFlexPhaseShapeChannel7 = 1 << 31,
+
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);
+
181 
+
190 NV_FLEX_API inline int NvFlexMakePhaseWithChannels(int group, int particleFlags, int shapeChannels) { return (group & eNvFlexPhaseGroupMask) | (particleFlags & eNvFlexPhaseFlagsMask) | (shapeChannels & eNvFlexPhaseShapeChannelMask); }
+
191 
+
195 NV_FLEX_API inline int NvFlexMakePhase(int group, int particleFlags) { return NvFlexMakePhaseWithChannels(group, particleFlags, eNvFlexPhaseShapeChannelMask); }
+
196 
+
197 
+
201 struct NvFlexTimers
+
202 {
+
203  float predict;
+
204  float createCellIndices;
+
205  float sortCellIndices;
+
206  float createGrid;
+
207  float reorder;
+
208  float collideParticles;
+
209  float collideShapes;
+
210  float collideTriangles;
+
211  float collideFields;
+
212  float calculateDensity;
+
213  float solveDensities;
+
214  float solveVelocities;
+
215  float solveShapes;
+
216  float solveSprings;
+
217  float solveContacts;
+
218  float solveInflatables;
+
219  float applyDeltas;
+
220  float calculateAnisotropy;
+
221  float updateDiffuse;
+
222  float updateTriangles;
+
223  float updateNormals;
+
224  float finalize;
+
225  float updateBounds;
+
226  float total;
+
227 };
+
228 
+
232 enum NvFlexErrorSeverity
+
233 {
+
234  eNvFlexLogError = 0,
+
235  eNvFlexLogInfo = 1,
+
236  eNvFlexLogWarning = 2,
+
237  eNvFlexLogDebug = 4,
+
238  eNvFlexLogAll = -1,
+
239 };
+
240 
+
241 
+
244 enum NvFlexSolverCallbackStage
+
245 {
+
246  eNvFlexStageIterationStart,
+
247  eNvFlexStageIterationEnd,
+
248  eNvFlexStageSubstepBegin,
+
249  eNvFlexStageSubstepEnd,
+
250  eNvFlexStageUpdateEnd,
+
251  eNvFlexStageCount,
+
252 };
+
253 
+
254 
+
267 struct NvFlexSolverCallbackParams
+
268 {
+
269  NvFlexSolver* solver;
+
270  void* userData;
+
271 
+
272  float* particles;
+
273  float* velocities;
+
274  int* phases;
+
275 
+
276  int numActive;
+
277 
+
278  float dt;
+
279 
+
280  const int* originalToSortedMap;
+
281  const int* sortedToOriginalMap;
+
282 };
+
283 
+
286 struct NvFlexSolverCallback
+
287 {
+
289  void* userData;
+
290 
+
292  void (*function)(NvFlexSolverCallbackParams params);
+
293 };
+
294 
+
298 typedef void (*NvFlexErrorCallback)(NvFlexErrorSeverity type, const char* msg, const char* file, int line);
+
299 
+
300 
+
301 
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();
+
305 enum NvFlexComputeType
+
306 {
+
307  eNvFlexCUDA,
+
308  eNvFlexD3D11,
+
309  eNvFlexD3D12,
+
310 };
+
311 
+
312 
+
315 struct NvFlexInitDesc
+
316 {
+
317  int deviceIndex;
+
318  bool enableExtensions;
+
319  void* renderDevice;
+
320  void* renderContext;
+
321  void* computeContext;
+
322  bool useComputeQueue;
+
323 
+
324  NvFlexComputeType computeType;
+
325 };
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);
+
336 NV_FLEX_API NvFlexLibrary* NvFlexInit(int version = NV_FLEX_VERSION, NvFlexErrorCallback errorFunc = 0, NvFlexInitDesc* desc = 0);
+
337 
+
344 NV_FLEX_API void NvFlexShutdown(NvFlexLibrary* lib);
+
345 
+
349 NV_FLEX_API int NvFlexGetVersion();
350 
-
359 NV_FLEX_API NvFlexSolverCallback NvFlexRegisterSolverCallback(NvFlexSolver* solver, NvFlexSolverCallback function, NvFlexSolverCallbackStage stage);
+
354 enum NvFlexFeatureMode
+
355 {
+
356  eNvFlexFeatureModeDefault = 0,
+
357  eNvFlexFeatureModeSimpleSolids = 1,
+
358  eNvFlexFeatureModeSimpleFluids = 2,
+
359 };
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;
+
364 struct NvFlexSolverDesc
+
365 {
+
366  NvFlexFeatureMode featureMode;
+
367 
+
368  int maxParticles;
+
369  int maxDiffuseParticles;
+
370  int maxNeighborsPerParticle;
+
371 };
+
372 
+
377 NV_FLEX_API void NvFlexSetSolverDescDefaults(NvFlexSolverDesc* desc);
+
378 
+
385 NV_FLEX_API NvFlexSolver* NvFlexCreateSolver(NvFlexLibrary* lib, const NvFlexSolverDesc* desc);
+
391 NV_FLEX_API void NvFlexDestroySolver(NvFlexSolver* solver);
+
392 
+
399 NV_FLEX_API NvFlexLibrary* NvFlexGetSolverLibrary(NvFlexSolver* solver);
+
400 
+
407 NV_FLEX_API void NvFlexGetSolverDesc(NvFlexSolver* solver, NvFlexSolverDesc* desc);
+
408 
+
417 NV_FLEX_API NvFlexSolverCallback NvFlexRegisterSolverCallback(NvFlexSolver* solver, NvFlexSolverCallback function, NvFlexSolverCallbackStage stage);
+
418 
+
478 NV_FLEX_API void NvFlexUpdateSolver(NvFlexSolver* solver, float dt, int substeps, bool enableTimers);
+
479 
+
486 NV_FLEX_API void NvFlexSetParams(NvFlexSolver* solver, const NvFlexParams* params);
+
487 
+
495 NV_FLEX_API void NvFlexGetParams(NvFlexSolver* solver, NvFlexParams* params);
+
496 
+
500 struct NvFlexCopyDesc
+
501 {
+
502  int srcOffset; //<! Offset in elements from the start of the source buffer to begin reading from
+
503  int dstOffset; //<! Offset in elements from the start of the destination buffer to being writing to
+
504  int elementCount; //<! Number of elements to copy
+
505 };
+
506 
+
514 NV_FLEX_API void NvFlexSetActive(NvFlexSolver* solver, NvFlexBuffer* indices, const NvFlexCopyDesc* desc);
+
515 
+
523 NV_FLEX_API void NvFlexGetActive(NvFlexSolver* solver, NvFlexBuffer* indices, const NvFlexCopyDesc* desc);
+
524 
+
531 NV_FLEX_API void NvFlexSetActiveCount(NvFlexSolver* solver, int n);
+
532 
+
539 NV_FLEX_API int NvFlexGetActiveCount(NvFlexSolver* solver);
+
540 
+
549 NV_FLEX_API void NvFlexSetParticles(NvFlexSolver* solver, NvFlexBuffer* p, const NvFlexCopyDesc* desc);
+
550 
+
558 NV_FLEX_API void NvFlexGetParticles(NvFlexSolver* solver, NvFlexBuffer* p, const NvFlexCopyDesc* desc);
+
559 
+
569 NV_FLEX_API void NvFlexSetRestParticles(NvFlexSolver* solver, NvFlexBuffer* p, const NvFlexCopyDesc* desc);
+
570 
+
579 NV_FLEX_API void NvFlexGetRestParticles(NvFlexSolver* solver, NvFlexBuffer* p, const NvFlexCopyDesc* desc);
+
580 
+
581 
+
589 NV_FLEX_API void NvFlexGetSmoothParticles(NvFlexSolver* solver, NvFlexBuffer* p, const NvFlexCopyDesc* desc);
+
590 
+
599 NV_FLEX_API void NvFlexSetVelocities(NvFlexSolver* solver, NvFlexBuffer* v, const NvFlexCopyDesc* desc);
+
607 NV_FLEX_API void NvFlexGetVelocities(NvFlexSolver* solver, NvFlexBuffer* v, const NvFlexCopyDesc* desc);
+
608 
+
625 NV_FLEX_API void NvFlexSetPhases(NvFlexSolver* solver, NvFlexBuffer* phases, const NvFlexCopyDesc* desc);
+
633 NV_FLEX_API void NvFlexGetPhases(NvFlexSolver* solver, NvFlexBuffer* phases, const NvFlexCopyDesc* desc);
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);
+
642 NV_FLEX_API void NvFlexSetNormals(NvFlexSolver* solver, NvFlexBuffer* normals, const NvFlexCopyDesc* desc);
+
643 
+
651 NV_FLEX_API void NvFlexGetNormals(NvFlexSolver* solver, NvFlexBuffer* normals, const NvFlexCopyDesc* desc);
+
652 
+
653 
+
666 NV_FLEX_API void NvFlexSetSprings(NvFlexSolver* solver, NvFlexBuffer* indices, NvFlexBuffer* restLengths, NvFlexBuffer* stiffness, int numSprings);
+
676 NV_FLEX_API void NvFlexGetSprings(NvFlexSolver* solver, NvFlexBuffer* indices, NvFlexBuffer* restLengths, NvFlexBuffer* stiffness, int numSprings);
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);
+
696 NV_FLEX_API void NvFlexSetRigids(NvFlexSolver* solver, NvFlexBuffer* offsets, NvFlexBuffer* indices, NvFlexBuffer* restPositions, NvFlexBuffer* restNormals, NvFlexBuffer* stiffness, NvFlexBuffer* thresholds, NvFlexBuffer* creeps, NvFlexBuffer* rotations, NvFlexBuffer* translations, int numRigids, int numIndices);
+
697 
+
713 NV_FLEX_API void NvFlexGetRigids(NvFlexSolver* solver, NvFlexBuffer* offsets, NvFlexBuffer* indices, NvFlexBuffer* restPositions, NvFlexBuffer* restNormals, NvFlexBuffer* stiffness, NvFlexBuffer* thresholds, NvFlexBuffer* creeps, NvFlexBuffer* rotations, NvFlexBuffer* translations);
+
714 
+
718 typedef unsigned int NvFlexTriangleMeshId;
+
719 
+
723 typedef unsigned int NvFlexDistanceFieldId;
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 };
+
730 typedef unsigned int NvFlexConvexMeshId;
+
731 
+
738 NV_FLEX_API NvFlexTriangleMeshId NvFlexCreateTriangleMesh(NvFlexLibrary* lib);
+
739 
+
746 NV_FLEX_API void NvFlexDestroyTriangleMesh(NvFlexLibrary* lib, NvFlexTriangleMeshId mesh);
+
747 
+
761 NV_FLEX_API void NvFlexUpdateTriangleMesh(NvFlexLibrary* lib, NvFlexTriangleMeshId mesh, NvFlexBuffer* vertices, NvFlexBuffer* indices, int numVertices, int numTriangles, const float* lower, const float* upper);
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 };
+
771 NV_FLEX_API void NvFlexGetTriangleMeshBounds(NvFlexLibrary* lib, const NvFlexTriangleMeshId mesh, float* lower, float* upper);
+
772 
+
779 NV_FLEX_API NvFlexDistanceFieldId NvFlexCreateDistanceField(NvFlexLibrary* lib);
+
780 
+
787 NV_FLEX_API void NvFlexDestroyDistanceField(NvFlexLibrary* lib, NvFlexDistanceFieldId sdf);
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);
+
800 NV_FLEX_API void NvFlexUpdateDistanceField(NvFlexLibrary* lib, NvFlexDistanceFieldId sdf, int dimx, int dimy, int dimz, NvFlexBuffer* field);
+
801 
+
808 NV_FLEX_API NvFlexConvexMeshId NvFlexCreateConvexMesh(NvFlexLibrary* lib);
+
809 
+
816 NV_FLEX_API void NvFlexDestroyConvexMesh(NvFlexLibrary* lib, NvFlexConvexMeshId convex);
+
817 
+
828 NV_FLEX_API void NvFlexUpdateConvexMesh(NvFlexLibrary* lib, NvFlexConvexMeshId convex, NvFlexBuffer* planes, int numPlanes, const float* lower, const float* upper);
+
829 
+
838 NV_FLEX_API void NvFlexGetConvexMeshBounds(NvFlexLibrary* lib, NvFlexConvexMeshId mesh, float* lower, float* upper);
+
839 
+
843 struct NvFlexSphereGeometry
+
844 {
+
845  float radius;
+
846 };
+
847 
+
851 struct NvFlexCapsuleGeometry
+
852 {
+
853  float radius;
+
854  float halfHeight;
+
855 };
+
856 
+
860 struct NvFlexBoxGeometry
+
861 {
+
862  float halfExtents[3];
+
863 };
+
864 
+
868 struct NvFlexConvexMeshGeometry
+
869 {
+
870  float scale[3];
+
871  NvFlexConvexMeshId mesh;
+
872 };
+
873 
+
877 struct NvFlexTriangleMeshGeometry
+
878 {
+
879  float scale[3];
+
880  NvFlexTriangleMeshId mesh;
+
881 };
+
882 
+
887 struct NvFlexSDFGeometry
+
888 {
+
889  float scale;
+
890  NvFlexDistanceFieldId field;
+
891 };
+
892 
+
897 union NvFlexCollisionGeometry
+
898 {
+
899  NvFlexSphereGeometry sphere;
+
900  NvFlexCapsuleGeometry capsule;
+
901  NvFlexBoxGeometry box;
+
902  NvFlexConvexMeshGeometry convexMesh;
+
903  NvFlexTriangleMeshGeometry triMesh;
+
904  NvFlexSDFGeometry sdf;
+
905 };
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);
+
907 enum NvFlexCollisionShapeType
+
908 {
+
909  eNvFlexShapeSphere = 0,
+
910  eNvFlexShapeCapsule = 1,
+
911  eNvFlexShapeBox = 2,
+
912  eNvFlexShapeConvexMesh = 3,
+
913  eNvFlexShapeTriangleMesh = 4,
+
914  eNvFlexShapeSDF = 5,
+
915 };
+
916 
+
917 enum NvFlexCollisionShapeFlags
+
918 {
+
919  eNvFlexShapeFlagTypeMask = 0x7,
+
920  eNvFlexShapeFlagDynamic = 0x8,
+
921  eNvFlexShapeFlagTrigger = 0x10,
+
922 
+
923  eNvFlexShapeFlagReserved = 0xffffff00
+
924 };
+
925 
+
933 NV_FLEX_API inline int NvFlexMakeShapeFlagsWithChannels(NvFlexCollisionShapeType type, bool dynamic, int shapeChannels) { return type | (dynamic?eNvFlexShapeFlagDynamic:0) | shapeChannels; }
+
934 
+
938 NV_FLEX_API inline int NvFlexMakeShapeFlags(NvFlexCollisionShapeType type, bool dynamic) { return NvFlexMakeShapeFlagsWithChannels(type, dynamic, eNvFlexPhaseShapeChannelMask); }
+
939 
+
940 
+
954 NV_FLEX_API void NvFlexSetShapes(NvFlexSolver* solver, NvFlexBuffer* geometry, NvFlexBuffer* shapePositions, NvFlexBuffer* shapeRotations, NvFlexBuffer* shapePrevPositions, NvFlexBuffer* shapePrevRotations, NvFlexBuffer* shapeFlags, int numShapes);
+
955 
+
966 NV_FLEX_API void NvFlexSetDynamicTriangles(NvFlexSolver* solver, NvFlexBuffer* indices, NvFlexBuffer* normals, int numTris);
+
975 NV_FLEX_API void NvFlexGetDynamicTriangles(NvFlexSolver* solver, NvFlexBuffer* indices, NvFlexBuffer* normals, int numTris);
+
976 
+
991 NV_FLEX_API void NvFlexSetInflatables(NvFlexSolver* solver, NvFlexBuffer* startTris, NvFlexBuffer* numTris, NvFlexBuffer* restVolumes, NvFlexBuffer* overPressures, NvFlexBuffer* constraintScales, int numInflatables);
+
992 
+
1000 NV_FLEX_API void NvFlexGetDensities(NvFlexSolver* solver, NvFlexBuffer* densities, const NvFlexCopyDesc* desc);
+
1001 
+
1016 NV_FLEX_API void NvFlexGetAnisotropy(NvFlexSolver* solver, NvFlexBuffer* q1, NvFlexBuffer* q2, NvFlexBuffer* q3, const NvFlexCopyDesc* desc);
+
1026 NV_FLEX_API void NvFlexGetDiffuseParticles(NvFlexSolver* solver, NvFlexBuffer* p, NvFlexBuffer* v, NvFlexBuffer* count);
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
+
1038 NV_FLEX_API void NvFlexSetDiffuseParticles(NvFlexSolver* solver, NvFlexBuffer* p, NvFlexBuffer* v, int n);
+
1039 
+
1049 NV_FLEX_API void NvFlexGetContacts(NvFlexSolver* solver, NvFlexBuffer* planes, NvFlexBuffer* velocities, NvFlexBuffer* indices, NvFlexBuffer* counts);
+
1050 
+
1094 NV_FLEX_API void NvFlexGetNeighbors(NvFlexSolver* solver, NvFlexBuffer* neighbors, NvFlexBuffer* counts, NvFlexBuffer* remap);
+
1095 
+
1104 NV_FLEX_API void NvFlexGetBounds(NvFlexSolver* solver, NvFlexBuffer* lower, NvFlexBuffer* upper);
+
1105 
+
1117 NV_FLEX_API float NvFlexGetDeviceLatency(NvFlexSolver* solver, unsigned long long* begin, unsigned long long* end, unsigned long long* frequency);
+
1118 
+
1129 NV_FLEX_API void NvFlexGetTimers(NvFlexSolver* solver, NvFlexTimers* timers);
+
1130 
+
1134 struct NvFlexDetailTimer
+
1135 {
+
1136  char* name;
+
1137  float time;
+
1138 };
+
1139 
+
1152 NV_FLEX_API int NvFlexGetDetailTimers(NvFlexSolver* solver, NvFlexDetailTimer** timers);
+
1153 
+
1163 NV_FLEX_API NvFlexBuffer* NvFlexAllocBuffer(NvFlexLibrary* lib, int elementCount, int elementByteStride, NvFlexBufferType type);
+
1164 
+
1170 NV_FLEX_API void NvFlexFreeBuffer(NvFlexBuffer* buf);
+
1171 
+
1181 NV_FLEX_API void* NvFlexMap(NvFlexBuffer* buffer, int flags);
+
1182 
+
1188 NV_FLEX_API void NvFlexUnmap(NvFlexBuffer* buffer);
+
1189 
+
1219 NV_FLEX_API NvFlexBuffer* NvFlexRegisterOGLBuffer(NvFlexLibrary* lib, int buf, int elementCount, int elementByteStride);
+
1220 
+
1226 NV_FLEX_API void NvFlexUnregisterOGLBuffer(NvFlexBuffer* buf);
+
1227 
+
1237 NV_FLEX_API NvFlexBuffer* NvFlexRegisterD3DBuffer(NvFlexLibrary* lib, void* buffer, int elementCount, int elementByteStride);
+
1238 
+
1244 NV_FLEX_API void NvFlexUnregisterD3DBuffer(NvFlexBuffer* buf);
+
1245 
+
1251 NV_FLEX_API void NvFlexAcquireContext(NvFlexLibrary* lib);
+
1252 
+
1257 NV_FLEX_API void NvFlexRestoreContext(NvFlexLibrary* lib);
+
1258 
+
1264 NV_FLEX_API const char* NvFlexGetDeviceName(NvFlexLibrary* lib);
+
1265 
+
1275 NV_FLEX_API void NvFlexGetDeviceAndContext(NvFlexLibrary* lib, void** device, void** context);
+
1276 
+
1277 
+
1283 NV_FLEX_API void NvFlexFlush(NvFlexLibrary* lib);
+
1284 
+
1285 NV_FLEX_API void NvFlexWait(NvFlexLibrary* lib);
+
1286 
+
1288 
+
1293 NV_FLEX_API void NvFlexSetDebug(NvFlexSolver* solver, bool enable);
+
1294 NV_FLEX_API void NvFlexGetShapeBVH(NvFlexSolver* solver, void* bvh);
+
1295 NV_FLEX_API void NvFlexCopySolver(NvFlexSolver* dst, NvFlexSolver* src);
+
1296 NV_FLEX_API void NvFlexCopyDeviceToHost(NvFlexSolver* solver, NvFlexBuffer* pDevice, void* pHost, int size, int stride);
+
1297 NV_FLEX_API void NvFlexComputeWaitForGraphics(NvFlexLibrary* lib);
+
1298 
+
1300 
+
1301 } // extern "C"
+
1302 
+
1303 #endif // NV_FLEX_H
NV_FLEX_API int NvFlexGetActiveCount(NvFlexSolver *solver)
-
float solveShapes
Time spent solving rigid body constraints.
Definition: NvFlex.h:198
+
Reserved.
Definition: NvFlex.h:169
+
float solveShapes
Time spent solving rigid body constraints.
Definition: NvFlex.h:215
NV_FLEX_API NvFlexSolverCallback NvFlexRegisterSolverCallback(NvFlexSolver *solver, NvFlexSolverCallback function, NvFlexSolverCallbackStage stage)
-
float radius
Definition: NvFlex.h:760
-
Warning messages.
Definition: NvFlex.h:219
-
float solveSprings
Time spent solving distance constraints.
Definition: NvFlex.h:199
+
NV_FLEX_API void NvFlexGetPhases(NvFlexSolver *solver, NvFlexBuffer *phases, const NvFlexCopyDesc *desc)
+
float radius
Definition: NvFlex.h:845
+
Warning messages.
Definition: NvFlex.h:236
+
float solveSprings
Time spent solving distance constraints.
Definition: NvFlex.h:216
NvFlexMapFlags
Definition: NvFlex.h:67
-
NV_FLEX_API void NvFlexGetRestParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
-
void(* NvFlexErrorCallback)(NvFlexErrorSeverity type, const char *msg, const char *file, int line)
Definition: NvFlex.h:301
-
Information messages.
Definition: NvFlex.h:218
-
float smoothing
Control the strength of Laplacian smoothing in particles for rendering, if zero then smoothed positio...
Definition: NvFlex.h:134
+
int maxDiffuseParticles
Maximum number of diffuse particles in the solver.
Definition: NvFlex.h:369
+
void(* NvFlexErrorCallback)(NvFlexErrorSeverity type, const char *msg, const char *file, int line)
Definition: NvFlex.h:298
+
Information messages.
Definition: NvFlex.h:235
+
float smoothing
Control the strength of Laplacian smoothing in particles for rendering, if zero then smoothed positio...
Definition: NvFlex.h:132
NV_FLEX_API void NvFlexSetParams(NvFlexSolver *solver, const NvFlexParams *params)
-
Called at the end of solver update after the final substep has completed.
Definition: NvFlex.h:233
-
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)
-
NV_FLEX_API void NvFlexGetSmoothParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
+
Called at the end of solver update after the final substep has completed.
Definition: NvFlex.h:250
+
Particle will collide with shapes with channel 3 set (see NvFlexMakeShapeFlags()) ...
Definition: NvFlex.h:174
NV_FLEX_API void NvFlexUpdateTriangleMesh(NvFlexLibrary *lib, NvFlexTriangleMeshId mesh, NvFlexBuffer *vertices, NvFlexBuffer *indices, int numVertices, int numTriangles, const float *lower, const float *upper)
NV_FLEX_API void NvFlexUnmap(NvFlexBuffer *buffer)
-
If set this particle will interact with particles of the same group.
Definition: NvFlex.h:170
-
float createCellIndices
Time spent creating grid indices.
Definition: NvFlex.h:187
-
float shapeCollisionMargin
Increases the radius used during contact finding against kinematic shapes.
Definition: NvFlex.h:154
-
float scale
Uniform scale of SDF, this corresponds to the world space width of the shape.
Definition: NvFlex.h:804
-
NV_FLEX_API void NvFlexGetActive(NvFlexSolver *solver, NvFlexBuffer *indices)
-
int diffuseBallistic
The number of neighbors below which a diffuse particle is considered ballistic.
Definition: NvFlex.h:143
-
NvFlexRelaxationMode
Definition: NvFlex.h:86
-
float drag
Drag force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in th...
Definition: NvFlex.h:122
-
NvFlexErrorSeverity
Definition: NvFlex.h:215
-
float maxSpeed
The magnitude of particle velocity will be clamped to this value at the end of each step...
Definition: NvFlex.h:113
-
float planes[8][4]
Collision planes in the form ax + by + cz + d = 0.
Definition: NvFlex.h:156
-
float cohesion
Control how strongly particles hold each other together, default: 0.025, range [0.0, +inf].
Definition: NvFlex.h:127
-
float staticFriction
Coefficient of static friction used when colliding against shapes.
Definition: NvFlex.h:107
-
float collideParticles
Time spent finding particle neighbors.
Definition: NvFlex.h:191
-
NvFlexCapsuleGeometry capsule
Definition: NvFlex.h:815
-
float predict
Time spent in prediction.
Definition: NvFlex.h:186
-
Definition: NvFlex.h:783
-
float updateDiffuse
Time spent updating diffuse particles.
Definition: NvFlex.h:204
-
NvFlexSphereGeometry sphere
Definition: NvFlex.h:814
-
float collisionDistance
Distance particles maintain against shapes, note that for robust collision against triangle meshes th...
Definition: NvFlex.h:152
-
NvFlexTriangleMeshGeometry triMesh
Definition: NvFlex.h:818
-
float solveContacts
Time spent solving contact constraints.
Definition: NvFlex.h:200
-
Definition: NvFlex.h:838
-
NvFlexComputeType computeType
Set to eNvFlexD3D11 if DirectX 11 should be used, eNvFlexD3D12 for DirectX 12, this must match the li...
Definition: NvFlex.h:284
+
If set this particle will interact with particles of the same group.
Definition: NvFlex.h:166
+
float createCellIndices
Time spent creating grid indices.
Definition: NvFlex.h:204
+
Particle will collide with shapes with channel 4 set (see NvFlexMakeShapeFlags()) ...
Definition: NvFlex.h:175
+
float shapeCollisionMargin
Increases the radius used during contact finding against kinematic shapes.
Definition: NvFlex.h:147
+
float scale
Uniform scale of SDF, this corresponds to the world space width of the shape.
Definition: NvFlex.h:889
+
int diffuseBallistic
The number of neighbors below which a diffuse particle is considered ballistic.
Definition: NvFlex.h:141
+
NV_FLEX_API void NvFlexSetRigids(NvFlexSolver *solver, NvFlexBuffer *offsets, NvFlexBuffer *indices, NvFlexBuffer *restPositions, NvFlexBuffer *restNormals, NvFlexBuffer *stiffness, NvFlexBuffer *thresholds, NvFlexBuffer *creeps, NvFlexBuffer *rotations, NvFlexBuffer *translations, int numRigids, int numIndices)
+
NvFlexRelaxationMode
Definition: NvFlex.h:85
+
float drag
Drag force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in th...
Definition: NvFlex.h:121
+
NvFlexErrorSeverity
Definition: NvFlex.h:232
+
NV_FLEX_API void NvFlexSetPhases(NvFlexSolver *solver, NvFlexBuffer *phases, const NvFlexCopyDesc *desc)
+
float maxSpeed
The magnitude of particle velocity will be clamped to this value at the end of each step...
Definition: NvFlex.h:112
+
All features enabled.
Definition: NvFlex.h:356
+
float planes[8][4]
Collision planes in the form ax + by + cz + d = 0.
Definition: NvFlex.h:149
+
float cohesion
Control how strongly particles hold each other together, default: 0.025, range [0.0, +inf].
Definition: NvFlex.h:125
+
float staticFriction
Coefficient of static friction used when colliding against shapes.
Definition: NvFlex.h:106
+
float collideParticles
Time spent finding particle neighbors.
Definition: NvFlex.h:208
+
NV_FLEX_API void NvFlexGetNormals(NvFlexSolver *solver, NvFlexBuffer *normals, const NvFlexCopyDesc *desc)
+
NvFlexCapsuleGeometry capsule
Definition: NvFlex.h:900
+
float predict
Time spent in prediction.
Definition: NvFlex.h:203
+
NV_FLEX_API void NvFlexGetDiffuseParticles(NvFlexSolver *solver, NvFlexBuffer *p, NvFlexBuffer *v, NvFlexBuffer *count)
+
Definition: NvFlex.h:868
+
int maxNeighborsPerParticle
Maximum number of neighbors per-particle, for solids this can be around 32, for fluids up to 128 may ...
Definition: NvFlex.h:370
+
float updateDiffuse
Time spent updating diffuse particles.
Definition: NvFlex.h:221
+
NvFlexSphereGeometry sphere
Definition: NvFlex.h:899
+
float collisionDistance
Distance particles maintain against shapes, note that for robust collision against triangle meshes th...
Definition: NvFlex.h:145
+
NvFlexTriangleMeshGeometry triMesh
Definition: NvFlex.h:903
+
float solveContacts
Time spent solving contact constraints.
Definition: NvFlex.h:217
+
NV_FLEX_API void NvFlexSetActiveCount(NvFlexSolver *solver, int n)
+
Bits [20, 23] hold flags about how the particle behave.
Definition: NvFlex.h:163
+
Definition: NvFlex.h:923
+
NvFlexComputeType computeType
Set to eNvFlexD3D11 if DirectX 11 should be used, eNvFlexD3D12 for DirectX 12, this must match the li...
Definition: NvFlex.h:324
NV_FLEX_API void NvFlexDestroyDistanceField(NvFlexLibrary *lib, NvFlexDistanceFieldId sdf)
-
Use DirectX 11 compute for Flex, the application must link against the D3D libraries.
Definition: NvFlex.h:242
+
Use DirectX 11 compute for Flex, the application must link against the D3D libraries.
Definition: NvFlex.h:308
+
NV_FLEX_API void NvFlexGetNeighbors(NvFlexSolver *solver, NvFlexBuffer *neighbors, NvFlexBuffer *counts, NvFlexBuffer *remap)
NV_FLEX_API void NvFlexDestroySolver(NvFlexSolver *solver)
-
Lower 3 bits holds the type of the collision shape.
Definition: NvFlex.h:834
-
const int * originalToSortedMap
Device pointer that maps the sorted callback data to the original position given by SetParticles() ...
Definition: NvFlex.h:271
-
float halfHeight
Definition: NvFlex.h:769
+
Lower 3 bits holds the type of the collision shape given by the NvFlexCollisionShapeType enum...
Definition: NvFlex.h:919
+
const int * originalToSortedMap
Device pointer that maps the sorted callback data to the original position given by SetParticles() ...
Definition: NvFlex.h:280
+
float halfHeight
Definition: NvFlex.h:854
Calling thread will be blocked until buffer is ready for access, default.
Definition: NvFlex.h:69
NV_FLEX_API void NvFlexSetDiffuseParticles(NvFlexSolver *solver, NvFlexBuffer *p, NvFlexBuffer *v, int n)
struct NvFlexSolver NvFlexSolver
Definition: NvFlex.h:57
-
Called at the end of each substep after the velocity has been updated by the constraints.
Definition: NvFlex.h:232
-
float * particles
Device pointer to the active particle basic data in the form x,y,z,1/m.
Definition: NvFlex.h:263
+
Called at the end of each substep after the velocity has been updated by the constraints.
Definition: NvFlex.h:249
+
float * particles
Device pointer to the active particle basic data in the form x,y,z,1/m.
Definition: NvFlex.h:272
+
NV_FLEX_API void NvFlexGetActive(NvFlexSolver *solver, NvFlexBuffer *indices, const NvFlexCopyDesc *desc)
NV_FLEX_API void NvFlexSetInflatables(NvFlexSolver *solver, NvFlexBuffer *startTris, NvFlexBuffer *numTris, NvFlexBuffer *restVolumes, NvFlexBuffer *overPressures, NvFlexBuffer *constraintScales, int numInflatables)
-
Definition: NvFlex.h:758
-
Called at the beginning of each constraint iteration.
Definition: NvFlex.h:229
+
NV_FLEX_API void NvFlexWait(NvFlexLibrary *lib)
+
NV_FLEX_API void NvFlexSetParticles(NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
+
Definition: NvFlex.h:843
+
Definition: NvFlex.h:364
+
int dstOffset
Definition: NvFlex.h:503
+
Called at the beginning of each constraint iteration.
Definition: NvFlex.h:246
NV_FLEX_API void NvFlexGetTriangleMeshBounds(NvFlexLibrary *lib, const NvFlexTriangleMeshId mesh, float *lower, float *upper)
-
Definition: NvFlex.h:258
+
NV_FLEX_API int NvFlexMakeShapeFlagsWithChannels(NvFlexCollisionShapeType type, bool dynamic, int shapeChannels)
Definition: NvFlex.h:933
+
Definition: NvFlex.h:267
NV_FLEX_API NvFlexConvexMeshId NvFlexCreateConvexMesh(NvFlexLibrary *lib)
NV_FLEX_API void * NvFlexMap(NvFlexBuffer *buffer, int flags)
-
float time
Definition: NvFlex.h:993
-
Definition: NvFlex.h:812
-
float updateNormals
Time spent updating vertex normals.
Definition: NvFlex.h:206
-
unsigned int NvFlexTriangleMeshId
Definition: NvFlex.h:633
-
The relaxation factor is a fixed multiplier on each constraint's delta divided by the particle's cons...
Definition: NvFlex.h:89
+
float time
Definition: NvFlex.h:1137
+
Definition: NvFlex.h:897
+
float updateNormals
Time spent updating vertex normals.
Definition: NvFlex.h:223
+
unsigned int NvFlexTriangleMeshId
Definition: NvFlex.h:718
+
The relaxation factor is a fixed multiplier on each constraint's delta divided by the particle's cons...
Definition: NvFlex.h:88
NV_FLEX_API NvFlexBuffer * NvFlexRegisterD3DBuffer(NvFlexLibrary *lib, void *buffer, int elementCount, int elementByteStride)
-
Buffer contents will be discarded, this allows for efficent buffer reuse.
Definition: NvFlex.h:71
-
Indicates that the shape is a trigger volume, this means it will not perform any collision response...
Definition: NvFlex.h:836
-
A sphere shape, see FlexSphereGeometry.
Definition: NvFlex.h:824
-
A signed distance field shape, see FlexSDFGeometry.
Definition: NvFlex.h:829
-
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
-
bool fluid
If true then particles with phase 0 are considered fluid particles and interact using the position ba...
Definition: NvFlex.h:126
-
float viscosity
Smoothes particle velocities using XSPH viscosity.
Definition: NvFlex.h:129
-
NvFlexTriangleMeshId mesh
A triangle mesh pointer created by NvFlexCreateTriangleMesh()
Definition: NvFlex.h:795
-
NV_FLEX_API void NvFlexGetVelocities(NvFlexSolver *solver, NvFlexBuffer *v, int n)
-
NV_FLEX_API int NvFlexMakePhase(int group, int flags)
Definition: NvFlex.h:178
-
float adhesion
Controls how strongly particles stick to surfaces they hit, default 0.0, range [0.0, +inf].
Definition: NvFlex.h:110
+
Indicates that the shape is a trigger volume, this means it will not perform any collision response...
Definition: NvFlex.h:921
+
Simple single phase fluid-only particles (no solids)
Definition: NvFlex.h:358
+
A sphere shape, see FlexSphereGeometry.
Definition: NvFlex.h:909
+
A signed distance field shape, see FlexSDFGeometry.
Definition: NvFlex.h:914
+
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:317
+
float viscosity
Smoothes particle velocities using XSPH viscosity.
Definition: NvFlex.h:127
+
NvFlexTriangleMeshId mesh
A triangle mesh pointer created by NvFlexCreateTriangleMesh()
Definition: NvFlex.h:880
+
float adhesion
Controls how strongly particles stick to surfaces they hit, default 0.0, range [0.0, +inf].
Definition: NvFlex.h:109
NV_FLEX_API void NvFlexUnregisterOGLBuffer(NvFlexBuffer *buf)
-
float halfExtents[3]
Definition: NvFlex.h:777
-
Definition: NvFlex.h:775
-
NV_FLEX_API void NvFlexGetPhases(NvFlexSolver *solver, NvFlexBuffer *phases, int n)
+
float halfExtents[3]
Definition: NvFlex.h:862
+
Definition: NvFlex.h:860
NV_FLEX_API NvFlexDistanceFieldId NvFlexCreateDistanceField(NvFlexLibrary *lib)
-
int * phases
Device pointer to the active particle phase data.
Definition: NvFlex.h:265
+
int * phases
Device pointer to the active particle phase data.
Definition: NvFlex.h:274
NV_FLEX_API void NvFlexFlush(NvFlexLibrary *lib)
NV_FLEX_API void NvFlexGetBounds(NvFlexSolver *solver, NvFlexBuffer *lower, NvFlexBuffer *upper)
-
Host mappable buffer, pinned memory on CUDA, staging buffer on DX.
Definition: NvFlex.h:79
-
int numActive
The number of active particles returned, the callback data only return pointers to active particle da...
Definition: NvFlex.h:267
+
A host mappable buffer, pinned memory on CUDA, staging buffer on DX.
Definition: NvFlex.h:78
+
int numActive
The number of active particles returned, the callback data only return pointers to active particle da...
Definition: NvFlex.h:276
NV_FLEX_API NvFlexLibrary * NvFlexGetSolverLibrary(NvFlexSolver *solver)
+
Particle will collide with shapes with channel 7 set (see NvFlexMakeShapeFlags()) ...
Definition: NvFlex.h:178
struct NvFlexBuffer NvFlexBuffer
Definition: NvFlex.h:62
-
float sortCellIndices
Time spent sorting grid indices.
Definition: NvFlex.h:188
-
float radius
The maximum interaction radius for particles.
Definition: NvFlex.h:101
+
float sortCellIndices
Time spent sorting grid indices.
Definition: NvFlex.h:205
+
int srcOffset
Definition: NvFlex.h:502
+
int maxParticles
Maximum number of regular particles in the solver.
Definition: NvFlex.h:368
+
NV_FLEX_API void NvFlexGetRestParticles(NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
+
void * computeContext
Direct3D context to use for simulation, if none is specified a new context will be created...
Definition: NvFlex.h:321
+
float radius
The maximum interaction radius for particles.
Definition: NvFlex.h:100
NV_FLEX_API void NvFlexGetContacts(NvFlexSolver *solver, NvFlexBuffer *planes, NvFlexBuffer *velocities, NvFlexBuffer *indices, NvFlexBuffer *counts)
-
NvFlexBoxGeometry box
Definition: NvFlex.h:816
-
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
-
float anisotropyMin
Clamp the anisotropy scale to this fraction of the radius.
Definition: NvFlex.h:132
-
float applyDeltas
Time spent adding position deltas to particles.
Definition: NvFlex.h:202
-
NvFlexDistanceFieldId field
A signed distance field pointer created by NvFlexCreateDistanceField()
Definition: NvFlex.h:805
-
float calculateDensity
Time spent calculating fluid density.
Definition: NvFlex.h:195
-
void * userData
Definition: NvFlex.h:292
-
A capsule shape, see FlexCapsuleGeometry.
Definition: NvFlex.h:825
+
NvFlexBoxGeometry box
Definition: NvFlex.h:901
+
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:273
+
Particle will collide with shapes with channel 1 set (see NvFlexMakeShapeFlags()) ...
Definition: NvFlex.h:172
+
NV_FLEX_API float NvFlexGetDeviceLatency(NvFlexSolver *solver, unsigned long long *begin, unsigned long long *end, unsigned long long *frequency)
+
float anisotropyMin
Clamp the anisotropy scale to this fraction of the radius.
Definition: NvFlex.h:130
+
float applyDeltas
Time spent adding position deltas to particles.
Definition: NvFlex.h:219
+
NvFlexDistanceFieldId field
A signed distance field pointer created by NvFlexCreateDistanceField()
Definition: NvFlex.h:890
+
float calculateDensity
Time spent calculating fluid density.
Definition: NvFlex.h:212
+
void * userData
Definition: NvFlex.h:289
+
A capsule shape, see FlexCapsuleGeometry.
Definition: NvFlex.h:910
NV_FLEX_API NvFlexTriangleMeshId NvFlexCreateTriangleMesh(NvFlexLibrary *lib)
-
NV_FLEX_API void NvFlexSetRestParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
+
NvFlexFeatureMode featureMode
Control which features are enabled.
Definition: NvFlex.h:366
NV_FLEX_API void NvFlexShutdown(NvFlexLibrary *lib)
-
NvFlexSolver * solver
Pointer to the solver that the callback is registered to.
Definition: NvFlex.h:260
-
If set this particle will generate fluid density constraints for its overlapping neighbors.
Definition: NvFlex.h:172
-
NvFlexPhase
Definition: NvFlex.h:166
+
NvFlexSolver * solver
Pointer to the solver that the callback is registered to.
Definition: NvFlex.h:269
+
If set this particle will generate fluid density constraints for its overlapping neighbors.
Definition: NvFlex.h:168
+
NvFlexFeatureMode
Definition: NvFlex.h:354
+
NvFlexPhase
Definition: NvFlex.h:160
NV_FLEX_API void NvFlexUnregisterD3DBuffer(NvFlexBuffer *buf)
-
float sleepThreshold
Particles with a velocity magnitude < this threshold will be considered fixed.
Definition: NvFlex.h:111
-
NV_FLEX_API void NvFlexGetDensities(NvFlexSolver *solver, NvFlexBuffer *densities, int n)
+
bool useComputeQueue
If true, run Flex on a D3D12 compute queue, or vendor specific D3D11 compute queue. This allows compute and graphics to run in parallel on some GPUs.
Definition: NvFlex.h:322
+
float sleepThreshold
Particles with a velocity magnitude < this threshold will be considered fixed.
Definition: NvFlex.h:110
NV_FLEX_API int NvFlexGetVersion()
-
float anisotropyMax
Clamp the anisotropy scale to this fraction of the radius.
Definition: NvFlex.h:133
-
float collideTriangles
Time spent colliding triangle shapes.
Definition: NvFlex.h:193
+
float anisotropyMax
Clamp the anisotropy scale to this fraction of the radius.
Definition: NvFlex.h:131
+
float collideTriangles
Time spent colliding triangle shapes.
Definition: NvFlex.h:210
NV_FLEX_API int NvFlexGetDetailTimers(NvFlexSolver *solver, NvFlexDetailTimer **timers)
-
NV_FLEX_API void NvFlexSetVelocities(NvFlexSolver *solver, NvFlexBuffer *v, int n)
NV_FLEX_API void NvFlexGetConvexMeshBounds(NvFlexLibrary *lib, NvFlexConvexMeshId mesh, float *lower, float *upper)
-
Indicates the shape is dynamic and should have lower priority over static collision shapes...
Definition: NvFlex.h:835
+
Indicates the shape is dynamic and should have lower priority over static collision shapes...
Definition: NvFlex.h:920
Calling thread will check if buffer is ready for access, if not ready then the method will return NUL...
Definition: NvFlex.h:70
-
NV_FLEX_API void NvFlexGetNormals(NvFlexSolver *solver, NvFlexBuffer *normals, int n)
-
float shockPropagation
Artificially decrease the mass of particles based on height from a fixed reference point...
Definition: NvFlex.h:116
+
NV_FLEX_API int NvFlexMakePhaseWithChannels(int group, int particleFlags, int shapeChannels)
Definition: NvFlex.h:190
+
NV_FLEX_API int NvFlexMakePhase(int group, int particleFlags)
Definition: NvFlex.h:195
+
NV_FLEX_API void NvFlexSetActive(NvFlexSolver *solver, NvFlexBuffer *indices, const NvFlexCopyDesc *desc)
+
float shockPropagation
Artificially decrease the mass of particles based on height from a fixed reference point...
Definition: NvFlex.h:115
NV_FLEX_API const char * NvFlexGetDeviceName(NvFlexLibrary *lib)
NV_FLEX_API void NvFlexDestroyConvexMesh(NvFlexLibrary *lib, NvFlexConvexMeshId convex)
-
float collideFields
Time spent colliding signed distance field shapes.
Definition: NvFlex.h:194
-
float calculateAnisotropy
Time spent calculating particle anisotropy for fluid.
Definition: NvFlex.h:203
-
void * renderContext
Direct3D context to use for simulation, if none is specified a new context will be created...
Definition: NvFlex.h:282
+
float collideFields
Time spent colliding signed distance field shapes.
Definition: NvFlex.h:211
+
float calculateAnisotropy
Time spent calculating particle anisotropy for fluid.
Definition: NvFlex.h:220
+
Particle will collide with shapes with channel 6 set (see NvFlexMakeShapeFlags()) ...
Definition: NvFlex.h:177
+
NV_FLEX_API void NvFlexGetParticles(NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
+
void * renderContext
Direct3D context that the app is using for rendering. In DirectX 12 this should be a ID3D12CommandQue...
Definition: NvFlex.h:320
struct NvFlexLibrary NvFlexLibrary
Definition: NvFlex.h:52
NV_FLEX_API void NvFlexAcquireContext(NvFlexLibrary *lib)
NV_FLEX_API NvFlexLibrary * NvFlexInit(int version=NV_FLEX_VERSION, NvFlexErrorCallback errorFunc=0, NvFlexInitDesc *desc=0)
-
float freeSurfaceDrag
Drag force applied to boundary fluid particles.
Definition: NvFlex.h:136
-
NV_FLEX_API float NvFlexGetDeviceLatency(NvFlexSolver *solver)
-
NvFlexSDFGeometry sdf
Definition: NvFlex.h:819
-
float maxAcceleration
The magnitude of particle acceleration will be clamped to this value at the end of each step (limits ...
Definition: NvFlex.h:114
-
float wind[3]
Constant acceleration applied to particles that belong to dynamic triangles, drag needs to be > 0 for...
Definition: NvFlex.h:121
+
float freeSurfaceDrag
Drag force applied to boundary fluid particles.
Definition: NvFlex.h:134
+
NV_FLEX_API void NvFlexSetNormals(NvFlexSolver *solver, NvFlexBuffer *normals, const NvFlexCopyDesc *desc)
+
NvFlexSDFGeometry sdf
Definition: NvFlex.h:904
+
float maxAcceleration
The magnitude of particle acceleration will be clamped to this value at the end of each step (limits ...
Definition: NvFlex.h:113
+
float wind[3]
Constant acceleration applied to particles that belong to dynamic triangles, drag needs to be > 0 for...
Definition: NvFlex.h:120
+
Particle will collide with shapes with channel 5 set (see NvFlexMakeShapeFlags()) ...
Definition: NvFlex.h:176
+
NV_FLEX_API NvFlexSolver * NvFlexCreateSolver(NvFlexLibrary *lib, const NvFlexSolverDesc *desc)
NV_FLEX_API void NvFlexUpdateDistanceField(NvFlexLibrary *lib, NvFlexDistanceFieldId sdf, int dimx, int dimy, int dimz, NvFlexBuffer *field)
-
Definition: NvFlex.h:184
-
float surfaceTension
Controls how strongly particles attempt to minimize surface area, default: 0.0, range: [0...
Definition: NvFlex.h:128
-
float dt
The per-update time-step, this is the value passed to NvFlexUpdateSolver()
Definition: NvFlex.h:269
-
float diffuseSortAxis[3]
Diffuse particles will be sorted by depth along this axis if non-zero.
Definition: NvFlex.h:144
-
float fluidRestDistance
The distance fluid particles are spaced at the rest density, must be in the range (0...
Definition: NvFlex.h:103
-
float reorder
Time spent reordering particles.
Definition: NvFlex.h:190
-
unsigned int NvFlexDistanceFieldId
Definition: NvFlex.h:638
-
A triangle mesh shape, see FlexTriangleMeshGeometry.
Definition: NvFlex.h:828
-
If set this particle will ignore collisions with particles closer than the radius in the rest pose...
Definition: NvFlex.h:171
-
NV_FLEX_API void NvFlexGetAnisotropy(NvFlexSolver *solver, NvFlexBuffer *q1, NvFlexBuffer *q2, NvFlexBuffer *q3)
+
Definition: NvFlex.h:201
+
float surfaceTension
Controls how strongly particles attempt to minimize surface area, default: 0.0, range: [0...
Definition: NvFlex.h:126
+
Particle will collide with shapes with channel 0 set (see NvFlexMakeShapeFlags()) ...
Definition: NvFlex.h:171
+
float dt
The per-update time-step, this is the value passed to NvFlexUpdateSolver()
Definition: NvFlex.h:278
+
float fluidRestDistance
The distance fluid particles are spaced at the rest density, must be in the range (0...
Definition: NvFlex.h:102
+
float reorder
Time spent reordering particles.
Definition: NvFlex.h:207
+
unsigned int NvFlexDistanceFieldId
Definition: NvFlex.h:723
+
A triangle mesh shape, see FlexTriangleMeshGeometry.
Definition: NvFlex.h:913
+
If set this particle will ignore collisions with particles closer than the radius in the rest pose...
Definition: NvFlex.h:167
NV_FLEX_API void NvFlexGetTimers(NvFlexSolver *solver, NvFlexTimers *timers)
-
NvFlexConvexMeshId mesh
Definition: NvFlex.h:786
-
NvFlexConvexMeshGeometry convexMesh
Definition: NvFlex.h:817
-
NvFlexSolverCallbackStage
Definition: NvFlex.h:227
-
float dissipation
Damps particle velocity based on how many particle contacts it has.
Definition: NvFlex.h:117
-
NvFlexCollisionShapeType
Definition: NvFlex.h:822
-
Used only in debug version of dll.
Definition: NvFlex.h:220
-
Use CUDA compute for Flex, the application must link against the CUDA libraries.
Definition: NvFlex.h:241
-
NvFlexRelaxationMode relaxationMode
How the relaxation is applied inside the solver.
Definition: NvFlex.h:159
-
float lift
Lift force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in th...
Definition: NvFlex.h:123
+
NvFlexConvexMeshId mesh
Definition: NvFlex.h:871
+
NV_FLEX_API void NvFlexGetRigids(NvFlexSolver *solver, NvFlexBuffer *offsets, NvFlexBuffer *indices, NvFlexBuffer *restPositions, NvFlexBuffer *restNormals, NvFlexBuffer *stiffness, NvFlexBuffer *thresholds, NvFlexBuffer *creeps, NvFlexBuffer *rotations, NvFlexBuffer *translations)
+
NvFlexConvexMeshGeometry convexMesh
Definition: NvFlex.h:902
+
NvFlexSolverCallbackStage
Definition: NvFlex.h:244
+
float dissipation
Damps particle velocity based on how many particle contacts it has.
Definition: NvFlex.h:116
+
NvFlexCollisionShapeType
Definition: NvFlex.h:907
+
Used only in debug version of dll.
Definition: NvFlex.h:237
+
Use CUDA compute for Flex, the application must link against the CUDA libraries.
Definition: NvFlex.h:307
+
NV_FLEX_API void NvFlexUpdateConvexMesh(NvFlexLibrary *lib, NvFlexConvexMeshId convex, NvFlexBuffer *planes, int numPlanes, const float *lower, const float *upper)
+
NvFlexRelaxationMode relaxationMode
How the relaxation is applied inside the solver.
Definition: NvFlex.h:152
+
float lift
Lift force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in th...
Definition: NvFlex.h:122
NV_FLEX_API void NvFlexGetDeviceAndContext(NvFlexLibrary *lib, void **device, void **context)
-
void * renderDevice
Direct3D device to use for simulation, if none is specified a new device and context will be created...
Definition: NvFlex.h:281
-
A box shape, see FlexBoxGeometry.
Definition: NvFlex.h:826
-
float damping
Viscous drag force, applies a force proportional, and opposite to the particle velocity.
Definition: NvFlex.h:118
+
void * renderDevice
Direct3D device to use for simulation, if none is specified a new device and context will be created...
Definition: NvFlex.h:319
+
A box shape, see FlexBoxGeometry.
Definition: NvFlex.h:911
+
float damping
Viscous drag force, applies a force proportional, and opposite to the particle velocity.
Definition: NvFlex.h:117
NV_FLEX_API void NvFlexSetDynamicTriangles(NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *normals, int numTris)
-
NvFlexCollisionShapeFlags
Definition: NvFlex.h:832
-
int numPlanes
Num collision planes.
Definition: NvFlex.h:157
-
NV_FLEX_API void NvFlexUpdateConvexMesh(NvFlexLibrary *lib, NvFlexConvexMeshId convex, NvFlexBuffer *planes, int numPlanes, float *lower, float *upper)
+
NvFlexCollisionShapeFlags
Definition: NvFlex.h:917
+
int numPlanes
Num collision planes.
Definition: NvFlex.h:150
NV_FLEX_API NvFlexBuffer * NvFlexAllocBuffer(NvFlexLibrary *lib, int elementCount, int elementByteStride, NvFlexBufferType type)
-
Definition: NvFlex.h:96
-
float collideShapes
Time spent colliding convex shapes.
Definition: NvFlex.h:192
-
float particleFriction
Coefficient of friction used when colliding particles.
Definition: NvFlex.h:108
+
Definition: NvFlex.h:95
+
float collideShapes
Time spent colliding convex shapes.
Definition: NvFlex.h:209
+
float particleFriction
Coefficient of friction used when colliding particles.
Definition: NvFlex.h:107
NV_FLEX_API void NvFlexUpdateSolver(NvFlexSolver *solver, float dt, int substeps, bool enableTimers)
-
NV_FLEX_API void NvFlexSetNormals(NvFlexSolver *solver, NvFlexBuffer *normals, int n)
-
NV_FLEX_API void NvFlexGetRigidTransforms(NvFlexSolver *solver, NvFlexBuffer *rotations, NvFlexBuffer *translations)
-
float createGrid
Time spent creating grid.
Definition: NvFlex.h:189
-
Low 24 bits represent the particle group for controlling collisions.
Definition: NvFlex.h:168
-
NV_FLEX_API void NvFlexGetParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
-
float buoyancy
Gravity is scaled by this value for fluid particles.
Definition: NvFlex.h:137
-
All log types.
Definition: NvFlex.h:221
+
float createGrid
Time spent creating grid.
Definition: NvFlex.h:206
+
Bits [ 0, 19] represent the particle group for controlling collisions.
Definition: NvFlex.h:162
+
float buoyancy
Gravity is scaled by this value for fluid particles.
Definition: NvFlex.h:135
+
All log types.
Definition: NvFlex.h:238
NV_FLEX_API void NvFlexSetShapes(NvFlexSolver *solver, NvFlexBuffer *geometry, NvFlexBuffer *shapePositions, NvFlexBuffer *shapeRotations, NvFlexBuffer *shapePrevPositions, NvFlexBuffer *shapePrevRotations, NvFlexBuffer *shapeFlags, int numShapes)
-
NV_FLEX_API void NvFlexSetParticles(NvFlexSolver *solver, NvFlexBuffer *p, int n)
-
Use DirectX 12 compute for Flex, the application must link against the D3D libraries.
Definition: NvFlex.h:243
-
float scale[3]
The scale of the object from local space to world space.
Definition: NvFlex.h:794
-
float solveDensities
Time spent solving density constraints.
Definition: NvFlex.h:196
-
float plasticThreshold
Particles belonging to rigid shapes that move with a position delta magnitude > threshold will be per...
Definition: NvFlex.h:148
+
Use DirectX 12 compute for Flex, the application must link against the D3D libraries.
Definition: NvFlex.h:309
+
float scale[3]
The scale of the object from local space to world space.
Definition: NvFlex.h:879
+
float solveDensities
Time spent solving density constraints.
Definition: NvFlex.h:213
+
NV_FLEX_API void NvFlexGetSmoothParticles(NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
+
NV_FLEX_API void NvFlexGetAnisotropy(NvFlexSolver *solver, NvFlexBuffer *q1, NvFlexBuffer *q2, NvFlexBuffer *q3, const NvFlexCopyDesc *desc)
NV_FLEX_API void NvFlexDestroyTriangleMesh(NvFlexLibrary *lib, NvFlexTriangleMeshId mesh)
-
float gravity[3]
Constant acceleration applied to all particles.
Definition: NvFlex.h:100
-
Called at the end of each constraint iteration.
Definition: NvFlex.h:230
-
Error messages.
Definition: NvFlex.h:217
+
float gravity[3]
Constant acceleration applied to all particles.
Definition: NvFlex.h:99
+
Called at the end of each constraint iteration.
Definition: NvFlex.h:247
+
Error messages.
Definition: NvFlex.h:234
NV_FLEX_API void NvFlexFreeBuffer(NvFlexBuffer *buf)
-
float solveInflatables
Time spent solving pressure constraints.
Definition: NvFlex.h:201
-
Called at the beginning of each substep after the prediction step has been completed.
Definition: NvFlex.h:231
-
NV_FLEX_API void NvFlexSetPhases(NvFlexSolver *solver, NvFlexBuffer *phases, int n)
-
Definition: NvFlex.h:277
-
The relaxation factor is a fixed multiplier on each constraint's position delta.
Definition: NvFlex.h:88
-
Definition: NvFlex.h:766
-
float total
Sum of all timers above.
Definition: NvFlex.h:209
-
void * userData
Pointer to the user data provided to NvFlexRegisterSolverCallback()
Definition: NvFlex.h:261
-
float radius
Definition: NvFlex.h:768
+
Bits [24, 31] hold flags representing what shape collision channels particles will collide with...
Definition: NvFlex.h:164
+
float solveInflatables
Time spent solving pressure constraints.
Definition: NvFlex.h:218
+
Called at the beginning of each substep after the prediction step has been completed.
Definition: NvFlex.h:248
+
Simple per-particle collision (no per-particle SDF normals, no fluids)
Definition: NvFlex.h:357
+
Definition: NvFlex.h:315
+
The relaxation factor is a fixed multiplier on each constraint's position delta.
Definition: NvFlex.h:87
+
NV_FLEX_API void NvFlexGetVelocities(NvFlexSolver *solver, NvFlexBuffer *v, const NvFlexCopyDesc *desc)
+
Definition: NvFlex.h:851
+
float total
Sum of all timers above.
Definition: NvFlex.h:226
+
void * userData
Pointer to the user data provided to NvFlexRegisterSolverCallback()
Definition: NvFlex.h:270
+
NV_FLEX_API void NvFlexGetDensities(NvFlexSolver *solver, NvFlexBuffer *densities, const NvFlexCopyDesc *desc)
+
float radius
Definition: NvFlex.h:853
NV_FLEX_API void NvFlexGetDynamicTriangles(NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *normals, int numTris)
-
NV_FLEX_API int NvFlexMakeShapeFlags(NvFlexCollisionShapeType type, bool dynamic)
Definition: NvFlex.h:844
+
NV_FLEX_API int NvFlexMakeShapeFlags(NvFlexCollisionShapeType type, bool dynamic)
Definition: NvFlex.h:938
NV_FLEX_API NvFlexBuffer * NvFlexRegisterOGLBuffer(NvFlexLibrary *lib, int buf, int elementCount, int elementByteStride)
-
Definition: NvFlex.h:990
-
float relaxationFactor
Control the convergence rate of the parallel solver, default: 1, values greater than 1 may lead to in...
Definition: NvFlex.h:160
+
Definition: NvFlex.h:1134
+
Particle will collide with shapes with channel 2 set (see NvFlexMakeShapeFlags()) ...
Definition: NvFlex.h:173
+
float relaxationFactor
Control the convergence rate of the parallel solver, default: 1, values greater than 1 may lead to in...
Definition: NvFlex.h:153
NV_FLEX_API void NvFlexSetSprings(NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *restLengths, NvFlexBuffer *stiffness, int numSprings)
-
float finalize
Time spent finalizing state.
Definition: NvFlex.h:207
-
const int * sortedToOriginalMap
Device pointer that maps the original particle index to the index in the callback data structure...
Definition: NvFlex.h:272
-
NvFlexComputeType
Definition: NvFlex.h:239
-
NV_FLEX_API void NvFlexSetActive(NvFlexSolver *solver, NvFlexBuffer *indices, int n)
-
float dynamicFriction
Coefficient of friction used when colliding against shapes.
Definition: NvFlex.h:106
-
float plasticCreep
Controls the rate at which particles in the rest pose are deformed for particles passing the deformat...
Definition: NvFlex.h:149
-
Definition: NvFlex.h:802
-
float scale[3]
Definition: NvFlex.h:785
-
Definition: NvFlex.h:289
-
float diffuseBuoyancy
Scales force opposing gravity that diffuse particles receive.
Definition: NvFlex.h:141
-
float updateBounds
Time spent updating particle bounds.
Definition: NvFlex.h:208
-
char * name
Definition: NvFlex.h:992
-
float solidRestDistance
The distance non-fluid particles attempt to maintain from each other, must be in the range (0...
Definition: NvFlex.h:102
-
float solidPressure
Add pressure from solid surfaces to particles.
Definition: NvFlex.h:135
-
float solveVelocities
Time spent solving velocity constraints.
Definition: NvFlex.h:197
-
Number of stages.
Definition: NvFlex.h:234
-
float restitution
Coefficient of restitution used when colliding against shapes, particle collisions are always inelast...
Definition: NvFlex.h:109
-
Definition: NvFlex.h:792
-
int numIterations
Number of solver iterations to perform per-substep.
Definition: NvFlex.h:98
+
float finalize
Time spent finalizing state.
Definition: NvFlex.h:224
+
const int * sortedToOriginalMap
Device pointer that maps the original particle index to the index in the callback data structure...
Definition: NvFlex.h:281
+
NvFlexComputeType
Definition: NvFlex.h:305
+
float dynamicFriction
Coefficient of friction used when colliding against shapes.
Definition: NvFlex.h:105
+
Definition: NvFlex.h:887
+
float scale[3]
Definition: NvFlex.h:870
+
Definition: NvFlex.h:286
+
float diffuseBuoyancy
Scales force opposing gravity that diffuse particles receive.
Definition: NvFlex.h:139
+
float updateBounds
Time spent updating particle bounds.
Definition: NvFlex.h:225
+
char * name
Definition: NvFlex.h:1136
+
float solidRestDistance
The distance non-fluid particles attempt to maintain from each other, must be in the range (0...
Definition: NvFlex.h:101
+
NV_FLEX_API void NvFlexSetSolverDescDefaults(NvFlexSolverDesc *desc)
+
float solidPressure
Add pressure from solid surfaces to particles.
Definition: NvFlex.h:133
+
float solveVelocities
Time spent solving velocity constraints.
Definition: NvFlex.h:214
+
Number of stages.
Definition: NvFlex.h:251
+
float restitution
Coefficient of restitution used when colliding against shapes, particle collisions are always inelast...
Definition: NvFlex.h:108
+
Definition: NvFlex.h:877
+
int numIterations
Number of solver iterations to perform per-substep.
Definition: NvFlex.h:97
NV_FLEX_API void NvFlexRestoreContext(NvFlexLibrary *lib)
NV_FLEX_API void NvFlexGetParams(NvFlexSolver *solver, NvFlexParams *params)
-
NV_FLEX_API NvFlexSolver * NvFlexCreateSolver(NvFlexLibrary *lib, int maxParticles, int maxDiffuseParticles, int maxNeighborsPerParticle=96)
-
float anisotropyScale
Control how much anisotropy is present in resulting ellipsoids for rendering, if zero then anisotropy...
Definition: NvFlex.h:131
-
float vorticityConfinement
Increases vorticity by applying rotational forces to particles.
Definition: NvFlex.h:130
-
NV_FLEX_API int NvFlexGetDiffuseParticles(NvFlexSolver *solver, NvFlexBuffer *p, NvFlexBuffer *v, NvFlexBuffer *indices)
-
float diffuseLifetime
Time in seconds that a diffuse particle will live for after being spawned, particles will be spawned ...
Definition: NvFlex.h:145
-
float diffuseDrag
Scales force diffuse particles receive in direction of neighbor fluid particles.
Definition: NvFlex.h:142
-
float particleCollisionMargin
Increases the radius used during neighbor finding, this is useful if particles are expected to move s...
Definition: NvFlex.h:153
-
float diffuseThreshold
Particles with kinetic energy + divergence above this threshold will spawn new diffuse particles...
Definition: NvFlex.h:140
-
Device memory buffer, mapping this on CUDA will return a device memory pointer, and will return a buf...
Definition: NvFlex.h:80
+
float anisotropyScale
Control how much anisotropy is present in resulting ellipsoids for rendering, if zero then anisotropy...
Definition: NvFlex.h:129
+
float vorticityConfinement
Increases vorticity by applying rotational forces to particles.
Definition: NvFlex.h:128
+
float diffuseLifetime
Time in seconds that a diffuse particle will live for after being spawned, particles will be spawned ...
Definition: NvFlex.h:142
+
float diffuseDrag
Scales force diffuse particles receive in direction of neighbor fluid particles.
Definition: NvFlex.h:140
+
NV_FLEX_API void NvFlexGetSolverDesc(NvFlexSolver *solver, NvFlexSolverDesc *desc)
+
float particleCollisionMargin
Increases the radius used during neighbor finding, this is useful if particles are expected to move s...
Definition: NvFlex.h:146
+
float diffuseThreshold
Particles with kinetic energy + divergence above this threshold will spawn new diffuse particles...
Definition: NvFlex.h:138
+
int elementCount
Definition: NvFlex.h:504
+
A device memory buffer, mapping this on CUDA will return a device memory pointer, and will return a b...
Definition: NvFlex.h:79
NV_FLEX_API void NvFlexGetSprings(NvFlexSolver *solver, NvFlexBuffer *indices, NvFlexBuffer *restLengths, NvFlexBuffer *stiffness, int numSprings)
-
A convex mesh shape, see FlexConvexMeshGeometry.
Definition: NvFlex.h:827
-
float updateTriangles
Time spent updating dynamic triangles.
Definition: NvFlex.h:205
-
NvFlexBufferType
Definition: NvFlex.h:77
-
bool enableExtensions
Enable or disable NVIDIA/AMD extensions in DirectX, can lead to improved performance.
Definition: NvFlex.h:280
-
unsigned int NvFlexConvexMeshId
Definition: NvFlex.h:645
+
NV_FLEX_API void NvFlexSetRestParticles(NvFlexSolver *solver, NvFlexBuffer *p, const NvFlexCopyDesc *desc)
+
NV_FLEX_API void NvFlexSetVelocities(NvFlexSolver *solver, NvFlexBuffer *v, const NvFlexCopyDesc *desc)
+
A convex mesh shape, see FlexConvexMeshGeometry.
Definition: NvFlex.h:912
+
float updateTriangles
Time spent updating dynamic triangles.
Definition: NvFlex.h:222
+
Definition: NvFlex.h:500
+
NvFlexBufferType
Definition: NvFlex.h:76
+
bool enableExtensions
Enable or disable NVIDIA/AMD extensions in DirectX, can lead to improved performance.
Definition: NvFlex.h:318
+
unsigned int NvFlexConvexMeshId
Definition: NvFlex.h:730
diff --git a/doc/_static/api/_nv_flex_device_8h.html b/doc/_static/api/_nv_flex_device_8h.html index 20f041b..9f0be26 100644 --- a/doc/_static/api/_nv_flex_device_8h.html +++ b/doc/_static/api/_nv_flex_device_8h.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -115,7 +115,7 @@ Functions diff --git a/doc/_static/api/_nv_flex_device_8h_source.html b/doc/_static/api/_nv_flex_device_8h_source.html index 42e8d54..8986294 100644 --- a/doc/_static/api/_nv_flex_device_8h_source.html +++ b/doc/_static/api/_nv_flex_device_8h_source.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -91,7 +91,7 @@ diff --git a/doc/_static/api/_nv_flex_ext_8h.html b/doc/_static/api/_nv_flex_ext_8h.html index fc0433a..8b89124 100644 --- a/doc/_static/api/_nv_flex_ext_8h.html +++ b/doc/_static/api/_nv_flex_ext_8h.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -109,8 +109,8 @@ Functions   NV_FLEX_API NvFlexExtAssetNvFlexExtCreateRigidFromMesh (const float *vertices, int numVertices, const int *indices, int numTriangleIndices, float radius, float expand)   -NV_FLEX_API NvFlexExtAssetNvFlexExtCreateSoftFromMesh (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) -  +NV_FLEX_API NvFlexExtAssetNvFlexExtCreateSoftFromMesh (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 clusterPlasticThreshold, float clusterPlasticCreep) +  NV_FLEX_API void NvFlexExtDestroyAsset (NvFlexExtAsset *asset)   NV_FLEX_API void NvFlexExtCreateSoftMeshSkinning (const float *vertices, int numVertices, const float *bones, int numBones, float falloff, float maxDistance, float *skinningWeights, int *skinningIndices) @@ -310,6 +310,18 @@ numShapes The number of shape matching constraints. +float * + +shapePlasticThresholds + +The plastic threshold coefficient for each shape. + +float * + +shapePlasticCreeps + +The plastic creep coefficient for each shape. + int * triangleIndices @@ -1232,7 +1244,7 @@ Linear or no falloff. - +
@@ -1312,7 +1324,19 @@ Linear or no falloff. - + + + + + + + + + + + + + @@ -1337,6 +1361,8 @@ Linear or no falloff. + +
float globalStiffness globalStiffness,
float clusterPlasticThreshold,
float clusterPlasticCreep 
[in]linkRadiusAny particles below this distance will have additional distance constraints created between them
[in]linkStiffnessThe stiffness of distance links
[in]globalStiffnessIf this parameter is > 0.0f, adds an additional global cluster that consists of all particles in the shape. The stiffness of this cluster is the globalStiffness.
[in]clusterPlasticThresholdParticles belonging to rigid shapes that move with a position delta magnitude > threshold will be permanently deformed in the rest pose, if clusterPlasticCreep > 0.0f
[in]clusterPlasticCreepControls the rate at which particles in the rest pose are deformed for particles passing the deformation threshold
@@ -1879,7 +1905,7 @@ Linear or no falloff.
-

Notifies the container that asset data has changed and needs to be sent to the GPU this should be called if the constrains for an existing asset are modified by the user

+

Notifies the container that asset data has changed and needs to be sent to the GPU this should be called if the constraints for an existing asset are modified by the user

Parameters
@@ -2038,7 +2064,7 @@ Linear or no falloff.

Create a NvFlexExtForceFieldCallback structure, each callback is associated with the passed in solver once the NvFlexExtSetForceFields() is called.

Parameters
[in]containerThe container the instance referencing the asset belongs to
- +
[in]solverA valid solver created with NvFlexCreateSolver()
[in]solverA valid solver created with NvFlexCreateSolver()
@@ -2113,7 +2139,7 @@ Linear or no falloff.
diff --git a/doc/_static/api/_nv_flex_ext_8h_source.html b/doc/_static/api/_nv_flex_ext_8h_source.html index d704ded..18c994b 100644 --- a/doc/_static/api/_nv_flex_ext_8h_source.html +++ b/doc/_static/api/_nv_flex_ext_8h_source.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -80,7 +80,7 @@
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  {
@@ -91,7 +91,7 @@
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();
@@ -109,515 +109,524 @@
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 
+ +
77 
+
78  // reinitialize the vector leaving it unmapped
+
79  void init(int size)
+
80  {
+
81  destroy();
+
82  resize(size);
+
83  unmap();
+
84  }
+
85 
+
86  void destroy()
+
87  {
+
88  if (mappedPtr)
+
89  NvFlexUnmap(buffer);
+
90 
+
91  if (buffer)
+
92  NvFlexFreeBuffer(buffer);
+
93 
+
94  mappedPtr = NULL;
+
95  buffer = NULL;
+
96  capacity = 0;
+
97  count = 0;
+
98  }
+
99 
+
100  void map(int flags=eNvFlexMapWait)
+
101  {
+
102  if (!buffer)
+
103  return;
+
104 
+
105  assert(!mappedPtr);
+
106  mappedPtr = (T*)NvFlexMap(buffer, flags);
+
107  }
+
108 
+
109  void unmap()
+
110  {
+
111  if (!buffer)
+
112  return;
+
113 
+
114  assert(mappedPtr);
+
115 
+
116  NvFlexUnmap(buffer);
+
117  mappedPtr = 0;
+
118  }
+
119 
+
120  const T& operator[](int index) const
+
121  {
+
122  assert(mappedPtr);
+
123  assert(index < count);
+
124 
+
125  return mappedPtr[index];
+
126  }
+
127 
+
128  T& operator[](int index)
+
129  {
+
130  assert(mappedPtr);
+
131  assert(index < count);
+
132 
+
133  return mappedPtr[index];
+
134  }
+
135 
+
136  void push_back(const T& t)
+
137  {
+
138  assert(mappedPtr || !buffer);
+
139 
+
140  reserve(count+1);
+
141 
+
142  // copy element
+
143  mappedPtr[count++] = t;
+
144  }
+
145 
+
146  void assign(const T* srcPtr, int newCount)
+
147  {
+
148  assert(mappedPtr || !buffer);
+
149 
+
150  resize(newCount);
+
151 
+
152  memcpy(mappedPtr, srcPtr, newCount*sizeof(T));
+
153  }
+
154 
+
155  void copyto(T* dest, int count)
+
156  {
+
157  assert(mappedPtr);
+
158 
+
159  memcpy(dest, mappedPtr, sizeof(T)*count);
+
160  }
+
161 
+
162  int size() const { return count; }
+
163 
+
164  bool empty() const { return size() == 0; }
+
165 
+
166  const T& back() const
+
167  {
+
168  assert(mappedPtr);
+
169  assert(!empty());
+
170 
+
171  return mappedPtr[count-1];
+
172  }
+
173 
+
174  void reserve(int minCapacity)
+
175  {
+
176  if (minCapacity > capacity)
+
177  {
+
178  // growth factor of 1.5
+
179  const int newCapacity = minCapacity*3/2;
+
180 
+
181  NvFlexBuffer* newBuf = NvFlexAllocBuffer(lib, newCapacity, sizeof(T), type);
+
182 
+
183  // copy contents to new buffer
+
184  void* newPtr = NvFlexMap(newBuf, eNvFlexMapWait);
+
185  memcpy(newPtr, mappedPtr, count*sizeof(T));
+
186 
+
187  // unmap old buffer, but leave new buffer mapped
+
188  unmap();
+
189 
+
190  if (buffer)
+
191  NvFlexFreeBuffer(buffer);
+
192 
+
193  // swap
+
194  buffer = newBuf;
+
195  mappedPtr = (T*)newPtr;
+
196  capacity = newCapacity;
+
197  }
+
198  }
+
199 
+
200  // resizes mapped buffer and leaves new buffer mapped
+
201  void resize(int newCount)
+
202  {
+
203  assert(mappedPtr || !buffer);
+
204 
+
205  reserve(newCount);
+
206 
+
207  // resize but do not initialize new entries
+
208  count = newCount;
+
209  }
+
210 
+
211  void resize(int newCount, const T& val)
+
212  {
+
213  assert(mappedPtr || !buffer);
+
214 
+
215  const int startInit = count;
+
216  const int endInit = newCount;
+
217 
+
218  resize(newCount);
+
219 
+
220  // init any new entries
+
221  for (int i=startInit; i < endInit; ++i)
+
222  mappedPtr[i] = val;
+
223  }
+
224 };
+
225 
+
226 extern "C" {
+
227 
+ +
232 {
+
233  float position[3];
+
234  float rotation[4];
+
235 
+
236  float velocity[3];
+
237  float omega[3];
+
238 
+
239  float acceleration[3];
+
240  float tau[3];
+
241 
+
242  float delta[4][4];
+
243 };
+
244 
+
281 NV_FLEX_API void NvFlexExtMovingFrameInit(NvFlexExtMovingFrame* frame, const float* worldTranslation, const float* worldRotation);
+
282 
+
283 /* Update a frame to a new position, this will automatically update the velocity and acceleration of
+
284  * the frame, which can then be used to calculate inertial forces. This should be called once per-frame
+
285  * with the new position and time-step used when moving the frame.
+
286  *
+
287  * @param[in] frame A pointer to a user-allocated NvFlexExtMovingFrame struct
+
288  * @param[in] worldTranslation A pointer to a vec3 storing the frame's initial translation in world space
+
289  * @param[in] worldRotation A pointer to a quaternion storing the frame's initial rotation in world space
+
290  * @param[in] dt The time that elapsed since the last call to the frame update
+
291  */
+
292 NV_FLEX_API void NvFlexExtMovingFrameUpdate(NvFlexExtMovingFrame* frame, const float* worldTranslation, const float* worldRotation, float dt);
+
293 
+
294 /* Teleport particles to the frame's new position and apply the inertial forces
+
295  *
+
296  * @param[in] frame A pointer to a user-allocated NvFlexExtMovingFrame struct
+
297  * @param[in] positions A pointer to an array of particle positions in (x, y, z, 1/m) format
+
298  * @param[in] velocities A pointer to an array of particle velocities in (vx, vy, vz) format
+
299  * @param[in] numParticles The number of particles to update
+
300  * @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
+
301  * @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
+
302  * @param[in] dt The time that elapsed since the last call to the frame update, should match the value passed to NvFlexExtMovingFrameUpdate()
+
303  */
+
304 NV_FLEX_API void NvFlexExtMovingFrameApply(NvFlexExtMovingFrame* frame, float* positions, float* velocities, int numParticles, float linearScale, float angularScale, float dt);
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 };
+
306 
+ +
312 {
+
313  // particles
+
314  float* particles;
+ + +
317 
+
318  // springs
+ + + + +
323 
+
324  // shapes
+ + + + +
329  float* shapeCenters;
+
330  int numShapes;
+
331 
+
332  // plastic deformation
+ + +
335 
+
336  // faces for cloth
+ + +
339 
+
340  // inflatable params
+
341  bool inflatable;
+ + + +
345 };
+
346 
+ +
351 {
+ + +
354 
+ + + +
358 
+ +
360  float* shapeRotations;
361 
- + +
363 
+
364  void* userData;
+
365 };
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);
+ +
371 
+
383 NV_FLEX_API int NvFlexExtCreateWeldedMeshIndices(const float* vertices, int numVertices, int* uniqueVerts, int* originalToUniqueMap, float threshold);
+
384 
+
400 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);
+
401 
+
420 NV_FLEX_API NvFlexExtAsset* NvFlexExtCreateTearingClothFromMesh(const float* particles, int numParticles, int maxParticles, const int* indices, int numTriangles, float stretchStiffness, float bendStiffness, float pressure);
+
421 
+
426 NV_FLEX_API void NvFlexExtDestroyTearingCloth(NvFlexExtAsset* asset);
+
427 
+ +
434 {
+
435  int srcIndex;
+ +
437 };
+
438 
+ +
447 {
+
448  int triIndex; // index into the triangle indices array to update
+
449  int newParticleIndex; // new value for the index
+
450 };
+
451 
+
466 NV_FLEX_API void NvFlexExtTearClothMesh(NvFlexExtAsset* asset, float maxStrain, int maxSplits, NvFlexExtTearingParticleClone* particleCopies, int* numParticleCopies, int maxCopies, NvFlexExtTearingMeshEdit* triangleEdits, int* numTriangleEdits, int maxEdits);
+
467 
+
479 NV_FLEX_API NvFlexExtAsset* NvFlexExtCreateRigidFromMesh(const float* vertices, int numVertices, const int* indices, int numTriangleIndices, float radius, float expand);
+
480 
+
501 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 clusterPlasticThreshold, float clusterPlasticCreep);
+
502 
+
507 NV_FLEX_API void NvFlexExtDestroyAsset(NvFlexExtAsset* asset);
+
508 
+
521 NV_FLEX_API void NvFlexExtCreateSoftMeshSkinning(const float* vertices, int numVertices, const float* bones, int numBones, float falloff, float maxDistance, float* skinningWeights, int* skinningIndices);
+
522 
+
531 NV_FLEX_API NvFlexExtContainer* NvFlexExtCreateContainer(NvFlexLibrary* lib, NvFlexSolver* solver, int maxParticles);
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 
- +
538 NV_FLEX_API void NvFlexExtDestroyContainer(NvFlexExtContainer* container);
+
539 
+
547 NV_FLEX_API int NvFlexExtAllocParticles(NvFlexExtContainer* container, int n, int* indices);
+
548 
+
556 NV_FLEX_API void NvFlexExtFreeParticles(NvFlexExtContainer* container, int n, const int* indices);
+
557 
+
558 
+
566 NV_FLEX_API int NvFlexExtGetActiveList(NvFlexExtContainer* container, int* indices);
+
567 
+
568 
+ +
570 {
+
571  float* particles;
+
572  float* restParticles;
+
573  float* velocities;
+
574  int* phases;
+
575  float* normals;
+
576 
+
577  const float* lower;
+
578  const float* upper;
+
579 };
+
580 
+ +
588 NV_FLEX_API void NvFlexExtUnmapParticleData(NvFlexExtContainer* container);
+
589 
+ +
591 {
+
592  int* indices;
+
593  float* normals;
+
594 };
595 
-
599 NV_FLEX_API void NvFlexExtUnmapTriangleData(NvFlexExtContainer* container);
-
600 
- -
602 {
-
603  float* rotations;
-
604  float* positions;
-
605  int n;
-
606 };
+ +
602 
+
606 NV_FLEX_API void NvFlexExtUnmapTriangleData(NvFlexExtContainer* container);
607 
- + +
609 {
+
610  float* rotations;
+
611  float* positions;
+
612  int n;
+
613 };
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);
+ +
621 
+
625 NV_FLEX_API void NvFlexExtUnmapShapeData(NvFlexExtContainer* container);
+
626 
+
642 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);
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);
+
649 NV_FLEX_API void NvFlexExtDestroyInstance(NvFlexExtContainer* container, const NvFlexExtInstance* instance);
+
650 
+
657 NV_FLEX_API void NvFlexExtNotifyAssetChanged(NvFlexExtContainer* container, const NvFlexExtAsset* asset);
+
658 
+
688 NV_FLEX_API void NvFlexExtTickContainer(NvFlexExtContainer* container, float dt, int numSubsteps, bool enableTimers=false);
689 
-
695 NV_FLEX_API void NvFlexExtPullFromDevice(NvFlexExtContainer* container);
+
695 NV_FLEX_API void NvFlexExtPushToDevice(NvFlexExtContainer* container);
696 
-
702 NV_FLEX_API void NvFlexExtUpdateInstances(NvFlexExtContainer* container);
+
702 NV_FLEX_API void NvFlexExtPullFromDevice(NvFlexExtContainer* container);
703 
-
704 
- -
709 {
- -
712 
- -
715 
- -
718 };
+
709 NV_FLEX_API void NvFlexExtUpdateInstances(NvFlexExtContainer* container);
+
710 
+
711 
+ +
716 {
+
719 
- -
724 {
-
725  float mPosition[3];
-
726  float mRadius;
-
727  float mStrength;
- - -
730 };
-
731 
- -
737 
- -
746 
- + +
722 
+ +
725 };
+
726 
+ +
731 {
+
732  float mPosition[3];
+
733  float mRadius;
+
734  float mStrength;
+ + +
737 };
+
738 
+ +
744 
+
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
+ +
760 
+
768 NV_FLEX_API void NvFlexExtSetForceFields(NvFlexExtForceFieldCallback* callback, const NvFlexExtForceField* forceFields, int numForceFields);
+
769 
+
770 
+
771 
+
772 } // extern "C"
+
773 
+
774 #endif // NV_FLEX_EXT_H
+
775 
+
bool mLinearFalloff
Linear or no falloff.
Definition: NvFlexExt.h:736
+
void destroy()
Definition: NvFlexExt.h:86
+
NvFlexBufferType type
Definition: NvFlexExt.h:76
+
int numParticles
Number of particles.
Definition: NvFlexExt.h:315
+
float * shapeCenters
The position of the center of mass of each shape, an array of vec3s mNumShapes in length...
Definition: NvFlexExt.h:329
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
+
float * shapeRotations
Shape matching group rotations (quaternions)
Definition: NvFlexExt.h:360
+
NvFlexVector(NvFlexLibrary *l, const T *ptr, int size, NvFlexBufferType type=eNvFlexBufferHost)
Definition: NvFlexExt.h:58
+
int n
Number of valid tranforms.
Definition: NvFlexExt.h:612
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
+
float * particles
Local space particle positions, x,y,z,1/mass.
Definition: NvFlexExt.h:314
+
int * shapeOffsets
Each entry stores the end of the shape's indices in the indices array (exclusive prefix sum of shape ...
Definition: NvFlexExt.h:327
+
int newParticleIndex
Definition: NvFlexExt.h:449
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
+
void init(int size)
Definition: NvFlexExt.h:79
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
+
float * springRestLengths
Spring rest-lengths.
Definition: NvFlexExt.h:321
+
int size() const
Definition: NvFlexExt.h:162
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
+
Definition: NvFlexExt.h:569
+
int numParticles
Number of simulation particles.
Definition: NvFlexExt.h:353
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
+
struct NvFlexExtContainer NvFlexExtContainer
Definition: NvFlexExt.h:370
+
T & operator[](int index)
Definition: NvFlexExt.h:128
+
void * userData
User data pointer.
Definition: NvFlexExt.h:364
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
+
void resize(int newCount, const T &val)
Definition: NvFlexExt.h:211
+
int * triangleIndices
Indexed triangle mesh indices for clothing.
Definition: NvFlexExt.h:337
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
+
int * particleIndices
Simulation particle indices.
Definition: NvFlexExt.h:352
+
float mRadius
Radius of the force field.
Definition: NvFlexExt.h:733
+
int numTriangles
Number of triangles.
Definition: NvFlexExt.h:338
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
+
Definition: NvFlexExt.h:730
+
int numShapeIndices
Total number of indices for shape constraints.
Definition: NvFlexExt.h:326
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
+
float * rotations
Receives a pointer to the array quaternion rotation data in [x, y z, w] format.
Definition: NvFlexExt.h:610
NV_FLEX_API int NvFlexExtGetActiveList(NvFlexExtContainer *container, int *indices)
-
int shapeIndex
Index in the container's shape body constraints array.
Definition: NvFlexExt.h:351
+
int shapeIndex
Index in the container's shape body constraints array.
Definition: NvFlexExt.h:356
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(NvFlexLibrary *l, int size=0, NvFlexBufferType type=eNvFlexBufferHost)
Definition: NvFlexExt.h:47
+
int * springIndices
Spring indices.
Definition: NvFlexExt.h:319
+
void reserve(int minCapacity)
Definition: NvFlexExt.h:174
~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
+
int maxParticles
Maximum number of particles, allows extra space for tearable assets which duplicate particles...
Definition: NvFlexExt.h:316
+
void push_back(const T &t)
Definition: NvFlexExt.h:136
NV_FLEX_API void NvFlexExtDestroyContainer(NvFlexExtContainer *container)
-
float tau[3]
Definition: NvFlexExt.h:239
-
float omega[3]
Definition: NvFlexExt.h:236
+
float tau[3]
Definition: NvFlexExt.h:240
+
float omega[3]
Definition: NvFlexExt.h:237
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
+
bool empty() const
Definition: NvFlexExt.h:164
+
Definition: NvFlexExt.h:446
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
+
float rotation[4]
Definition: NvFlexExt.h:234
+
float inflatableVolume
The rest volume for the inflatable constraint.
Definition: NvFlexExt.h:342
+
A host mappable buffer, pinned memory on CUDA, staging buffer on DX.
Definition: NvFlex.h:78
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
+
Apply field value as an impulse.
Definition: NvFlexExt.h:721
+
float * particles
Receives a pointer to the particle position / mass data.
Definition: NvFlexExt.h:571
+
float * springCoefficients
Spring coefficients.
Definition: NvFlexExt.h:320
+
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 clusterPlasticThreshold, float clusterPlasticCreep)
+
float * restParticles
Receives a pointer to the particle's rest position (used for self collision culling) ...
Definition: NvFlexExt.h:572
+
float * positions
Receives a pointer to an array of shape body translations in [x, y, z] format.
Definition: NvFlexExt.h:611
+
Definition: NvFlexExt.h:231
+
const T & operator[](int index) const
Definition: NvFlexExt.h:120
+
void unmap()
Definition: NvFlexExt.h:109
+
Definition: NvFlexExt.h:350
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
+
float mPosition[3]
Center of force field.
Definition: NvFlexExt.h:732
+
int * indices
Receives a pointer to the array of triangle index data.
Definition: NvFlexExt.h:592
+
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:593
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
+
float acceleration[3]
Definition: NvFlexExt.h:239
+
Apply field value as a force.
Definition: NvFlexExt.h:718
+
float inflatableStiffness
How stiff the inflatable is.
Definition: NvFlexExt.h:344
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
+
int triIndex
Definition: NvFlexExt.h:448
+
float * normals
Receives a pointer to the particle normal data with 16 byte stride in format [nx, ny...
Definition: NvFlexExt.h:575
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
+
int destIndex
Definition: NvFlexExt.h:436
+
float mStrength
Strength of the force field.
Definition: NvFlexExt.h:734
+
float position[3]
Definition: NvFlexExt.h:233
+
void resize(int newCount)
Definition: NvFlexExt.h:201
+
Definition: NvFlexExt.h:311
NV_FLEX_API void NvFlexExtPushToDevice(NvFlexExtContainer *container)
-
struct NvFlexExtForceFieldCallback NvFlexExtForceFieldCallback
Definition: NvFlexExt.h:736
+
struct NvFlexExtForceFieldCallback NvFlexExtForceFieldCallback
Definition: NvFlexExt.h:743
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
+
NvFlexExtForceMode
Definition: NvFlexExt.h:715
+
float * shapeCoefficients
The stiffness coefficient for each shape.
Definition: NvFlexExt.h:328
+
void map(int flags=eNvFlexMapWait)
Definition: NvFlexExt.h:100
+
Apply field value as a velocity change.
Definition: NvFlexExt.h:724
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
+
Definition: NvFlexExt.h:608
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
+
float inflatablePressure
How much over the rest volume the inflatable should attempt to maintain.
Definition: NvFlexExt.h:343
+
const float * upper
Receive a pointer to the particle upper bounds [x, y, z].
Definition: NvFlexExt.h:578
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
+
int inflatableIndex
Index in the container's inflatables array.
Definition: NvFlexExt.h:357
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
+
int * shapeIndices
The indices of the shape matching constraints.
Definition: NvFlexExt.h:325
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
+
void assign(const T *srcPtr, int newCount)
Definition: NvFlexExt.h:146
+
float * shapePlasticThresholds
The plastic threshold coefficient for each shape.
Definition: NvFlexExt.h:333
+
const NvFlexExtAsset * asset
Source asset used to create this instance.
Definition: NvFlexExt.h:362
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
+
float delta[4][4]
Definition: NvFlexExt.h:242
+
const float * lower
Receive a pointer to the particle lower bounds [x, y, z].
Definition: NvFlexExt.h:577
+
int triangleIndex
Index in the container's triangle array.
Definition: NvFlexExt.h:355
+
Definition: NvFlexExt.h:590
+
NvFlexExtForceMode mMode
Mode of field application.
Definition: NvFlexExt.h:735
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
+
int * phases
Receives a pointer to the particle phase data.
Definition: NvFlexExt.h:574
NV_FLEX_API void NvFlexFreeBuffer(NvFlexBuffer *buf)
-
int numShapes
The number of shape matching constraints.
Definition: NvFlexExt.h:329
+
int numShapes
The number of shape matching constraints.
Definition: NvFlexExt.h:330
NV_FLEX_API void NvFlexExtUnmapTriangleData(NvFlexExtContainer *container)
-
void copyto(T *dest, int count)
Definition: NvFlexExt.h:154
+
void copyto(T *dest, int count)
Definition: NvFlexExt.h:155
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
+
float * shapePlasticCreeps
The plastic creep coefficient for each shape.
Definition: NvFlexExt.h:334
+
int srcIndex
Definition: NvFlexExt.h:435
+
float * shapeTranslations
Shape matching group translations (vec3s)
Definition: NvFlexExt.h:359
+
float velocity[3]
Definition: NvFlexExt.h:236
+
Definition: NvFlexExt.h:433
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
+
float * velocities
Receives a pointer to the particle velocity data.
Definition: NvFlexExt.h:573
+
const T & back() const
Definition: NvFlexExt.h:166
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
+
bool inflatable
Whether an inflatable constraint should be added.
Definition: NvFlexExt.h:341
+
int numSprings
Number of springs.
Definition: NvFlexExt.h:322
NV_FLEX_API void NvFlexExtNotifyAssetChanged(NvFlexExtContainer *container, const NvFlexExtAsset *asset)
+
NvFlexBufferType
Definition: NvFlex.h:76
diff --git a/doc/_static/api/dir_d44c64559bbebec7f509842c48db8b23.html b/doc/_static/api/dir_d44c64559bbebec7f509842c48db8b23.html index e2f9475..3f3697d 100644 --- a/doc/_static/api/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/doc/_static/api/dir_d44c64559bbebec7f509842c48db8b23.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -52,7 +52,7 @@ Files diff --git a/doc/_static/api/files.html b/doc/_static/api/files.html index 53ff079..7f6b61c 100644 --- a/doc/_static/api/files.html +++ b/doc/_static/api/files.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -45,7 +45,7 @@ diff --git a/doc/_static/api/globals.html b/doc/_static/api/globals.html index 42e1ec0..6039eb7 100644 --- a/doc/_static/api/globals.html +++ b/doc/_static/api/globals.html @@ -20,7 +20,7 @@ Logo
FLEX -  1.1.0 +  1.2.0
@@ -58,6 +58,15 @@
  • eNvFlexExtModeVelocityChange : NvFlexExt.h
  • +
  • eNvFlexFeatureModeDefault +: NvFlex.h +
  • +
  • eNvFlexFeatureModeSimpleFluids +: NvFlex.h +
  • +
  • eNvFlexFeatureModeSimpleSolids +: NvFlex.h +
  • eNvFlexLogAll : NvFlex.h
  • @@ -73,15 +82,15 @@
  • eNvFlexLogWarning : NvFlex.h
  • -
  • eNvFlexMapDiscard -: NvFlex.h -
  • eNvFlexMapDoNotWait : NvFlex.h
  • eNvFlexMapWait : NvFlex.h
  • +
  • eNvFlexPhaseFlagsMask +: NvFlex.h +
  • eNvFlexPhaseFluid : NvFlex.h
  • @@ -94,6 +103,36 @@
  • eNvFlexPhaseSelfCollideFilter : NvFlex.h
  • +
  • eNvFlexPhaseShapeChannel0 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel1 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel2 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel3 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel4 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel5 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel6 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel7 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannelMask +: NvFlex.h +
  • +
  • eNvFlexPhaseUnused +: NvFlex.h +
  • eNvFlexRelaxationGlobal : NvFlex.h
  • @@ -183,7 +222,7 @@ : NvFlex.h
  • NvFlexCreateSolver() -: NvFlex.h +: NvFlex.h
  • NvFlexCreateTriangleMesh() : NvFlex.h @@ -240,7 +279,7 @@ : NvFlexExt.h
  • NvFlexExtCreateSoftFromMesh() -: NvFlexExt.h +: NvFlexExt.h
  • NvFlexExtCreateSoftMeshSkinning() : NvFlexExt.h @@ -326,6 +365,9 @@
  • NvFlexExtUpdateInstances() : NvFlexExt.h
  • +
  • NvFlexFeatureMode +: NvFlex.h +
  • NvFlexFlush() : NvFlex.h
  • @@ -333,13 +375,13 @@ : NvFlex.h
  • NvFlexGetActive() -: NvFlex.h +: NvFlex.h
  • NvFlexGetActiveCount() : NvFlex.h
  • NvFlexGetAnisotropy() -: NvFlex.h +: NvFlex.h
  • NvFlexGetBounds() : NvFlex.h @@ -351,7 +393,7 @@ : NvFlex.h
  • NvFlexGetDensities() -: NvFlex.h +: NvFlex.h
  • NvFlexGetDetailTimers() : NvFlex.h @@ -360,37 +402,43 @@ : NvFlex.h
  • NvFlexGetDeviceLatency() -: NvFlex.h +: NvFlex.h
  • NvFlexGetDeviceName() : NvFlex.h
  • NvFlexGetDiffuseParticles() -: NvFlex.h +: NvFlex.h
  • NvFlexGetDynamicTriangles() : NvFlex.h
  • +
  • NvFlexGetNeighbors() +: NvFlex.h +
  • NvFlexGetNormals() -: NvFlex.h +: NvFlex.h
  • NvFlexGetParams() : NvFlex.h
  • NvFlexGetParticles() -: NvFlex.h +: NvFlex.h
  • NvFlexGetPhases() -: NvFlex.h +: NvFlex.h
  • NvFlexGetRestParticles() -: NvFlex.h +: NvFlex.h
  • -
  • NvFlexGetRigidTransforms() -: NvFlex.h +
  • NvFlexGetRigids() +: NvFlex.h
  • NvFlexGetSmoothParticles() -: NvFlex.h +: NvFlex.h +
  • +
  • NvFlexGetSolverDesc() +: NvFlex.h
  • NvFlexGetSolverLibrary() : NvFlex.h @@ -405,7 +453,7 @@ : NvFlex.h
  • NvFlexGetVelocities() -: NvFlex.h +: NvFlex.h
  • NvFlexGetVersion() : NvFlex.h @@ -417,11 +465,17 @@ : NvFlex.h
  • NvFlexMakePhase() -: NvFlex.h +: NvFlex.h +
  • +
  • NvFlexMakePhaseWithChannels() +: NvFlex.h
  • NvFlexMakeShapeFlags() : NvFlex.h
  • +
  • NvFlexMakeShapeFlagsWithChannels() +: NvFlex.h +
  • NvFlexMap() : NvFlex.h
  • @@ -447,7 +501,10 @@ : NvFlex.h
  • NvFlexSetActive() -: NvFlex.h +: NvFlex.h +
  • +
  • NvFlexSetActiveCount() +: NvFlex.h
  • NvFlexSetDiffuseParticles() : NvFlex.h @@ -459,31 +516,34 @@ : NvFlex.h
  • NvFlexSetNormals() -: NvFlex.h +: NvFlex.h
  • NvFlexSetParams() : NvFlex.h
  • NvFlexSetParticles() -: NvFlex.h +: NvFlex.h
  • NvFlexSetPhases() -: NvFlex.h +: NvFlex.h
  • NvFlexSetRestParticles() -: NvFlex.h +: NvFlex.h
  • NvFlexSetRigids() -: NvFlex.h +: NvFlex.h
  • NvFlexSetShapes() : NvFlex.h
  • +
  • NvFlexSetSolverDescDefaults() +: NvFlex.h +
  • NvFlexSetSprings() : NvFlex.h
  • NvFlexSetVelocities() -: NvFlex.h +: NvFlex.h
  • NvFlexShutdown() : NvFlex.h @@ -507,7 +567,7 @@ : NvFlex.h
  • NvFlexUpdateConvexMesh() -: NvFlex.h +: NvFlex.h
  • NvFlexUpdateDistanceField() : NvFlex.h @@ -518,11 +578,14 @@
  • NvFlexUpdateTriangleMesh() : NvFlex.h
  • +
  • NvFlexWait() +: NvFlex.h +
  • diff --git a/doc/_static/api/globals_enum.html b/doc/_static/api/globals_enum.html index c693fe9..99f3b98 100644 --- a/doc/_static/api/globals_enum.html +++ b/doc/_static/api/globals_enum.html @@ -20,7 +20,7 @@ Logo
    FLEX -  1.1.0 +  1.2.0
    @@ -50,6 +50,9 @@
  • NvFlexExtForceMode : NvFlexExt.h
  • +
  • NvFlexFeatureMode +: NvFlex.h +
  • NvFlexMapFlags : NvFlex.h
  • @@ -66,7 +69,7 @@ diff --git a/doc/_static/api/globals_eval.html b/doc/_static/api/globals_eval.html index 465a0cb..22e284d 100644 --- a/doc/_static/api/globals_eval.html +++ b/doc/_static/api/globals_eval.html @@ -20,7 +20,7 @@ Logo
    FLEX -  1.1.0 +  1.2.0
    @@ -58,6 +58,15 @@
  • eNvFlexExtModeVelocityChange : NvFlexExt.h
  • +
  • eNvFlexFeatureModeDefault +: NvFlex.h +
  • +
  • eNvFlexFeatureModeSimpleFluids +: NvFlex.h +
  • +
  • eNvFlexFeatureModeSimpleSolids +: NvFlex.h +
  • eNvFlexLogAll : NvFlex.h
  • @@ -73,15 +82,15 @@
  • eNvFlexLogWarning : NvFlex.h
  • -
  • eNvFlexMapDiscard -: NvFlex.h -
  • eNvFlexMapDoNotWait : NvFlex.h
  • eNvFlexMapWait : NvFlex.h
  • +
  • eNvFlexPhaseFlagsMask +: NvFlex.h +
  • eNvFlexPhaseFluid : NvFlex.h
  • @@ -94,6 +103,36 @@
  • eNvFlexPhaseSelfCollideFilter : NvFlex.h
  • +
  • eNvFlexPhaseShapeChannel0 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel1 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel2 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel3 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel4 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel5 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel6 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannel7 +: NvFlex.h +
  • +
  • eNvFlexPhaseShapeChannelMask +: NvFlex.h +
  • +
  • eNvFlexPhaseUnused +: NvFlex.h +
  • eNvFlexRelaxationGlobal : NvFlex.h
  • @@ -152,7 +191,7 @@ diff --git a/doc/_static/api/globals_func.html b/doc/_static/api/globals_func.html index 2766e2e..2ede00b 100644 --- a/doc/_static/api/globals_func.html +++ b/doc/_static/api/globals_func.html @@ -20,7 +20,7 @@ Logo
    FLEX -  1.1.0 +  1.2.0
    @@ -47,7 +47,7 @@ : NvFlex.h
  • NvFlexCreateSolver() -: NvFlex.h +: NvFlex.h
  • NvFlexCreateTriangleMesh() : NvFlex.h @@ -92,7 +92,7 @@ : NvFlexExt.h
  • NvFlexExtCreateSoftFromMesh() -: NvFlexExt.h +: NvFlexExt.h
  • NvFlexExtCreateSoftMeshSkinning() : NvFlexExt.h @@ -179,13 +179,13 @@ : NvFlex.h
  • NvFlexGetActive() -: NvFlex.h +: NvFlex.h
  • NvFlexGetActiveCount() : NvFlex.h
  • NvFlexGetAnisotropy() -: NvFlex.h +: NvFlex.h
  • NvFlexGetBounds() : NvFlex.h @@ -197,7 +197,7 @@ : NvFlex.h
  • NvFlexGetDensities() -: NvFlex.h +: NvFlex.h
  • NvFlexGetDetailTimers() : NvFlex.h @@ -206,37 +206,43 @@ : NvFlex.h
  • NvFlexGetDeviceLatency() -: NvFlex.h +: NvFlex.h
  • NvFlexGetDeviceName() : NvFlex.h
  • NvFlexGetDiffuseParticles() -: NvFlex.h +: NvFlex.h
  • NvFlexGetDynamicTriangles() : NvFlex.h
  • +
  • NvFlexGetNeighbors() +: NvFlex.h +
  • NvFlexGetNormals() -: NvFlex.h +: NvFlex.h
  • NvFlexGetParams() : NvFlex.h
  • NvFlexGetParticles() -: NvFlex.h +: NvFlex.h
  • NvFlexGetPhases() -: NvFlex.h +: NvFlex.h
  • NvFlexGetRestParticles() -: NvFlex.h +: NvFlex.h
  • -
  • NvFlexGetRigidTransforms() -: NvFlex.h +
  • NvFlexGetRigids() +: NvFlex.h
  • NvFlexGetSmoothParticles() -: NvFlex.h +: NvFlex.h +
  • +
  • NvFlexGetSolverDesc() +: NvFlex.h
  • NvFlexGetSolverLibrary() : NvFlex.h @@ -251,7 +257,7 @@ : NvFlex.h
  • NvFlexGetVelocities() -: NvFlex.h +: NvFlex.h
  • NvFlexGetVersion() : NvFlex.h @@ -260,11 +266,17 @@ : NvFlex.h
  • NvFlexMakePhase() -: NvFlex.h +: NvFlex.h +
  • +
  • NvFlexMakePhaseWithChannels() +: NvFlex.h
  • NvFlexMakeShapeFlags() : NvFlex.h
  • +
  • NvFlexMakeShapeFlagsWithChannels() +: NvFlex.h +
  • NvFlexMap() : NvFlex.h
  • @@ -281,7 +293,10 @@ : NvFlex.h
  • NvFlexSetActive() -: NvFlex.h +: NvFlex.h +
  • +
  • NvFlexSetActiveCount() +: NvFlex.h
  • NvFlexSetDiffuseParticles() : NvFlex.h @@ -293,31 +308,34 @@ : NvFlex.h
  • NvFlexSetNormals() -: NvFlex.h +: NvFlex.h
  • NvFlexSetParams() : NvFlex.h
  • NvFlexSetParticles() -: NvFlex.h +: NvFlex.h
  • NvFlexSetPhases() -: NvFlex.h +: NvFlex.h
  • NvFlexSetRestParticles() -: NvFlex.h +: NvFlex.h
  • NvFlexSetRigids() -: NvFlex.h +: NvFlex.h
  • NvFlexSetShapes() : NvFlex.h
  • +
  • NvFlexSetSolverDescDefaults() +: NvFlex.h +
  • NvFlexSetSprings() : NvFlex.h
  • NvFlexSetVelocities() -: NvFlex.h +: NvFlex.h
  • NvFlexShutdown() : NvFlex.h @@ -332,7 +350,7 @@ : NvFlex.h
  • NvFlexUpdateConvexMesh() -: NvFlex.h +: NvFlex.h
  • NvFlexUpdateDistanceField() : NvFlex.h @@ -343,11 +361,14 @@
  • NvFlexUpdateTriangleMesh() : NvFlex.h
  • +
  • NvFlexWait() +: NvFlex.h +
  • diff --git a/doc/_static/api/globals_type.html b/doc/_static/api/globals_type.html index 3ba1e90..1e6db85 100644 --- a/doc/_static/api/globals_type.html +++ b/doc/_static/api/globals_type.html @@ -20,7 +20,7 @@ Logo
    FLEX -  1.1.0 +  1.2.0
    @@ -63,7 +63,7 @@ diff --git a/doc/_static/api/index.html b/doc/_static/api/index.html index 3130b0d..4066cf8 100644 --- a/doc/_static/api/index.html +++ b/doc/_static/api/index.html @@ -20,7 +20,7 @@ Logo
    FLEX -  1.1.0 +  1.2.0
    @@ -43,7 +43,7 @@ diff --git a/doc/_static/api/struct_nv_flex_solver_callback.html b/doc/_static/api/struct_nv_flex_solver_callback.html index d96d2d2..041be39 100644 --- a/doc/_static/api/struct_nv_flex_solver_callback.html +++ b/doc/_static/api/struct_nv_flex_solver_callback.html @@ -20,7 +20,7 @@ Logo
    FLEX -  1.1.0 +  1.2.0
    @@ -77,7 +77,7 @@ Data Fields diff --git a/doc/_static/api/struct_nv_flex_vector.html b/doc/_static/api/struct_nv_flex_vector.html index fa3a3d8..135150d 100644 --- a/doc/_static/api/struct_nv_flex_vector.html +++ b/doc/_static/api/struct_nv_flex_vector.html @@ -20,7 +20,7 @@ Logo
    FLEX -  1.1.0 +  1.2.0
    @@ -41,10 +41,10 @@ - - - - + + + + @@ -90,9 +90,11 @@ Data Fields + +

    Public Member Functions

     NvFlexVector (NvFlexLibrary *l, int size=0)
     
     NvFlexVector (NvFlexLibrary *l, const T *ptr, int size)
     
     NvFlexVector (NvFlexLibrary *l, int size=0, NvFlexBufferType type=eNvFlexBufferHost)
     
     NvFlexVector (NvFlexLibrary *l, const T *ptr, int size, NvFlexBufferType type=eNvFlexBufferHost)
     
     ~NvFlexVector ()
     
    void init (int size)
     
    int capacity
     
    NvFlexBufferType type
     

    Constructor & Destructor Documentation

    - +
    @@ -111,7 +113,13 @@ template<typename T >
    int  - size = 0  + size = 0, + + + + + NvFlexBufferType  + type = eNvFlexBufferHost  @@ -128,7 +136,7 @@ template<typename T >
    - +
    @@ -153,7 +161,13 @@ template<typename T >
    int  - size  + size, + + + + + NvFlexBufferType  + type = eNvFlexBufferHost  @@ -680,12 +694,26 @@ template<typename T >
    +
    + + +
    +
    +
    +template<typename T >
    + + + + +
    NvFlexBufferType NvFlexVector< T >::type
    +
    +
    -- cgit v1.2.3