2012-06-12 09:37:46 -05:00
|
|
|
#include "simulation/Tools.h"
|
|
|
|
#include "simulation/Air.h"
|
|
|
|
//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 2
|
|
|
|
Tool_Vac::Tool_Vac()
|
|
|
|
{
|
|
|
|
Identifier = "DEFAULT_TOOL_VAC";
|
|
|
|
Name = "VAC";
|
2012-08-03 12:04:18 -05:00
|
|
|
Colour = PIXPACK(0x303030);
|
2012-06-12 09:37:46 -05:00
|
|
|
Description = "Removes air pressure";
|
|
|
|
}
|
|
|
|
|
|
|
|
int Tool_Vac::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
|
|
|
|
{
|
|
|
|
sim->air->pv[y/CELL][x/CELL] -= 0.03f*strength;
|
2012-08-14 10:29:07 -05:00
|
|
|
if(sim->air->pv[y/CELL][x/CELL] > 256.0f)
|
|
|
|
sim->air->pv[y/CELL][x/CELL] = 256.0f;
|
|
|
|
if(sim->air->pv[y/CELL][x/CELL] < -256.0f)
|
|
|
|
sim->air->pv[y/CELL][x/CELL] = -256.0f;
|
2012-06-12 09:37:46 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
Tool_Vac::~Tool_Vac() {}
|