Gucman
16-01-2007 16:42:05
Hi.
I am trying to use the serializer/deserializer however I had stuck with this problem. Every time I try to serialize the CollisionTree I get the 0 bytes size file and the program crashes.
Here how I use it:
When I have already generated file with serialized treecollision everything loads properly. Only serialization fails. I am sure that there is an entity attached to node. The node is not scaled, rotated, it is just translated. Entity is in <0,0,0> position within the node. World is created properly. I am not using optimization becouse geometry is quite complex and weird things happened when I turned optimization.
Is the way I use this mechanism correct?
It happens only in release mode, in debug program don't crashes but I am ending up with 0 sized files (about half of files is that size from up to 80 files total). I build as multi threaded app. I use lib from sdk\lib_mt now but the same happend when I was using sdk\dll.
I am trying to use the serializer/deserializer however I had stuck with this problem. Every time I try to serialize the CollisionTree I get the 0 bytes size file and the program crashes.
Here how I use it:
if(ResourceGroupManager::getSingleton().resourceExists("General",Ogre::StringConverter::toString(i)+".col"))
{
tc=new OgreNewt::CollisionPrimitives::TreeCollision(mWorld);
DataStreamPtr ptr = ResourceGroupManager::getSingleton().openResource(Ogre::StringConverter::toString(i)+".col");
serializer->importTreeCollision(ptr,tc);
ptr.getPointer()->close();
}
else
{
tc=new OgreNewt::CollisionPrimitives::TreeCollision(mWorld,node,false);
serializer->exportTreeCollision(tc,"..\\data\\colldata\\"+Ogre::StringConverter::toString(i)+".col");
}
When I have already generated file with serialized treecollision everything loads properly. Only serialization fails. I am sure that there is an entity attached to node. The node is not scaled, rotated, it is just translated. Entity is in <0,0,0> position within the node. World is created properly. I am not using optimization becouse geometry is quite complex and weird things happened when I turned optimization.
Is the way I use this mechanism correct?
It happens only in release mode, in debug program don't crashes but I am ending up with 0 sized files (about half of files is that size from up to 80 files total). I build as multi threaded app. I use lib from sdk\lib_mt now but the same happend when I was using sdk\dll.