HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineTriangle Mesh - Only 16 bit indices are supportedTriangle Mesh - Only 16 bit indices are supported
Previous
 
Next
New Post
2/7/2012 11:39 AM
 

Hello.

 I'm trying to load a terrain mesh as a triangle mesh, so that a character can walk over the terrain.

 I'm getting an error which states: "Only 16 bit indices are supported", while extracting the triangle mesh from the object.

 Any hints?

This is my code:

TriangleMesh tmesh = TriangleMesh.FromModel(_terrainCollisionModel); //Error in this line.
TriangleMeshShape tmeshShape = new TriangleMeshShape(tmesh);
 
tmeshShape.Partition = new AabbTree<int>();
 
// Contact welding creates smoother contact normals - but it costs a bit of performance.
tmeshShape.EnableContactWelding = true;
 
AddBody("TMesh", new Pose(new Vector3F(0, 0, 0)), tmeshShape, MotionType.Static);
 

Edit: Problem solved mesh was too big.

 
New Post
2/7/2012 12:48 PM
 

The FromModel() method assumes that the Model uses 16 bit indices and does not support 32 bit indices. You have to write your own code to extract the mesh data.

Here is a code snippet with comments that works similar to the TriangleMesh.FromModel() method: http://pastebin.com/FvmBpw9B
You can modify it to add support for 32 bit indices.

 
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineTriangle Mesh - Only 16 bit indices are supportedTriangle Mesh - Only 16 bit indices are supported