Here are parts of my code:
Code: Select all
float carrotation = 0.0;
//dummy parent node
scene::ISceneNode* node = smgr->addTestSceneNode();
//create billboard with car texture making it a sprite and child of node
car = device->getSceneManager()->addBillboardSceneNode(node, core::dimension2d<f32>(70,93));
car->setMaterialFlag(video::EMF_LIGHTING, false);
car->setMaterialTexture(0, driver->getTexture("data/car.bmp"));
car->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
//inside main loop
//using bool keys
if(keys[irr::KEY_KEY_A])
{
carrotation +=1;
node->setRotation(node->getPosition() + core::vector3df(0.0f,carrotation,0.0f);
std::cout <<carrotation <<"\n";
}
Thanks