GetBoundingBox vs GetBounds

Minor issues with the Ogre API that can be trivial to fix
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 116

GetBoundingBox vs GetBounds

Post by mkultra333 »

For entities it's pEnt->getBoundingBox(), but for meshes it's getMesh()->getBounds(). This seems a bit inconsistent because they both return a bounding box. Perhaps it could be the same for both.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Re: GetBoundingBox vs GetBounds

Post by Kojack »

Most classes use getBoundingBox() (since they inherit it from movableobject), but here's a few that don't:
ConvexBody::getAABB()
InstancedGeometry::GeometryBucket::getAABB()
PatchSurface::getBounds()
AxisAlignedBoxSceneQuery::getBox()
FocusedShadowCameraSetup::getAAB()
Mesh::getBounds()
OctreeNode::_getLocalAABB()
OctreeZone::getAABB() (this one copies the aabb into a reference parameter, all the others return the aabb)
PortalBase::getAAB()
PortalBase::getBoundingBox() (getAAB returns the portal aabb with movement. getBoundingBox returns the local portal aabb)
Terrain::getAABB()

Setting bounds:
SimpleRenderable::setBoundingBox()
BillboardSet::setBounds()
Mesh::_setBounds()
ParticleSystem::setBounds()

Getting world bounds:
SceneNode::_getWorldAABB()
Entity::getWorldBoundingBox()
Terrain::getWorldAABB()

At the very least we should unify the getAAB and getAABB methods. :)
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: GetBoundingBox vs GetBounds

Post by CABAListic »

Well, that's one of the cases I had in mind with the papercuts :)
I'd say that the underlined _ functions might be excluded as they are special functions, but the rest could certainly do with a unified name. Any preferences?
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: GetBoundingBox vs GetBounds

Post by xavier »

CABAListic wrote:Well, that's one of the cases I had in mind with the papercuts :)
Agreed -- first thing I thought when I saw this post was "there is the canonical example of a papercut". ;)
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Re: GetBoundingBox vs GetBounds

Post by Kojack »

There's also getBoundingRadius used a lot (haven't looked for alternative of it) and is related, so it would make sense to have getBoundingBox and getBoundingRadius.

Yep, the underscore ones are probably ok. I personally dislike the underscore at the start style, makes intellisense more annoying than usual, but as long as the second character is not upper case or another underscore then it's valid (those two are reserved). The reasons should be checked though, to make sure it's still a special case method. SceneNode::_getWorldAABB() requires a scenegraph update to give current results, so it's still a special case.
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39

Re: GetBoundingBox vs GetBounds

Post by Beauty »

Please list all API changes on the "porting notes" wiki page, so that people can find it quickly (as done in the past, e.g. for Cthugha).
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.