i'm trying to create a box collision on entitys that i load in. But i would like to do it dynamic. What im wondering is , if there any way to get the size of bounding box of the entity and use that info to create the box. because i know the box requires a vector3.
antarctica2007
17-02-2007 16:58:06
if its a simple enough mesh you can use ogrenewt to generate a convex hull for it
or you can use Entity->getBoundingBox()
or Entity->getBoundingRadius()
or even Node->getWorldAABB()
im sure.
im not sure whether you will have to scale these values to match the scale of the node or if it does it automagically
would these return a vector3? i've used convex hull but these are just buildings and i would rather just put a box around them and save time on load.
Ogre::AxisAlignedBox modelBoundsBox = pEntity->getBoundingBox();
Ogre::Vector3 mMaximum = modelBoundsBox.getMaximum();
Ogre::Vector3 mMinimum = modelBoundsBox.getMinimum();
Ogre::Vector3 mSize = mMaximum - mMinimum;
msize will be the exact box dimension of the bounding box, which you can use for the box collision.