Code: Select all
class CObject
{
private:
float m_X, m_Y, m_Z; // die position
float m_Xspeed, m_Yspeed; // die geschwindigkeit
IAnimatedMeshSceneNode *m_pNode;
public:
CObject();
void create(float x, float y, float z, IAnimatedMeshSceneNode *node);
void accelerate(float xdelta, float ydelta); // beschleunigung
void move();
};
Code: Select all
beep.create(10.0, 10.0, 20.0, star);
Code: Select all
beep.accelerate(-0.1,0.0);
In the while-loop of the game I want to use beep.move(); to update the position of the nodes. but how do I create a loop, that goes throught all nodes created on the screen an changes their position?
Code: Select all
void CObject::move()
{
float xdelta, ydelta;
xdelta=m_Xspeed;
ydelta=m_Yspeed;
m_X+=xdelta;
m_Y+=ydelta;
vector3df p;
p.X = m_X;
p.Y = m_Y;
p.Z = m_Z;
//???
//?->setPosition(p);
}
BTW: Thanks Niko, Irrlicht is GREAT!!!