Ok stupid question,
But how would I access the first item of an irr::core::list?
More specifically there is one ISceneNode animator which has been added to a scene node and I want to get a pointer to it?
Many Thanks
DoctorZeus
How To Get Irrlicht List Item
Re: How To Get Irrlicht List Item
Did not compile, so might contain typos:
Also check the docs: http://irrlicht.sourceforge.net/docu/cl ... 1list.html
Code: Select all
const core::list<ISceneNodeAnimator *>& myAnimators = sceneNode->getAnimators ();
// only the first
if (!myAnimators.empty())
ISceneNodeAnimator * animator = *myAnimators.begin ();
// All of them
for (const core::list<ISceneNodeAnimator *>::Iterator iter=myAnimators.begin (); iter != myAnimators.end(); ++iter)
{
ISceneNodeAnimator * animator = *iter;
}
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 13
- Joined: Sun Jan 12, 2014 3:39 pm
Re: How To Get Irrlicht List Item
Thats seems to work!CuteAlien wrote:Did not compile, so might contain typos:Also check the docs: http://irrlicht.sourceforge.net/docu/cl ... 1list.htmlCode: Select all
const core::list<ISceneNodeAnimator *>& myAnimators = sceneNode->getAnimators (); // only the first if (!myAnimators.empty()) ISceneNodeAnimator * animator = *myAnimators.begin (); // All of them for (const core::list<ISceneNodeAnimator *>::Iterator iter=myAnimators.begin (); iter != myAnimators.end(); ++iter) { ISceneNodeAnimator * animator = *iter; }
Many Thanks!