maybe you remember my rotating planes issue , going back to it, in order to make an actual working maze, I haven't figured out how to do it.
There are only simple examples of CompoundShape in demos using EntityShape objects, some using convexHull shape, but nothing else in EntityConstructionDemo and CompoundBodiesDemo. In the first one, there is a lot of comments but they're not very helpful (to me).
I guess I can create a maze using something like this one (from EntityConstructionDemo):
Code: Select all
CompoundBody body = new CompoundBody(new List<CompoundShapeEntry>
{
new CompoundShapeEntry(new BoxShape(1, 1, 1), new Vector3(-7, 3, 8), 1),
new CompoundShapeEntry(new BoxShape(1, 3, 1), new Vector3(-8, 2, 8), 5),
new CompoundShapeEntry(new BoxShape(1, 1, 1), new Vector3(-9, 1, 8), 1)
}, 10);
Could you provide one/some example(s) of a concave shape made with the helpful ModelDataExtractor (this one could really be included as a utility method in BEPUutilities library) please ?
I admit I'm lack some C# knowledge to handle classes, abstract classes and inheritance for now.
ex: MobileMeshShape is an EntityShape but CompoundShapeEntry constructor doesn't allow it:
Code: Select all
Error 2 Argument 1: cannot convert from 'BEPUphysics.Entities.Prefabs.MobileMesh' to 'BEPUphysics.CollisionShapes.EntityShape'
Code: Select all
BEPUutilities.Vector3[] staticTriangleVertices;
int[] staticTriangleIndices;
ModelDataExtractor.GetVerticesAndIndicesFromModel(HandMadeMaze, out staticTriangleVertices, out staticTriangleIndices);
var staticMaze = new MobileMesh(staticTriangleVertices, staticTriangleIndices, new AffineTransform(Matrix3x3.CreateFromAxisAngle(BEPUutilities.Vector3.Up, BEPUutilities.MathHelper.Pi), new BEPUutilities.Vector3(0, -10, 0)), MobileMeshSolidity.Solid);
var compoundShape = new CompoundShape(new List<CompoundShapeEntry>
{
new CompoundShapeEntry(staticMaze, new BEPUutilities.Vector3(0, 6, 0), 1)
});