Serialising mesh shapes

Ajare

27-11-2006 17:59:00

I'm currently using a meshShape to act as my world geometry's collision object. The problem is that creating meshShapes is very slow when the mesh has tens of thousands of polies, presumably because it's building spatial storage structures. Is there any way to serialise this structure for quick loading, because the load time hit is really not acceptable.

Or is there a better way to go about this?

[I'm using nxOgre 0.5 Spoon, with PhysX 2.3.1]

Ridhan

27-11-2006 18:07:45

You really should use the 0.4 RC2 (this is the lastest, not 0.5. It's confusing, I know).
In 0.4, you can cook your meshes for faster loads.
First you write:

new meshShape("myMesh.mesh", myScene, params<cooking>("save:yes"));


And it will create a "myMesh.nxs"

Then you can replace your code for
new meshShape("myMesh.nxs")


And that's it.

Code slighty adjusted by Betajaen

Ajare

27-11-2006 20:01:49

Thanks, that looks like it should do the trick.