GetBoundingBox vs GetBounds
-
- Gold Sponsor
- Posts: 1894
- Joined: Sun Mar 08, 2009 5:25 am
- x 116
GetBoundingBox vs GetBounds
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.
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 535
Re: GetBoundingBox vs GetBounds
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.
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.
-
- OGRE Retired Team Member
- Posts: 2903
- Joined: Thu Jan 18, 2007 2:48 pm
- x 58
Re: GetBoundingBox vs GetBounds
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?
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?
-
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
Re: GetBoundingBox vs GetBounds
Agreed -- first thing I thought when I saw this post was "there is the canonical example of a papercut".CABAListic wrote:Well, that's one of the cases I had in mind with the papercuts
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 535
Re: GetBoundingBox vs GetBounds
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.
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.
-
- OGRE Community Helper
- Posts: 767
- Joined: Wed Oct 10, 2007 2:36 pm
- Location: Germany
- x 39
Re: GetBoundingBox vs GetBounds
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 ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.