NOTE: i am trying to create a collision wire frame made out of segments so that i could collide it to collision thing made out of polygons so that i can have polygon to polygon collisions.
So there’s not much point in reading a CollisionSegment out of an egg file, since it won’t be useful for the purpose you have in mind anyway. This is why we never bothered to implemented storing such a thing in an egg or bam file.
As to the segment fault, well, it’s a bug in the sense that it should have failed more gracefully than that. But that’s a very minor bug, in my mind, since it wouldn’t have done what you wanted anyway.
Oh, sorry, now that I’m re-reading your post I see that this is not what you have in mind. You want to simulate a polygon out of CollisionSegments, for the purpose of creating a “from” object.
This is technically doable, except for the fact that we don’t support CollisionSegments in egg files. You’d have to read the egg file yourself via the egg library and construct the CollisionSegments by hand.
It sounds like a terrible idea, though. The performance would be absolutely horrible.
Well this is for my star city game. It will not be real time i just need to make sure that a building does not over lap with another building - the collision routine will only run when player finishes moving or rotating the building. Buildings are relatively low poly about 150 polygons. So i think i can test 150x150 collisions of primitive per second. Maybe the egg-octreefy.egg script i made will help.
Do you have a better idea of doing polygon to polygon collisions?
Well, hmm. You can go ahead and construct the CollisionSegments yourself, either by reading the egg file, or by reading and decoding the Geom. For the purpose you describe, it might not be that bad.
Other than that, it might be time to integrate with a third-party collision library such as the one provided with ODE.