crash while using two treeloader3D with the same .mesh

Veiter

28-11-2010 20:35:22

Hello all,

we use PagedGeometry 1.1.0 for a game that contains a few aggregations of the same object.
For every aggregation (forest, group of trees and so on) a new treeloader3D is created.
Unfortunately, the game crashes every time a treeloader3D-instance is deleted and an
object attached to another treeloader3D-instance comes in the range of view. Because it is the same .mesh,
i suppose the PagedGeometry-Engine deletes ressources (impostors) that are needed
by other treeloader3D-instances.

For treeloader2D, everything works fine, but i cannot imagine that it is not possible to have
more than one treeloader3D for the same .mesh.

Has anyone the same problem or can help us?
Thank you

Veiter

13-12-2010 08:08:08

Hm, it seems that you all use the PagedGeometry-Plugin only for static worlds.
I'm a little bit suprised - but can at least one reproduce the problem?
It's quite easy: two loaders with the same mesh, and then delete one...

Thank you

Fish

13-12-2010 15:15:51

It's possible that could happen although I've never tried it. Can you clone the entity ( mEntity-clone(); )and pass it to your second TreeLoader?


- Fish

Veiter

13-12-2010 22:21:58

Yes that is possible but it crashes also ;)
I even have cloned every single mesh that is passed to the addTree-Function, but the
effect is always the same:
After destructing the first treeloader, i can walk around a little bit. The nearest trees
of the second treeloader are shown, but after a second or two there is the crash.
If i do not look at the trees of the second treeloader, everything works ...

Fish

14-12-2010 16:46:38

Do you have a stack trace?

- Fish

Veiter

14-12-2010 19:58:52

Yes, i have a little bit:

> Randwelt.exe!Forests::ImpostorBatch::setAngle(float pitchDeg=-1.9049083, float yawDeg=-17.267252) Line 285 + 0x3d bytes C++
Randwelt.exe!Forests::ImpostorPage::update() Line 171 C++
Randwelt.exe!Forests::GeometryPageManager::update(unsigned long deltaTime=16, Ogre::Vector3 & camPos={...}, Ogre::Vector3 & camSpeed={...}, bool & enableCache=true, Forests::GeometryPageManager * prevManager=0x02d5a328) Line 677 + 0x15 bytes C++
Randwelt.exe!Forests::PagedGeometry::update() Line 242 C++

Veiter

30-01-2011 18:15:08

I could not solve the problem with PagedGeometry, but avoiding the problem is actually quite simple: we just don't work with the original mesh but with a copied file for every TreeLoader. The copy is created at runtime and deleted with the TreeLoader. This works and may perhaps help any people who have the same problem.