4 #include "particleCuda.cuh"
5 #include "RenderStates.h"
8 extern "C" void SetParticle(Particle *hostparticle_parameter);
9 extern "C" void CalcBBGrid(uint* cellStart, uint* cellEnd, float4* sortedPos,float4* sortedVel, float3* sortedForce, uint* indices, uint* hash, float4* pos, float4* vel, float3* force, uint count, uint numCells);
12 extern "C" void InitParticlesCuda(uint* block, cudaExtent res,
float isosurface);
13 extern "C" void SortStartPositionsAfterIndicesCuda(uint* block, uint* indices,
unsigned int count);
14 extern "C" void GenerateQRSequenceCuda(uint* block,
unsigned int count);
16 extern "C" void initTransferFunctionTexture(cudaArray* tfArray);
17 extern "C" void initVolumenTexture(cudaArray* volArray, cudaExtent volumeSize);
18 extern "C" void initPCDTexture(cudaArray* volArray, cudaExtent volumeSize);
19 extern "C" void BindVolumeCuda(cudaArray* volume_array);
20 extern "C" void UnbindVolumeCuda();
21 extern "C" void BindPCDCuda(cudaArray* volume_array);
22 extern "C" void UnbindPCDCuda();
23 extern "C" void BindTransferfunctionCuda(cudaArray* volume_array);
24 extern "C" void UnbindTransferfunctionCuda();
27 extern "C" void ParticlesGradientCuda(float4* pos, float4* vel, float4* newvel,
unsigned int count);
28 extern "C" void ParticlesPCDCuda(float4* pos, float4* vel, float4* newvel,
unsigned int count);
29 extern "C" void ParticlesPCD2Cuda(float4* pos, float4* vel, float4* newvel,
unsigned int count);
30 extern "C" void ParticlesFlockingCuda(float4* pos, float4* vel, uint* cellStart, uint* cellEnd, float4* newvel,
unsigned int count);
31 extern "C" void ParticlesPredefinedDirectionCuda(float4* vel, float4* newvel,
unsigned int count);
32 extern "C" void ParticlesDensityCuda(float4* pos, uint* cellStart, uint* cellEnd, float4* newpos,
unsigned int count);
34 extern "C" void IntegrateParticlesCuda(float4* pos, float4* newpos, float4* vel,
unsigned int* start,
unsigned int count);
35 extern "C" void SortParticlesCuda(
float *sortKeys,
unsigned int *indices,
unsigned int numParticles);
36 extern "C" void CalcParticlesDepthCuda( float4* pos,
float* keys,
unsigned int* indices,
int numParticles);
38 extern "C" void CaclulatePositionsAndVelocities(uint* indices, float4* pos, float4* vel, cudaExtent res,
unsigned int count);
41 extern "C" void CalcVolumeBlockCuda(float4* block, cudaExtent res, cudaExtent blocks_size, cudaExtent blocks_num);
44 extern "C" void render_kernel(dim3 gridSize, dim3 blockSize, uint *d_output, uint imageW, uint imageH,
float density,
float brightness,
float transferOffset,
float transferScale);
45 extern "C" void copyInvViewMatrix(
float *invViewMatrix,
size_t sizeofMatrix);
47 extern "C" void IntegrateParticlesNavierStrokesCuda(float3* force, float3* actforce, float4* pos, float4* newpos, float4* vel, float4* newvel,
float* pressure, float3* viscosity,
unsigned int* startpos,
unsigned int count);
48 extern "C" void CalcualteForcePressureAndViscosityCuda(
float* pressure, float3* viscosity, float4* oldPos, float4* oldVel,
float* oldPressure, uint* cellStart, uint* cellEnd, uint numParticles, cudaExtent res);
49 extern "C" void EvaluateDensityAndPressureCuda(float4* pos,
float* pressure, float4* oldPos, uint* cellStart, uint* cellEnd, uint numParticles, cudaExtent res);
50 extern "C" void CollisionDetectionCellsCuda( float3* newVel, float4* oldPos, float4* oldVel, uint* cellStart, uint* cellEnd, uint numParticles, cudaExtent res);
52 extern "C" void CollisionDetectionVolumeCuda(float3* force, float4* pos, float4* vel, uint numParticles);
54 extern "C" void initHGTexture(cudaArray* hg_Array);
55 extern "C" void initHGDevTexture(cudaArray* hg_dev_Array);
56 extern "C" void BindHGCuda(cudaArray* hg_array);
57 extern "C" void BindHGDevCuda(cudaArray* hg_dev_array);
58 extern "C" void UnbindHGCuda();
59 extern "C" void UnbindHGDevCuda();
60 extern "C" void ResetVelocityOfErrorParticlesCuda(float4* new_vel, float4* oldVel, float4* oldPos, uint numParticles);
82 glm::vec3
runEmitter(glm::vec3 pos, glm::vec3 vel);
91 void InitCube(glm::vec3 origin, glm::vec3 size, glm::vec3 vel,
float lifetime);
95 void Update(
float duration);
103 void InitSphere(glm::vec3 origin, glm::vec3 vel,
float size,
float lifetime);
126 Particle* m_particle_parameter;
134 void SetData(
float* pos,
float* vel,
int numParticles);
141 unsigned int m_numParticles;
158 unsigned int m_emitterIndex;