MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / step

Method step

cpp/5_Domain_Specific/smokeParticles/ParticleSystem.cpp:105–130  ·  view source on GitHub ↗

step the simulation

Source from the content-addressed store, hash-verified

103
104// step the simulation
105void ParticleSystem::step(float deltaTime)
106{
107 assert(m_bInitialized);
108
109 m_params.time = m_time;
110 setParameters(&m_params);
111
112 m_pos.map();
113 m_vel.map();
114
115 // integrate particles
116 integrateSystem(m_pos.getDevicePtr(),
117 m_pos.getDeviceWritePtr(),
118 m_vel.getDevicePtr(),
119 m_vel.getDeviceWritePtr(),
120 deltaTime,
121 m_numParticles);
122
123 m_pos.unmap();
124 m_vel.unmap();
125
126 m_pos.swap();
127 m_vel.swap();
128
129 m_time += deltaTime;
130}
131
132// depth sort the particles
133void ParticleSystem::depthSort()

Callers 3

displayFunction · 0.80
keyFunction · 0.80
mainFunction · 0.80

Calls 5

mapMethod · 0.80
getDevicePtrMethod · 0.80
getDeviceWritePtrMethod · 0.80
unmapMethod · 0.80
swapMethod · 0.45

Tested by

no test coverage detected