camera->setTarget(player->getPosition()) watching in nowhere
Posted: Tue Nov 25, 2014 8:31 pm
I want to implement 3rd view camera.
And in cycle
Camera following correctly but watching in wrong position. What I do wrong?
THANKS!
Code: Select all
...
scene::ISceneNodeAnimator* anim = mSmgr->createCollisionResponseAnimator(
meta, camera, core::vector3df(5, 5, 5),
core::vector3df(0, 0, 0));
meta->drop(); // done with the meta selector now
camera->addAnimator(anim);
anim->drop(); // done with the animator now
// And set the camera position so that it doesn't start off stuck in the geometry
camera->setPosition(core::vector3df(-50.0f, 50.0f, 0.0f));
scene::IAnimatedMeshSceneNode* player = reinterpret_cast<scene::IAnimatedMeshSceneNode*>(mSmgr->getSceneNodeFromName("player"));
scene::ISceneNode* gnome = mSmgr->getSceneNodeFromName("Gnome");
player->addChild(camera);
Code: Select all
player->setPosition(nodePosition);
camera->setTarget(player->getPosition());
THANKS!