From 8ee05c79ae1748ef132a12e4fb0af284899faec6 Mon Sep 17 00:00:00 2001 From: Miles Macklin Date: Mon, 19 Mar 2018 15:10:24 +1300 Subject: Flex 1.2.0 release --- doc/_static/api/_nv_flex_8h.html | 242 ++++++++++++++++++++++++++++++++++----- 1 file changed, 214 insertions(+), 28 deletions(-) (limited to 'doc/_static/api/_nv_flex_8h.html') diff --git a/doc/_static/api/_nv_flex_8h.html b/doc/_static/api/_nv_flex_8h.html index ca04c36..5ea2d6d 100644 --- a/doc/_static/api/_nv_flex_8h.html +++ b/doc/_static/api/_nv_flex_8h.html @@ -125,7 +125,7 @@ Enumerations
  eNvFlexPhaseFlagsMask = 0x00f00000,
-  eNvFlexPhaseShapeChannelMask = 0xff000000, +  eNvFlexPhaseShapeChannelMask = 0x7f000000,
  eNvFlexPhaseSelfCollide = 1 << 20,
@@ -147,9 +147,7 @@ Enumerations
  eNvFlexPhaseShapeChannel5 = 1 << 29,
-  eNvFlexPhaseShapeChannel6 = 1 << 30, -
-  eNvFlexPhaseShapeChannel7 = 1 << 31 +  eNvFlexPhaseShapeChannel6 = 1 << 30
}   @@ -244,6 +242,8 @@ Functions   NV_FLEX_API void NvFlexDestroySolver (NvFlexSolver *solver)   +NV_FLEX_API int NvFlexGetSolvers (NvFlexLibrary *lib, NvFlexSolver **solvers, int n) +  NV_FLEX_API NvFlexLibraryNvFlexGetSolverLibrary (NvFlexSolver *solver)   NV_FLEX_API void NvFlexGetSolverDesc (NvFlexSolver *solver, NvFlexSolverDesc *desc) @@ -298,6 +298,8 @@ Functions   NV_FLEX_API void NvFlexDestroyTriangleMesh (NvFlexLibrary *lib, NvFlexTriangleMeshId mesh)   +NV_FLEX_API int NvFlexGetTriangleMeshes (NvFlexLibrary *lib, NvFlexTriangleMeshId *meshes, int n) +  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 NvFlexGetTriangleMeshBounds (NvFlexLibrary *lib, const NvFlexTriangleMeshId mesh, float *lower, float *upper) @@ -306,12 +308,16 @@ Functions   NV_FLEX_API void NvFlexDestroyDistanceField (NvFlexLibrary *lib, NvFlexDistanceFieldId sdf)   +NV_FLEX_API int NvFlexGetDistanceFields (NvFlexLibrary *lib, NvFlexDistanceFieldId *sdfs, int n) +  NV_FLEX_API void NvFlexUpdateDistanceField (NvFlexLibrary *lib, NvFlexDistanceFieldId sdf, int dimx, int dimy, int dimz, NvFlexBuffer *field)   NV_FLEX_API NvFlexConvexMeshId NvFlexCreateConvexMesh (NvFlexLibrary *lib)   NV_FLEX_API void NvFlexDestroyConvexMesh (NvFlexLibrary *lib, NvFlexConvexMeshId convex)   +NV_FLEX_API int NvFlexGetConvexMeshes (NvFlexLibrary *lib, NvFlexConvexMeshId *meshes, int n) +  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) @@ -338,8 +344,8 @@ Functions   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 NvFlexGetNeighbors (NvFlexSolver *solver, NvFlexBuffer *neighbors, NvFlexBuffer *counts, NvFlexBuffer *apiToInternal, NvFlexBuffer *internalToApi) +  NV_FLEX_API void NvFlexGetBounds (NvFlexSolver *solver, NvFlexBuffer *lower, NvFlexBuffer *upper)   NV_FLEX_API float NvFlexGetDeviceLatency (NvFlexSolver *solver, unsigned long long *begin, unsigned long long *end, unsigned long long *frequency) @@ -926,11 +932,11 @@ 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 +bool -useComputeQueue +runOnRenderContext -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. +If true, run Flex on D3D11 render context, or D3D12 direct queue. If false, run on a D3D12 compute queue, or vendor specific D3D11 compute queue, allowing compute and graphics to run in parallel on some GPUs. NvFlexComputeType @@ -977,6 +983,12 @@ Maximum number of diffuse particles in the solver. 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. + +int + +maxContactsPerParticle + +Maximum number of collision contacts per-particle. @@ -1425,7 +1437,7 @@ time

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()

+

Bits [24, 30] hold flags representing what shape collision channels particles will collide with, see NvFlexMakeShapeFlags() (highest bit reserved for now)

eNvFlexPhaseSelfCollide 

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

@@ -1460,9 +1472,6 @@ time eNvFlexPhaseShapeChannel6 

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

-eNvFlexPhaseShapeChannel7  -

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

- @@ -1878,6 +1887,48 @@ time + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NV_FLEX_API int NvFlexGetSolvers (NvFlexLibrarylib,
NvFlexSolver ** solvers,
int n 
)
+
+

