This is my first post in this forum after a long while (still being active with Irrlicht) and this is a question that is around in my head for a long time.
I want to "reset" the absolute position of a node to vector3df(0,0,0) and then manually set the local position with the old absolute value.
Example: A Node has the initial absolute position of (11,14-2). That means after resetting the position this should give me
Code: Select all
node->getAbsolutePosition()
Code: Select all
node->setPosition(vector3df(11,14,-2))
Code: Select all
smgr->getMesh("./media/models/TreeA.3ds")
Code: Select all
smgr->addCubeSceneNode(1.0f);
But when I load a COLLADA Scene into Irrlicht (modelled with Blender) the object is initialized with the position which is specified in Blender in the transform panel:
http://postimg.org/image/z8l3a1k2b/
In this example (11,14,-2).
This gives me a huge problem in my whole application because I have to do different kinds of checks, re-positioning, re-calculating etc. Especially when it comes to using the Bullet Physics Engine. The bounding boxes and position are getting messed up.
That is how I load the collada file:
Code: Select all
smgr->getParameters()->setAttribute(irr::scene::COLLADA_CREATE_SCENE_INSTANCES, true);
scene::IAnimatedMesh* meshmodel = smgr->getMesh(name);
core::array<scene::ISceneNode *> nodes;
smgr->getSceneNodesFromType(scene::ESNT_ANY, nodes);
Code: Select all
matrix4 m;
m.setTranslation(-node->getAbsolutePosition());
smgr->getMeshManipulator()->transform(ams->getMesh(), m);
Thank you very much...