Inheritance and pure virtual functions

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
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Inheritance and pure virtual functions

Post by Endar »

I'm basically looking to use a FPS camera for something, and since I'm new to inheritance with....well, anything, if I take the ICameraSceneNode class as a base class, does that mean that I have to define all the pure virtual functions, or should I be using the CCameraSceneNode class as a base class?
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

Use CCameraSceneNode. Otherwise, as you expected, you will have to define all the pure virtuals.
Tomasz Nowakowski
Openoko - www.openoko.pl
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Post by Endar »

Okay, here is my header file right now. I've included CCameraSceneNode.h and os.h because it seemed to need it. Also, in my source file I've included the cpp versions of these files.

Code: Select all

#include <irrlicht.h>
using namespace irr;

/****************************/
// Need to include to inherit without having to re-write all the camera code
#include "../../Irrlicht Engine/source/CCameraSceneNode.h"
#include "../../Irrlicht Engine/source/os.h"
/****************************/

class RTSCamera : public scene::CCameraSceneNode
{
protected:
	// Center point that the camera is always looking at
	core::vector3df camera_pivot;
	f32 radius, radius_limit, height, yAngle;
	// Pointer to FPS camera
	scene::CCameraSceneNode* camera;

public:
	RTSCamera(f32 r, f32 r_limit, f32 h, irr::IrrlichtDevice* device, 
	        f32 angleY = 0, 
           core::vector3df start_pivot = core::vector3df(0,0,0) );
	~RTSCamera();

	// Return the horizontal position that the camera should be at
	core::vector3df getHorizontalPosition();
};
And now, I get 102 errors most of them dealing with problems with the IUnknown class.

Am I supposed to include some? Or include others? Help? :?
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

Are any of your errors for missing include files?
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Post Reply