Page 1 of 1

When are BoundingBox calculated? or How to force them to?

Posted: Wed Feb 12, 2014 5:27 pm
by invadrzim
Hi, i'm working with a team building an FPS game and have run into small trouble with the entity.collisioninformation.boundingbox 's. I'm trying to use the bounding boxes on our objects to generate a Quad Tree for culling optimization but every time i use them they're zero'd out. I'm building the quadtree on construction of my scene before the first update so the only thing i could think of is that the boundingboxes are only calculated when the space is updated, is this true? If it is, would there be a way to force the entity to calculate the boundingbox before the first update is called?

Thanks

Re: When are BoundingBox calculated? or How to force them to

Posted: Wed Feb 12, 2014 5:42 pm
by Norbo
I'm building the quadtree on construction of my scene before the first update so the only thing i could think of is that the boundingboxes are only calculated when the space is updated, is this true?
Yup.
If it is, would there be a way to force the entity to calculate the boundingbox before the first update is called?
Yup: Entity.CollisionInformation.UpdateBoundingBox().

Re: When are BoundingBox calculated? or How to force them to

Posted: Wed Feb 12, 2014 5:55 pm
by invadrzim
well that was...embarrassingly obvious :lol:

Thanks Norbo