jetzt lässt sich die kamera garnicht mehr bewegen
Code:
#include <irrlicht.h>
using namespace irr;
using namespace video;
using namespace core;
using namespace scene;
using namespace gui;
using namespace io;
int main()
{
IrrlichtDevice *device=
createDevice(EDT_OPENGL, dimension2d<u32>(640,480),0,false,false,false,0);
if (!device)
return 1;
device->setWindowCaption(L"Zimmer");
IVideoDriver *driver=device->getVideoDriver();
ISceneManager *smgr=device->getSceneManager();
IAnimatedMesh *mesh=smgr->getMesh("C:/Dokumente und Einstellungen/Nick/Desktop/Zimmer.3ds");
smgr->getMeshManipulator()->makePlanarTextureMapping(mesh->getMesh(0), 1.008f);
scene::IMeshSceneNode* node = 0;
node = smgr->addOctreeSceneNode(mesh->getMesh(0));
node->setMaterialTexture(0, driver->getTexture("C:/Dokumente und Einstellungen/Nick/Desktop/SDK-Irrlicht3D/irrlicht-1.7.1/media/wall.jpg"));
node->getMaterial(0).SpecularColor.set(0,0,0,0);
scene::ITriangleSelector* selector = 0;
if (node)
{
node->setPosition(core::vector3df(0,0,0));
selector = smgr->createOctreeTriangleSelector(
node->getMesh(), node, 128);
node->setTriangleSelector(selector);
}
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0, 100.0f, .3f/*, ID_IsNotPickable*/, 0, 0, true, 3.f);
camera->setPosition(core::vector3df(0,0.5,0));
camera->setTarget(core::vector3df(-70,30,-60));
if (selector)
{
core::vector3df box=core::vector3df(5,5,5);
core::vector3df gravitation=core::vector3df(0,0,0);
scene::ISceneNodeAnimator* anim =smgr->createCollisionResponseAnimator(
selector, camera, box,gravitation);
core::vector3df(0,-10,0), core::vector3df(0,30,0);
selector->drop();
camera->addAnimator(anim);
anim->drop();
}
device->getCursorControl()->setVisible(false);
scene::ISceneNode* lightNode=NULL;
lightNode = smgr->addLightSceneNode(0, core::vector3df(0,0,0),
video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 600.0f);
while(device->run())
{
driver->beginScene(true,true,0);
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
gibts eigentlich eine andere möglichkeit als diese bounding box? wieso geht das mit dem triangleselector nicht?