Inheritance and pure virtual functions
Inheritance and pure virtual functions
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
-Japanese Proverb
Use CCameraSceneNode. Otherwise, as you expected, you will have to define all the pure virtuals.
Tomasz Nowakowski
Openoko - www.openoko.pl
Openoko - www.openoko.pl
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.
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?
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();
};
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
-Japanese Proverb
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
Crucible of Stars