aserrano1971
17-11-2007 09:06:38
Hi,
First at all I want to thank you this all great work. I really followed the initial tutorial and in only three lines I had physics in my game.
Second sorry for my bad english.
The question. I have implemented a third person camera system for some test-game I'm doing in this way:
Now I can rotate camera, move and pitch in this way
The question would be in this is correct or is there any other way to do this?
You can notice I've added a setNode to character class (I know I could use inheritance...this is quicker actually for me)
Second question is about terrain.
I've created a terrain:
But looks like as if the geometry is down the terrain. ??
How can I solve it??
thanks and kind regards!!
First at all I want to thank you this all great work. I really followed the initial tutorial and in only three lines I had physics in my game.
Second sorry for my bad english.
The question. I have implemented a third person camera system for some test-game I'm doing in this way:
ResourceGroupManager::getSingleton().openResource(BWMAINMESHNAME,BWMAINRESOURCE);
mCamera=mSceneMgr->getCamera(BWMAINCAMERA);
mMainNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(BWMAINCHARACTERNODE);
mCharNode = mMainNode->createChildSceneNode(BWCHARACTERNODE);
mCharacter = mScene->createCharacter("character",Vector3(0,0,0),"type: box, dimensions: 1,2,1");
mCharacter->setNode(mCharNode);
mCharacter->attachMesh(BWMAINMESHNAME);
mCharacter->getEntity()->setMaterialName(MAINCHARMATERIAL);
mCameNode = mMainNode->createChildSceneNode(BWMAINCAMERANODE);
mPitcNode = mCameNode->createChildSceneNode(BWCAMEPITCHNODE);
mCamera->setPosition(0,7,0);
mPitcNode->attachObject(mCamera);
mPitcNode->setPosition(0,0,-20);
mCamera->lookAt(0,0,0);
mCameNode->setAutoTracking (true, mCharNode);
mCameNode->setFixedYawAxis (true);
mCamera->setNearClipDistance(5);
mCamera->setFarClipDistance(800);
Now I can rotate camera, move and pitch in this way
mCharacter->getCameNode()->yaw(mRotX);
mCharacter->getCameNode()->pitch(mRotY);
...
mMainNode->yaw(Degree(1));
...
mMainNode->translate(Movement);
...
The question would be in this is correct or is there any other way to do this?
You can notice I've added a setNode to character class (I know I could use inheritance...this is quicker actually for me)
Second question is about terrain.
I've created a terrain:
Actor *actor=mScene->createActor("terrain", new TerrainShape("heightmap.raw",118.803,"material:terrain_texture.jpg"),Vector3::ZERO, "static: yes");
But looks like as if the geometry is down the terrain. ??
How can I solve it??
thanks and kind regards!!