Scene Manager UnDeclared

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Frazz1080
Posts: 41
Joined: Fri Nov 18, 2005 3:09 am

Scene Manager UnDeclared

Post by Frazz1080 »

After hours upon hours of searching and analyzing, I have finally figured out how to keep my racecar going by pressing and holding the keyboard.
Now I'm trying to smooth animation(basically, the same thing, though a tad different than before), and I'm trying out one method that I found by copying and pasting from another forum question.
The code sample:
vector3df moveForward = Arwing->getAbsolutePosition();
moveForward.X += 2;
ISceneNodeAnimator* runto = SceneManager->createFlyStraightAnimator(
Arwing->getAbsolutePosition(), moveForward, time, 0);
Arwing->addAnimator(runto);
runto->drop();
break;
}
Without this chunk of code, my game thus far compiled fine, but now the Compiler keeps telling me that 'SceneManager's is undeclared, 'first use of this function'. I just read about 'Dynamic Memory Pointers' in a C++ manual, so now I'm having a better and better idea of what's going on. How do I declare this?
roninmagus
Posts: 91
Joined: Fri Oct 31, 2003 5:03 am

Post by roninmagus »

The code you grabbed to create an animator seems to come from inside a custom scene node, or where a pointer called "SceneManager" has been created. Try replacing SceneManager with <pointer to irr device>->getSceneManager()

Code: Select all

 ISceneNodeAnimator* runto = [b]irrDevice->getSceneManager()[/b]->createFlyStraightAnimator(
Arwing->getAbsolutePosition(), moveForward, time, 0);
Arwing->addAnimator(runto); 
[/b]
daveandrews.org - A Christian Programmer's Weblog | Dusty Engine - A Task Engine for Irrlicht
Post Reply