Ogre::Skeleton::hasBone(sName)

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
ghoulsblade
Halfling
Posts: 86
Joined: Sun Mar 05, 2006 2:55 pm
Location: Germany
x 2

Ogre::Skeleton::hasBone(sName)

Post 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
Last edited by ghoulsblade on Tue Jan 29, 2008 3:36 pm, edited 1 time in total.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

It would have been simpler to just submit this as a patch ;)
User avatar
ghoulsblade
Halfling
Posts: 86
Joined: Sun Mar 05, 2006 2:55 pm
Location: Germany
x 2

Post by ghoulsblade »

ok, will do next time, i thought the patch system was for bigger changes =)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post 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 ;)
jonnii
Halfling
Posts: 81
Joined: Sat Jun 19, 2004 1:10 am

Post by jonnii »

not unless someone keeps them alive!

(haigh)
User avatar
ghoulsblade
Halfling
Posts: 86
Joined: Sun Mar 05, 2006 2:55 pm
Location: Germany
x 2

Post by ghoulsblade »

i made and submitted it as patch : #1881855 =)
http://sourceforge.net/tracker/index.ph ... tid=302997
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Yay, that wasn't so bad, eh? ;) Praetor has applied it, thanks.
Post Reply