Get the list of active solvers in the library If the size of the array is smaller than the number of active solvers, only the first n entries are copied.

+
Parameters
+ + + + +
[in]libThe library instance to use
[in]solversPointer to array
[in]nSize of array
+
+
+
Returns
The number of active solvers in the library
+
@@ -2215,7 +2266,7 @@ time
Parameters
- +
[in]solverA valid solver
[out]indicesa buffer of indices at least activeCount in length
[out]indicesa buffer of indices at least activeCount in length. Default values are successive numbers from 0 to maxParticles-1
[in]descDescribes the copy region, if NULL the solver will try to access the entire buffer (maxParticles length)
@@ -3094,6 +3145,48 @@ time
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NV_FLEX_API int NvFlexGetTriangleMeshes (NvFlexLibrarylib,
NvFlexTriangleMeshIdmeshes,
int n 
)
+
+

Get the list of triangle meshes in the library If the size of the array is smaller than the number of triangle meshes, only the first n entries are copied.

+
Parameters
+ + + + +
[in]libThe library instance to use
[in]meshesPointer to array
[in]nSize of array
+
+
+
Returns
The number of triangle meshes in the library
+
@@ -3160,7 +3253,7 @@ time - + @@ -3276,6 +3369,48 @@ time + + + +
+
+
[in]libThe library instance to use
[in]meshA triangle mesh created with NvFlexCreateTriangleMesh()
[in]verticesPointer to a buffer of float3 vertex positions
[in]verticesPointer to a buffer of float4 vertex positions
[in]indicesPointer to a buffer of triangle indices, should be length numTriangles*3
[in]numVerticesThe number of vertices in the vertices array
[in]numTrianglesThe number of triangles in the mesh
+ + + + + + + + + + + + + + + + + + + + + + + +
NV_FLEX_API int NvFlexGetDistanceFields (NvFlexLibrarylib,
NvFlexDistanceFieldIdsdfs,
int n 
)
+
+

Get the list of signed distance fields in the library If the size of the array is smaller than the number of signed distance fields, only the first n entries are copied.

+
Parameters
+ + + + +
[in]libThe library instance to use
[in]sdfsPointer to array
[in]nSize of array
+
+
+
Returns
The number of signed distance fields in the library
+
@@ -3396,6 +3531,48 @@ time + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NV_FLEX_API int NvFlexGetConvexMeshes (NvFlexLibrarylib,
NvFlexConvexMeshIdmeshes,
int n 
)
+
+

Get the list of convex meshes in the library If the size of the array is smaller than the number of convex meshes, only the first n entries are copied.

+
Parameters
+ + + + +
[in]libThe library instance to use
[in]meshesPointer to array
[in]nSize of array
+
+
+
Returns
The number of convex meshes in the library
+
@@ -4071,17 +4248,17 @@ 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 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
[out]planesPointer to a destination buffer containing the contact planes for the particle, each particle can have up to maxContactsPerParticle contact planes (see NvFlexSolverDesc) so this buffer should be 4*maxContactsPerParticle*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 maxContactsPerParticle contact planes so this buffer should be 4*maxContactsPerParticle*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*maxContactsPerParticle] 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 <= maxContactsPerParticle), this buffer should be maxParticles in length
- +
@@ -4107,7 +4284,13 @@ time - + + + + + + + @@ -4117,11 +4300,12 @@ time
NvFlexBufferremap apiToInternal,
NvFlexBufferinternalToApi 

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);
+
NvFlexGetNeighbors(solver, neighborsBuffer, countsBuffer, apiToInternalBuffer, internalToApiBuffer);
int* neighbors = (int*)NvFlexMap(neighborsBuffer, 0);
int* counts = (int*)NvFlexMap(countsBuffer, 0);
-
int* remap = (int*)NvFlexMap(remapBuffer, 0);
+
int* apiToInternal = (int*)NvFlexMap(apiToInternalBuffer, 0);
+
int* internalToApi = (int*)NvFlexMap(internalToApiBuffer, 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
@@ -4131,12 +4315,12 @@ time
for (int i=0; i < maxParticles; ++i)
{
// find offset in the neighbors buffer
-
int offset = remap[i];
+
int offset = apiToInternal[i];
int count = counts[offset];
for (int c=0; c < count; ++c)
{
-
int neighbor = remap[neighbors[c*stride + offset]];
+
int neighbor = internalToApi[neighbors[c*stride + offset]];
printf("Particle %d's neighbor %d is particle %d\n", i, c, neighbor);
}
@@ -4144,13 +4328,15 @@ time
NvFlexUnmap(neighborsBuffer);
NvFlexUnmap(countsBuffer);
-
NvFlexUnmap(remapBuffer);
+
NvFlexUnmap(apiToInternalBuffer);
+
NvFlexUnmap(internalToApiBuffer);
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
[out]apiToInternalPointer 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
[out]internalToApiPointer to a buffer of indices, because Flex internally re-orders particles these are used to map from an internal index to an API index
@@ -4754,7 +4940,7 @@ time
-- cgit v1.2.3