diff options
| author | Miles Macklin <[email protected]> | 2018-03-19 15:10:24 +1300 |
|---|---|---|
| committer | Miles Macklin <[email protected]> | 2018-03-19 15:10:24 +1300 |
| commit | 8ee05c79ae1748ef132a12e4fb0af284899faec6 (patch) | |
| tree | 82bd5aa1892e28ce7886b6cfeafe66a47ff38e67 /doc/_sources | |
| parent | Flex 1.2 (beta 2) (diff) | |
| download | flex-8ee05c79ae1748ef132a12e4fb0af284899faec6.tar.xz flex-8ee05c79ae1748ef132a12e4fb0af284899faec6.zip | |
Flex 1.2.0 release
Diffstat (limited to 'doc/_sources')
| -rw-r--r-- | doc/_sources/index.txt | 2 | ||||
| -rw-r--r-- | doc/_sources/manual.txt | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/doc/_sources/index.txt b/doc/_sources/index.txt index 35f0ae0..68f2346 100644 --- a/doc/_sources/index.txt +++ b/doc/_sources/index.txt @@ -31,7 +31,7 @@ Supported Platforms ------------------- * Windows 32/64 bit -* Linux 64 bit (tested with Ubuntu 14.04 LTS) +* Linux 64 bit (tested with Ubuntu 16.04 LTS) Requirements ------------ diff --git a/doc/_sources/manual.txt b/doc/_sources/manual.txt index d4d916b..e68efaf 100644 --- a/doc/_sources/manual.txt +++ b/doc/_sources/manual.txt @@ -51,6 +51,8 @@ The example code below shows how to initialize the library, create a new solver NvFlexBuffer* particleBuffer = NvFlexAllocBuffer(library, n, sizeof(float4), eNvFlexBufferHost); NvFlexBuffer* velocityBuffer = NvFlexAllocBuffer(library, n, sizeof(float4), eNvFlexBufferHost); NvFlexBuffer* phaseBuffer = NvFlexAllocBuffer(library, n, sizeof(int), eNvFlexBufferHost); + + int numParticles = 0; while(!done) { @@ -60,10 +62,10 @@ The example code below shows how to initialize the library, create a new solver int* phases = (int*)NvFlexMap(phaseBuffer, eNvFlexMapWait); // spawn (user method) - SpawnParticles(particles, velocities, phases); + numParticles = SpawnParticles(particles, velocities, phases, numParticles); // render (user method) - RenderParticles(particles, velocities, phases); + RenderParticles(particles, velocities, phases, numParticles); // unmap buffers NvFlexUnmap(particleBuffer); @@ -74,6 +76,9 @@ The example code below shows how to initialize the library, create a new solver NvFlexSetParticles(solver, particleBuffer, NULL); NvFlexSetVelocities(solver, velocityBuffer, NULL); NvFlexSetPhases(solver, phaseBuffer, NULL); + + // set active count + NvFlexSetActiveCount(solver, numParticles); // tick NvFlexUpdateSolver(solver, dt, 1, false); @@ -181,7 +186,7 @@ The API comes with a helper function, **NvFlexMakePhase()**, that generates phas Active Set ********** -Each solver has a fixed maximum number of particles specified at creation time (see **NvFlexCreateSolver()**), but not all particles need to be active at one time. Before a particle will be simulated, it must be added to the *active set*. This is an array of unique particle indices that the solver will simulate. Inactive particles have very low computational overhead, so this mechanism can be used to implement more general particle allocation strategies on top of the solver. +Each solver has a fixed maximum number of particles specified at creation time (see **NvFlexCreateSolver()**), but not all particles need to be active at one time. Before a particle will be simulated, it must be added to the *active set*. This is an array of unique particle indices that the solver will simulate. Inactive particles have very low computational overhead, so this mechanism can be used to implement more general particle allocation strategies on top of the solver. By default the active indices array is initialized with successive numbers from 0 to maxParticles-1, so by just setting the active count value to N user can make the firts N particles active. The example code below shows how to create an active set which enables simulation on the first 10 particles in the solver:: |