Skip to content

Commit

Permalink
GRAPHICS: Update the root node in Renderable::getSize()
Browse files Browse the repository at this point in the history
No idea why, but this is now necssary, otherwise getSize() sometimes
won't take the scale into account... -.-
  • Loading branch information
DrMcCoy committed Mar 21, 2014
1 parent 30798fb commit ee09c3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/graphics/renderable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ void Renderable::setBaseScale(float x, float y, float z) {
}

void Renderable::getSize(float &width, float &height, float &depth) const {
_rootNode->_update(true, true);

getNodeSize(_rootNode, width, height, depth);
}

Expand Down Expand Up @@ -278,7 +280,7 @@ void Renderable::destroyAnimation(Ogre::Animation *anim) {
static void addBoundBox(Ogre::AxisAlignedBox &bound, const Ogre::SceneNode &node) {
// Move all attached visible objects into the bounding box
for (Ogre::SceneNode::ConstObjectIterator o = node.getAttachedObjectIterator(); o.hasMoreElements(); o.moveNext())
bound.merge(o.current()->second->getWorldBoundingBox(true));
bound.merge(o.current()->second->getWorldBoundingBox(false));

// Recurse into the child nodes
for (Ogre::Node::ConstChildNodeIterator c = node.getChildIterator(); c.hasMoreElements(); c.moveNext())
Expand Down

0 comments on commit ee09c3b

Please sign in to comment.