SimpleRenderable updating bounding box

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

SimpleRenderable updating bounding box

Post by DWORD »

Hi,

I have a hopefully very simple question. I'm sub-classing SimpleRenderable and need to dynamically change the bounding box. I'm modifying the mBox member but it seems the change is not reflected in the scene (i.e. the visibility of my renderable acts as if the bounding box is always 'null').

I found a possible solution, but I don't know if it's the right way to do it, because I thought it would automatically take effect. But right now I'm calling mParentNode->needUpdate() inside my class after changing the mBox member. Is this needed, or am I doing anything wrong?

Maybe I should note that the update of the bounding box occurs inside a FrameListener::frameStarted(). Could this be the reason why it isn't updating? And how could I fix this?
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 66
Contact:

Post by sinbad »

Yes, a needUpdate() is required, since otherwise the node considers that the bounds of children are the same as last time it checked.
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

Ok, thanks. :)
Post Reply