setWorldSize give AV when quiting the app

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:

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?

Tubez

14-04-2007 00:00:12

Sorry, what's an AV and why is it bad?

unclepauly

14-04-2007 09:46:08

AV = Access Violation!

and its bad because it makes your app crash!

[edit]
ok, its when you get the grey-coloured message box on the screen that says something like "The memory at address 0x0000001 cannot be read/written"
[/edit]

Tubez

14-04-2007 09:49:53

Aha, access violation.
Where's i'm from we call those things segmentation faults :P