I'm trying to create a "new" camera using the FPS camera, and I was inheriting from CCameraFPSSceneNode, and then I realised that I would have to inherit from ICameraSceneNode because the camera functions in the scene manager all take ICameraSceneNode*. So, I thought to inherit from ICameraSceneNode, then CCameraFPSSceneNode.
Now, this doens't work because ICameraSceneNode is the base class of CCameraFPSSceneNode.
So, while inheriting from just CCameraFPSSceneNode how can I have the class as ICameraSceneNode? Should I just create an FPS camera and leave a pointer to it in the private part of my class definition?
Creating a new camera
Creating a new camera
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
-Japanese Proverb
That's good, but I'm just not sure how to do it. Because my class is called something and then when I create one and then try to use setActiveCamera(ICameraSceneNode*) , it obviously gives me an error that my class isn't the right type, so do I just cast it? eg. setActiveCamera( (ICameraSceneNode*) camera); ???
And just another thing, I'm inheriting from CCameraFPSSceneNode obviously so I don't have to re-write all the code that my mathematical and other skills just aren't up to, and well, I'm getting linking errors for what appears to be all the functons in the CCameraFPSSceneNode class.
That was the first couple of lines (just before the start of the body) of my constructor class. and in the class definiton (header file) I have inherited from the class with " class RTSCamera : public irr::scene::CCameraFPSSceneNode", and I have included the cpp and header files for the class.
So, if you were able to follow all that if you have any suggestions, don't hesitate to beat me over the head with them.
And just another thing, I'm inheriting from CCameraFPSSceneNode obviously so I don't have to re-write all the code that my mathematical and other skills just aren't up to, and well, I'm getting linking errors for what appears to be all the functons in the CCameraFPSSceneNode class.
Code: Select all
RTSCamera::RTSCamera(irr::f32 r, irr::f32 r_limit, irr::f32 h, irr::IrrlichtDevice* device, irr::f32 angleY, irr::core::vector3df start_pivot)
: irr::scene::CCameraFPSSceneNode(NULL, device->getSceneManager(), device->getCursorControl(), -1, 1500.0f, 200.0f,0,0 )
So, if you were able to follow all that if you have any suggestions, don't hesitate to beat me over the head with them.
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
-Japanese Proverb
Don't inherit from the FPS camera, it prob won't contain anything useful to your new class.
Then update ISceneManager.h to:
Not sure if this the best/only way but it seems to work.
Code: Select all
declaration:
class CCameraEditorSceneNode : public CCameraSceneNode
definition:
CCameraEditorSceneNode::CCameraEditorSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
f32 rs, f32 zs, f32 ts)
: CCameraSceneNode(parent, mgr, id)
Code: Select all
virtual ICameraSceneNode* addCameraSceneNodeEditor(ISceneNode* parent = 0,
f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f, f32 translationSpeed = 1500.0f, s32 id=-1) = 0;
- Nova