NvFlowGrid


Data Structures

struct  NvFlowGridDesc
 Description required to create a grid. More...
struct  NvFlowGridParams
 Parameters controlling grid behavior. More...
struct  NvFlowGridResetDesc
 Description required to reset a NvFlowGrid. More...
struct  NvFlowQueryTime
 CPU/GPU timing info. More...
struct  NvFlowSupport
 Description of feature support on the queried Flow context GPU. More...

Enumerations

enum  NvFlowGridDebugVisFlags {
  eNvFlowGridDebugVisDisabled = 0x00, eNvFlowGridDebugVisBlocks = 0x01, eNvFlowGridDebugVisEmitBounds = 0x02, eNvFlowGridDebugVisShapesSimple = 0x04,
  eNvFlowGridDebugVisCount
}
 Flags to control grid debug visualization. More...
enum  NvFlowGridTextureChannel { eNvFlowGridTextureChannelVelocity = 0, eNvFlowGridTextureChannelDensity = 1, eNvFlowGridTextureChannelDensityCoarse = 2, eNvFlowGridTextureChannelCount }
 Grid texture channel, four components per channel. More...
enum  NvFlowMultiRes { eNvFlowMultiRes1x1x1 = 0, eNvFlowMultiRes2x2x2 = 1 }
 Enumeration used to describe density texture channel resolution relative to velocity resolution. More...

Functions

NvFlowGrid * NvFlowCreateGrid (NvFlowContext *context, const NvFlowGridDesc *desc)
void NvFlowGridDescDefaults (NvFlowGridDesc *desc)
NvFlowGridExport * NvFlowGridGetGridExport (NvFlowContext *context, NvFlowGrid *grid)
void NvFlowGridGPUMemUsage (NvFlowGrid *grid, NvFlowUint64 *numBytes)
void NvFlowGridParamsDefaults (NvFlowGridParams *params)
NvFlowResult NvFlowGridQuerySupport (NvFlowGrid *grid, NvFlowContext *context, NvFlowSupport *support)
NvFlowResult NvFlowGridQueryTime (NvFlowGrid *grid, NvFlowQueryTime *gpuTime, NvFlowQueryTime *cpuTime)
void NvFlowGridReset (NvFlowGrid *grid, const NvFlowGridResetDesc *desc)
void NvFlowGridResetDescDefaults (NvFlowGridResetDesc *desc)
void NvFlowGridSetParams (NvFlowGrid *grid, const NvFlowGridParams *params)
void NvFlowGridSetTargetLocation (NvFlowGrid *grid, NvFlowFloat3 targetLocation)
void NvFlowGridUpdate (NvFlowGrid *grid, NvFlowContext *context, float dt)
void NvFlowReleaseGrid (NvFlowGrid *grid)

Enumeration Type Documentation

Flags to control grid debug visualization.

Enumerator:
eNvFlowGridDebugVisDisabled  No debug visualization.
eNvFlowGridDebugVisBlocks  Simulation block visualization, no overhead.
eNvFlowGridDebugVisEmitBounds  Emitter bounds visualization, adds overhead.
eNvFlowGridDebugVisShapesSimple  Visualize sphere/capsule/box shapes, adds overhead.
eNvFlowGridDebugVisCount 

Grid texture channel, four components per channel.

Enumerator:
eNvFlowGridTextureChannelVelocity 
eNvFlowGridTextureChannelDensity 
eNvFlowGridTextureChannelDensityCoarse 
eNvFlowGridTextureChannelCount 

Enumeration used to describe density texture channel resolution relative to velocity resolution.

Enumerator:
eNvFlowMultiRes1x1x1 
eNvFlowMultiRes2x2x2 


Function Documentation

NvFlowGrid* NvFlowCreateGrid ( NvFlowContext *  context,
const NvFlowGridDesc desc 
)

Creates a grid.

Parameters:
[in] context The context to use to create the new grid.
[in] desc The grid description.
Returns:
The created grid.

void NvFlowGridDescDefaults ( NvFlowGridDesc desc  ) 

Allows the application to request a default grid description from Flow.

Parameters:
[out] desc The description for Flow to fill out.

NvFlowGridExport* NvFlowGridGetGridExport ( NvFlowContext *  context,
NvFlowGrid *  grid 
)

Get read interface to the grid simulation results

Parameters:
[in] context The context the grid was created with.
[in] grid The grid to read.
Returns:
Returns gridExport interface.

void NvFlowGridGPUMemUsage ( NvFlowGrid *  grid,
NvFlowUint64 numBytes 
)

Queries simulation GPU memory usage.

Parameters:
[in] grid The grid to query for memory usage.
[out] numBytes GPU memory allocated in bytes.

void NvFlowGridParamsDefaults ( NvFlowGridParams params  ) 

Allows the application to request default grid parameters from Flow.

Parameters:
[out] params The parameters for Flow to fill out.

NvFlowResult NvFlowGridQuerySupport ( NvFlowGrid *  grid,
NvFlowContext *  context,
NvFlowSupport support 
)

Queries support for features that depend on hardware/OS.

Parameters:
[in] grid The grid to query for support.
[in] context The context the grid was created against.
[out] support Description of what is supported.
Returns:
Returns eNvFlowSuccess if information is available.

NvFlowResult NvFlowGridQueryTime ( NvFlowGrid *  grid,
NvFlowQueryTime gpuTime,
NvFlowQueryTime cpuTime 
)

Queries simulation timing data.

Parameters:
[in] grid The grid to query for timing.
[out] gpuTime Simulation overhead on GPU.
[out] cpuTime Simulation overhead on CPU.
Returns:
Returns eNvFlowSuccess if information is available.

void NvFlowGridReset ( NvFlowGrid *  grid,
const NvFlowGridResetDesc desc 
)

Submits a request to reset a grid, preserving memory allocations

Parameters:
[in] grid The grid to reset.
[in] desc The grid reset description.

void NvFlowGridResetDescDefaults ( NvFlowGridResetDesc desc  ) 

Allows the application to request a default grid reset description from Flow.

Parameters:
[out] desc The description for Flow to fill out.

void NvFlowGridSetParams ( NvFlowGrid *  grid,
const NvFlowGridParams params 
)

Sets grid simulation parameters, persistent over multiple grid updates.

Parameters:
[in] grid The grid to set parameters on.
[in] params The new parameter values.

void NvFlowGridSetTargetLocation ( NvFlowGrid *  grid,
NvFlowFloat3  targetLocation 
)

Not fully supported yet. Allows the application to request the grid move to a new location.

Parameters:
[in] grid The grid to move.
[in] targetLocation The location the center of the grid should make a best effort attempt to reach.

void NvFlowGridUpdate ( NvFlowGrid *  grid,
NvFlowContext *  context,
float  dt 
)

Steps the simulation dt forward in time.

Parameters:
[in] grid The grid to update.
[in] context The context to perform the update.
[in] dt The time step, typically in seconds.

void NvFlowReleaseGrid ( NvFlowGrid *  grid  ) 

Releases a grid.

Parameters:
[in] grid The grid to be released.