Hello,
Im a newbie coder and trying to get my head round the irrlicht engine. I have a problem. Im trying to create a new player class derived from a CCameraFPSSceneNode. Im looking at the irrlicht source and im led to beleive that i can access this class under the scene namespace but however it keeps tellin me it is not a member of this namespace. i have tried it without a namespace but it says something like base class dont exist...here is what i have...
#include "StdAfx.h"
#include "IrrBox.h"
class CPlayer: public scene::CCameraFPSSceneNode
{
private:
CPlayer(IrrlichtDevice *indev);
IrrlichtDevice *device;
};
I am sorry as this will probably seem really obvious and stupid to some but i want to know...how can i derive from the CCamerFPSSceneNode class?
namespace misunderstanding
Code: Select all
using namespace irr;Code: Select all
public irr::scene::CCameraFPSSceneNode-
3dsmin
If inheriting from CCameraFPSSceneNode doesn't work then I would try ICameraSceneNode, all the functions you need are there so you only need to include the functions you wish to change. IIRC CCameraFPSSceneNode inherits from ICameraSceneNode, which in turn inherits from ISceneNode. So just grabbing the functions in CCameraFPSSceneNode and putting it in a ISceneNode class won't work ( I think ) as the functions which aren't changed by CCameraFPSSceneNode won't be in the class. Then again, polymorphism still confuses me quite a bit so that may not be quite accurate but I am pretty sure that's right.
Edit: Actually, if it's a C prefix on the class name it's a base class innit. You should still be able to create a camera inheritied from ICameraSceneNode, you may have to manually copy code from the CCameraFPSSceneNode class over but at least it will work. Sorry, thought you might get away with doing it without copying from file to file
Edit: Actually, if it's a C prefix on the class name it's a base class innit. You should still be able to create a camera inheritied from ICameraSceneNode, you may have to manually copy code from the CCameraFPSSceneNode class over but at least it will work. Sorry, thought you might get away with doing it without copying from file to file
-
Void
Yeah Tyn, thats pretty much what i ended up doing...All of your answers have helped me to realise what alla the C's an I's are about as i misunderstood that aswell before. Thanks for all your helps. However i have 1 more question, and that is, why has the creator done this like, so that we must use the I prefixed classes an copy code from the C prefix classes. Why no allow us to just derive from the C prefixes and do away with all the I's. Im not complaining, im just curious.
Thanks
VoidChoice
Thanks
VoidChoice