ok here is the changed files and cam node.
hopefully you have not lost interest in this.
I think this would be a good addition to Irrlicht considering how useful it can be for game development of RTS, Space, ect...
here is a basic app to use it.
(you might want to comment out the skydome or add a pic of your own)
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
ISceneNode* SkyDome;
int main()
{
IrrlichtDevice *device =
createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16,
false, false, false, 0);
device->setWindowCaption(L"Orb scene test");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
guienv->addStaticText(L"Orb Scene Node Test",
rect<int>(10,10,200,22), true);
IAnimatedMesh* mesh = smgr->getMesh("sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setFrameLoop(0, 310);
node->setMaterialTexture( 0, driver->getTexture("sydney.bmp") );
}
ISceneNode* box = smgr->addCubeSceneNode();
// add camera
scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeOrb(node);
cam->setTarget( node->getAbsolutePosition() );
SkyDome = smgr->addSkyDomeSceneNode(driver->getTexture("starbox_up.jpg"), 30, 8, 1, 2);
while(device->run())
{
driver->beginScene(true, true, SColor(0,200,200,200));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}