Creating a new Animator

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Chev
Posts: 37
Joined: Wed Nov 19, 2003 6:15 am

Creating a new Animator

Post by Chev »

This is my first post so I'd like to begin by thanking niko for this incredible 3d engine. I have been playing with the tutorials and they left me hungry for more built in animators. I created an animator in the same fashion as the FlyCircle and FlyStraight animators. I created a CSceneNodeAnimatorMyAnimator.h and a CSceneNodeAnimatorMyAnimator.cpp. However, I then realized that although the animator specific code is in the .cpp and .h, every animator in the engine is initialized by the scenemanager in (source) CScenemanger.cpp
ex: ISceneNodeAnimator* CSceneManager::createFlyStraightAnimator

So.. my question is..What would be the best way to call my animator that I created. Do I need to modify CSceneManager.cpp and add
ISceneNodeAnimator* CSceneManager::createMyAnimator (and relevant code) and recompile the entire engine? Or is there an easier way? I admit that I'm a beginner and might be doing something wrong here.
Any help would be appreciated.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

No, just derive your animator from ISceneNodeAnimator and create it with for example

Code: Select all

ISceneNodeAnimator* s = new CYourSNAnimator();
Now you can add it to every scene node you like. If you don't need it anymore , just delete it with s->drop(). (Don't use delete s).
Guest

Post by Guest »

Thank you!
Post Reply