// Update renderer and check for Qt events
void Update()
{
	glClearColor(0.0, 0.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	camera.Update();

	fluid.Update();

	CopyToFile();

//	glEnable(GL_DEPTH_TEST);
//	GLuint shaderProgramID = shaderManager.UseShader(SmokeShader);
//	raycaster.Raycast(shaderProgramID, camera, fluid.hostDensities, fluid.hostTemperatures);
//
//	glutSwapBuffers();

}
Beispiel #2
0
int main()
{
    Fluid simulation;
    remove( "position_data.txt" );

    //InitializeParticles();
    simulation.InitializeParticles();

    for (int i = currentTime; i <= endTime; i = i+deltaT) {
        simulation.FindNeighbours();
        simulation.ComputeDensity();
        simulation.ComputePressure();
        simulation.ComputeAllForces(i);
        simulation.Update();
        simulation.HandleCollisions();
        cout << "timestep: " << i << endl;
        simulation.Output(i);
    }

    cout << "End" << endl;
    return 0;
}