Code: Select all
struct A {
vector<ISceneNode*> nodes(0); //std lib vector
void update();
void run();
};
void A::run() {
while(device->run()) {
update();
}
}
void A::update() {
if(really_need_update) {
for(int i=0;i<nodes.size();i++) {
nodes[i]->remove(); //(1)
}
nodes.clear();
//fill 'nodes' with new scene nodes
}
driver->beginScene(...);
smgr->drawAll();
driver->endScene();
}
But I cannot see anything. If remove line (1), it works, but those scene nodes that should not be seen, are still visible. I could solve this by replacing (1) with
Code: Select all
nodes[i]->setPosition(10000.0f,10000.0f,10000.0f);
So, what could be wrong with the code? (Nice question, isn't it )
Toma