unclepauly
13-04-2007 15:56:06
for ages ive simply been setting the world size to extra big. its never been a problem, but i noticed in stunt playground Walaber uses AABB, so i used that code and its giving me problems.
old code:
new code:
i can see in my debugger that aabb minimum is 0,0,0 and maximum is 580,180, 580 (which sounds about right, the mesh is my terrain), but whenever i quit the app, i get an AV. making the maximum larger fixes the problem but this kind of defeats the point of getting the aabb in the first place.
anyone why the AV is happening? it looks like its because the world size is being set too small. if this is so, does my code look wrong?
old code:
mWorld->setWorldSize(Ogre::Vector3(0, 0, 0), Ogre::Vector3(20000, 20000, 20000));
new code:
Ogre::AxisAlignedBox aabb = col->getAABB();
aabb.merge(aabb.getMaximum() * 1.1f);
aabb.merge(aabb.getMinimum() * 1.1f);
mWorld->setWorldSize(aabb);
i can see in my debugger that aabb minimum is 0,0,0 and maximum is 580,180, 580 (which sounds about right, the mesh is my terrain), but whenever i quit the app, i get an AV. making the maximum larger fixes the problem but this kind of defeats the point of getting the aabb in the first place.
anyone why the AV is happening? it looks like its because the world size is being set too small. if this is so, does my code look wrong?