Code: Select all
cam->setPosition(node->getPosition+vector3df(0,20,-50));
cam->setTarget(node->getAbsolutePosition());
Code: Select all
cam->setPosition(node->getPosition+vector3df(0,20,-50));
cam->setTarget(node->getAbsolutePosition());
well, I assume you're trying to move the node through an obstacle, but that doesn't work because of the collision detection...skumar wrote:i also had same problem with set position , when collision detection is enabled...why that happens...
Code: Select all
cam->setPosition(node->getPosition+vector3df(0,20,-50));
cam->setTarget(node->getAbsolutePosition());
Code: Select all
smgr->drawAll();
On the offchance that your node's relative position isn't changing, I'd do:charles88 wrote:Code: Select all
cam->setPosition(node->getPosition+vector3df(0,20,-50)); cam->setTarget(node->getAbsolutePosition());
Code: Select all
const core::vector3df nodePosition = node->getAbsolutePosition();
cam->setPosition(nodePosition + vector3df(0,20,-50));
cam->setTarget(nodePosition);