nargil
30-01-2009 23:03:35
Is there any good way to get objects from a specific factory ?
[cSwiatlo is my class that inherits from NodeRenderable and Actor. It manages lights in the scene editor]
For now i use
1. I have to cheack every actor
2. I have to double get it. Using
[cSwiatlo is my class that inherits from NodeRenderable and Actor. It manages lights in the scene editor]
For now i use
NxOgre::Actors* act = this->mScene->getActors();
cSwiatlo* swiatlo;
for(NxOgre::Actor* a = act->begin(); a = act->next();)
{
swiatlo = (cSwiatlo*)mScene->getActor(a->getName()); // this is so bad and newbish and not'Betajean'like xD Another method is to raycast to the actors position, but this is even worse.
if(swiatlo->getType()==12349)
{
swiatlo->getNode()->setVisible(pokaz,true);
}
}
But i don't like it for two reasons:1. I have to cheack every actor
2. I have to double get it. Using
for(cSwiatlo* a = (cSwiatlo*)act->begin(); a = (cSwiatlo*)act->next();)
does throw 0x0000005 Access violation. Basicly there is garbage at ->getType() and ->getNode()