Page 1 of 1

Ogre::Skeleton::hasBone(sName)

Posted: Sat Jan 26, 2008 2:15 pm
by ghoulsblade
Hi all =)

a efficient test if a skeleton has a bone with a specific name would be good.

Ogre::Skeleton::getBone(sName) throws an exception if the bone with that name doesn't exist, and this clutters the Ogre.log

suggested implementation :

Code: Select all

bool Skeleton::hasBone(const String& name) const { return mBoneListByName.find(name) != mBoneListByName.end(); }
EDIT : fixed returntype to bool

Posted: Sat Jan 26, 2008 5:50 pm
by sinbad
It would have been simpler to just submit this as a patch ;)

Posted: Sat Jan 26, 2008 7:39 pm
by ghoulsblade
ok, will do next time, i thought the patch system was for bigger changes =)

Posted: Mon Jan 28, 2008 6:14 pm
by sinbad
ghoulsblade wrote:ok, will do next time, i thought the patch system was for bigger changes =)
Nope, use it for everything. Threads sink fast in the forum ;)

Posted: Tue Jan 29, 2008 12:28 pm
by jonnii
not unless someone keeps them alive!

(haigh)

Posted: Tue Jan 29, 2008 4:03 pm
by ghoulsblade
i made and submitted it as patch : #1881855 =)
http://sourceforge.net/tracker/index.ph ... tid=302997

Posted: Wed Jan 30, 2008 11:02 pm
by sinbad
Yay, that wasn't so bad, eh? ;) Praetor has applied it, thanks.