ISceneNode Inheritance
Posted: Sun Dec 14, 2008 4:01 am
I wrote a working text-based version of an 8 puzzle, but I want to add graphics using irrlicht. I don't want to have to re-write everything, so I want to just inherit my Tile (the pieces you move around) class from the ISceneNode class. I have this as my simple and initial attempt to inherit.
Later on I try to declare this new class I've created with the following code:
I get the error:
error: invalid conversion from `irr::scene::ISceneNode*' to `
Tile*'
What am I doing wrong?
Code: Select all
class Tile : public ISceneNode
{
public:
Tile();
Tile(ISceneNode*,ISceneManager*,s32,const core::vector3df &,const core::vector3df &,
const core::vector3df &);
private:
int x;
int y;
};
Tile::Tile(ISceneNode* parent,ISceneManager* mgr,s32 id = -1,
const core::vector3df & position = core::vector3df(0,0,0),
const core::vector3df & rotation = core::vector3df(0,0,0),
const core::vector3df & scale = core::vector3df(1.0f, 1.0f, 1.0f))
:ISceneNode(parent, mgr, id, position, rotation, scale),x(0),y(0){};
Code: Select all
Tile* n = smgr->addCubeSceneNode();
error: invalid conversion from `irr::scene::ISceneNode*' to `
Tile*'
What am I doing wrong?