PhisX and Hight Mapping

Started by
0 comments, last by grhodes_at_work 16 years, 9 months ago
So my problem is that with PhysX you have to cook your data and it takes to long to do on the fly. I would like to have my collision data and my mesh data packed into one file what is my best option?
This is your life, and it's ending one minute at a time. - Fight club
Advertisement
I'm not going to recommend COLLADA. Hmmm, just in case you don't even know what that is...COLLADA is a standardized file format, based on XML, that can store both graphics information and physics information. And there is a way to get COLLADA info into PhysX...Ageia I believe has been heavily involved in the development of the physics side of COLLADA. But, I'm not going to recommend it because I do not believe XML should be used as a format for game runtime assets. Reading/parsing the XML is just too slow and takes too much disk space.

So, my recommended solution is to have your one file be a *.zip or *.rar archive that embeds two files. The two files within the archive will be your graphics/mesh data and the separate PhysX pre-cooked collision data. I'm not aware of any other single file solution that would not cause you a headache and time. There might be one, but I'm not aware of one....given that you're wanting to store that PhysX specific pre-cooked data. Without going this route, you might have to write your own custom binary format.

The *.zip file approach is nice because you can password protect it (even though it can be easily broken) and have fewer files to distribute. And, many graphics engines (such as Ogre and OpenSceneGraph) have built-in facilities for extracting resources directly out of zip files, e.g., you might not have to save the two embedded files to disk....just read their binary contents into memory from the *.zip and attach the binary data to a stream that you feed to Ogre/OpenSceneGraph/some other engine and to PhysX. Make sense?
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement