#include "jitteringEffect.h"


void JitteringEffect::render( Render & render )
{
	srand( this->animationTime *1000 );

	float randOffset[2];
	randOffset[0] = (5000 - rand() % 10000) * this->jitteringEffect[0] / 5000.0;
	randOffset[1] = (5000 - rand() % 10000) * this->jitteringEffect[0] / 5000.0;

	int randPos[2];
	randPos[0] = this->leftDownPos[0] + randOffset[0];
	randPos[1] = this->leftDownPos[1] + randOffset[1];

	int upRight[2] = { randPos[0] + this->size[0],  randPos[1] + this->size[1] };

	render.renderImage2D( randPos, upRight, this->texId );
}
void JitteringEffect::simulate( float dt)
{
	this->animationTime += dt;

}