This is more about common C++-11 programming, is there a way to write child terrain class inherited from those which used in
Code: Select all
pSceneManager->addTerrainSceneNode(...)
I need this stuff for multi-texturing (http://irrlicht.sourceforge.net/forum/v ... =9&t=38676), but no via MultiTexturingManager, cause it runs its drawAll() method, when all nodes were registered, but decal one (http://irrlicht.sourceforge.net/forum/v ... cal+system) should be drawn after terrain, that cause problems.
So I tried several methods to solve problem:
1. inherit from CTerrainSceneNode, using CTerrainSceneNode.h - failed, linker can't find this class in library
2. inherit from ITerrainSceneNode as proxy-pattern - fine, but proxy must override all ISceneNode methods as well, too much for one overrinding
3. inherit from CDefaultSceneNode (which is renamed CTerrainSceneNode) using source code, this also need copy-pasting and renaming CTerrainSelector (which is friend-class, I wonder why, is it so necessary?) and some other little stuff like removing os-dependence code (change to Logger & Timer classes) - works pretty well, but too much source code using
So the question is, can I write something like this using anonymous methods in C++-11: (I use Java-style here)
Code: Select all
ITerrainSceneNode* pTerrainSceneNode = pSceneManager->addTerrainSceneNode() {
@Override
void render() {
// my code here
}
}
P.S I was searching through forum, but didn't find solution