Am trying to write my own camera class (derived from ICameraSceneNode, duh) and I am wondering how to add that to the manager.
Not sure yet but it seems that the next snippet won't work.
Code: Select all
cMyCam* camera = (cMyCam*)smgr->addCameraSceneNode( 0, vector3df( 0, 0, 10 ), vector3df( 0, 0, 0 ), -1, true );
Code: Select all
void cMyCam::setPosition( const vector3df& newpos )
{
s32 i = 1;
i++;
}
This would be the correct way.
Get the root node of the scenemanager and pass that as parent.
Code: Select all
cMyCamera *camera = new cMyCam( smgr->getRootSceneNode(), smgr, -1 );