API and/or C++ question

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
Hacim
Posts: 7
Joined: Mon Dec 19, 2005 4:03 pm

API and/or C++ question

Post by Hacim »

I kind of new to this OOP part of C++ so maybe I'm just missing some thing,
but here is my problem: I want to make of subclass of ICameraSceneNode
but that class is abstract or whatever (something todo with pure virtual functions) so I thought there must already be a sub class of ICameraSceneNode,therefore I looked in the source code (I didn't not compile it) and found CCameraSceneNode wich seem to be just what I wad looking for except when I tried to use it in my program it did not seem to exist.
Do I have to include that file?I think that highly unlikely.Does any one no what I'm saying?
Thanks
Guest

Post by Guest »

This has to do with the architecture of C++ DLLs - the CCameraSceneNode is just the implementation in the DLL and its using the ICameraSceneNode (called the (I)nterface) so you can use it outside the DLL. So you know the ICameraSceneNode and you can request data which is derived from that interface without knowing the class type.

You have to use ISceneManager::addCamera (in different variations) and get a working CCameraSceneNode.

check google some OOP knowledge wont hurt when working with irrlicht.
Hacim
Posts: 7
Joined: Mon Dec 19, 2005 4:03 pm

Post by Hacim »

Oh I think I get it.So there is really no easy way to create a sub class of any of the Interface classes without overiding every pure virtual function in the super class?(which would be a bit of work for the larger classes like ICameraSceneNode.)I could still work around that by just havine a pointer to it in a costom class but that would, be as clean.Oh well.

thanks for your help.
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

So there is really no easy way to create a sub class of any of the Interface classes without overiding every pure virtual function in the super class?
That's right, but the point of making a class with many pure virtual functions is specifically so that class can be used by many classes that derive from it and share its functionality, but by itself the class is useless. One thing you might try doing is make a class, keep an ICameraSceneNode pointer in it and manipulate it there. A camera class make sense to be stored with a player controller or something similar
Hacim
Posts: 7
Joined: Mon Dec 19, 2005 4:03 pm

Post by Hacim »

Alright that's what I'll do, thanks everybody.
Post Reply