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

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
invadrzim
Posts: 2
Joined: Wed Feb 12, 2014 5:22 pm

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

Post 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
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

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

Post 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().
invadrzim
Posts: 2
Joined: Wed Feb 12, 2014 5:22 pm

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

Post by invadrzim »

well that was...embarrassingly obvious :lol:

Thanks Norbo
Post Reply