Loading FBX Models to Entity
Posted: Sun Feb 20, 2011 5:22 pm
Hey there!
I'm fairly new to physics engines, especially BEPU. It's a great engine, but I'm having some problems. I can't get my head around converting a StaticTriangleGroup/TriangleMesh into a ConvexHull/* Entity. I've looked all over and found no answers that helped. If possible, could somebody submit some code for it? This is all for learning purposes.
Current code:
Yes, it was taken from an example 
Thanks.
I'm fairly new to physics engines, especially BEPU. It's a great engine, but I'm having some problems. I can't get my head around converting a StaticTriangleGroup/TriangleMesh into a ConvexHull/* Entity. I've looked all over and found no answers that helped. If possible, could somebody submit some code for it? This is all for learning purposes.
Current code:
Code: Select all
var barrelAndPlatform = Content.Load<Model>("models/basketball");
StaticTriangleGroup.StaticTriangleGroupVertex[] staticTriangleVertices;
int[] staticTriangleIndices;
StaticTriangleGroup.GetVerticesAndIndicesFromModel(barrelAndPlatform, out staticTriangleVertices, out staticTriangleIndices);
//Note that the final 'margin' parameter is optional, but can be used to specify a collision margin on triangles in the static triangle group.
var mesh = new TriangleMesh(staticTriangleVertices, staticTriangleIndices, 0);
var fishDepositoryGroup = new StaticTriangleGroup(mesh);
space.Add(fishDepositoryGroup);
ModelDrawer.Add(mesh);
//Here I want to convert it into a non-static entity for physics handling

Thanks.