guk_guk41
19-12-2008 23:34:38
I tried to attach default camera created by ofusion to another sceneNode since I want to create a collision detection system using OgreNewt. When I tried to attach mCamera directly to a cameraNode like this
My App basically just thown this exception
So I just change my code to be similar like this
Then another oddity comes in, my default skybox just disappear.
This is my app looks when camera isn't attached to camNode
Please, can somebody explain to me how to properly detach and attach mCamera from default SceneNode to my own Camera Node since I want to create a collision detection system.
camNode = mSceneMgr->getSceneNode("d_cameraPos");
if (mCam){
// attach camera to camNode
camNode->attachObject(mCamera);
};
My App basically just thown this exception
So I just change my code to be similar like this
if (mCam){
initialCamNode = mCamera->getParentSceneNode();
// detach camera from its initial scene node
initialCamNode->detachAllObjects();
};
camNode = mSceneMgr->getSceneNode("d_cameraPos");
if (mCam){
// attach camera to camNode
camNode->attachObject(mCamera);
};
Then another oddity comes in, my default skybox just disappear.
This is my app looks when camera isn't attached to camNode
Please, can somebody explain to me how to properly detach and attach mCamera from default SceneNode to my own Camera Node since I want to create a collision detection system.