elieajaltouni
05-06-2009 16:55:50
Hi everyone I am trying to add collision detection between the camera and an ofusion scene I have loaded
this is my code in the createScene:
Is it possible to be done? how to do it any ideas?
this is my code in the createScene:
void createScene(void)
{
OSMScene oScene;
oScene.initialise("pyramidAnim1.osm", NULL);
oScene.createScene();
mSceneMgr = oScene.getSceneManager();
mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
mCamera = mSceneMgr->createCamera("PlayerCam");
// Position it at 500 in Z direction
mCamera->setPosition(Vector3(0,0,500));
// Look back along -Z
mCamera->lookAt(Vector3(0,0,-300));
mCamera->setNearClipDistance(5);
// If a viewport was not automatically created, (no cameras saved in the scene)
// create a default viewport, entire window
Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(ColourValue(0,0,0));
// Alter the camera aspect ratio to match the viewport
mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
}Is it possible to be done? how to do it any ideas?