//******************************************************* // // //******************************************************* class particula { //***************************************************** // # Static Vars +------------------------------------- float radi = 1; // 2D float posX = 50; float posZ = -20; // altura float posY = 50; //***************************************************** // # dynamic Vars +------------------------------------ // Degree float degree = 0; int _height; // Postion final float posFinalX, posFinalY, posFinalZ; //***************************************************** // +--------------------------------------------------- particula( float _posX, float _posY, float _posZ, int __height){ posX = _posX; posZ = -_posZ; _height = __height; // altura posY = (float)_height-_posY; posFinalY = posY; } // +--------------------------------------------------- void move(){ degree +=10; radi = 50-(50*(posFinalY/posY))+10; posFinalY -=0.15; if(posFinalY< 0 ){ posFinalY = posY;} posFinalX = sin(degreeToRad(degree))*radi+posX ; posFinalZ = cos(degreeToRad(degree))*radi+posZ ; } // +--------------------------------------------------- float degreeToRad( float num ) { return (PI/180)*num; } }