for same piece of code, Irrlicht 1.4.1 and the SVN (Irrlicht 1.4.2 ??) give different results.
(1)
- i added a FPScamera and set its position and target.
what i would expect is a camera looking at the world origin.
Code: Select all
cam = smgr->addCameraSceneNodeFPS(); cam->setPosition(core::vector3df(100,100,-100)); cam->setTarget(core::vector3df(0,0,0));
it works in 1.4.1, but not in 1.4.2.
so i take a look on the source code,
i found that in 1.4.2, setTarget() is simply CCameraSceneNode::setTarget() instead of CCameraFPSSceneNode::setTarget().
which means that 'target' is only a relative position, but not absolute position.
if i want to achieve the same result, i must modify my code in this way:Code: Select all
cam = smgr->addCameraSceneNodeFPS(); cam->setPosition(core::vector3df(100,100,-100)); cam->updateAbsolutePosition(); cam->setTarget(core::vector3df(0,0,0) - cam->getAbsolutePosition());
- i added a billboard and set a camera as its parent:
i want to have a billboard which always stays in front of the camera with 50 unit distance.
Code: Select all
scene::IBillboardSceneNode* test = smgr->addBillboardSceneNode(cam, core::dimension2df(12,12), core::vector3df(0,0,50));
again, i got what i expected in 1.4.1.
however, in 1.4.2, the billboard neglects the camera's rotation, and only moves to pos(0,0,50) relative to the camera's position.
to fix this, i added some code before smgr->drawAll()the result is bad since it's not really synchronized with the camera movement.Code: Select all
core::vector3df tempVect = ((scene::ICameraSceneNode*)test->getParent())->getTarget() - ((scene::ICameraSceneNode*)test->getParent())->getPosition(); tempVect.normalize(); tempVect *= 50; test->setPosition(tempVect); test->updateAbsolutePosition();
i don't know how to solve this problem.