#include "acceleratedparticle.h"
#include <windows.h>
#include <iostream>


AcceleratedParticle::AcceleratedParticle(HSPRITE sprite):VelocityParticle(sprite)
{	VelocityParticle::VelocityParticle(sprite);
	acceleration = vec3_t(0,0,0);
	SetThink(&AcceleratedParticle::accelerationThink);
}

AcceleratedParticle::AcceleratedParticle(vec3_t _position,vec3_t _velocity,vec3_t _acceleration,HSPRITE sprite):VelocityParticle(_position,_velocity,sprite)
{
	VelocityParticle::VelocityParticle(_position,_velocity,sprite);
	acceleration = _acceleration;
	SetThink(&AcceleratedParticle::accelerationThink);	
}
//-------------------------------------------------------------------------
AcceleratedParticle::~AcceleratedParticle()
{	
}
//-------------------------------------------------------------------------
void AcceleratedParticle::accelerationThink(float time)
{
	position = startPosition + velocity * time + acceleration * time * time * 0.5;
	//velocity = velocity + acceleration * timeDiff;
	//VelocityParticle::velocityThink(timeDiff);
}