NotImplementedException in MobileMeshShape
Posted: Mon Aug 01, 2011 3:43 am
Hi,
I'm attempting to create a tank out of a series of mobile mesh shapes (using a compound body) and I found that it was missing a few method implementations. Several methods in MobileMeshShape throw a NotImplementedException. I'm using 1.6.0.
Here is the code I am using to fill the compound body, when the tank is instanced.
However, I'm wondering if there is a better way to do this anyway. I'm using a modified version of the TankInput class from the demo application to drive the tank around, so, would it be possible to have one body (the body of the tank) as a dynamic body, and then attach the turret and other moving parts as kinematic objects? They need to respond to raycasts but only the body needs to actually be dynamic. (This is a common tactic for tanks in games as it stops the turret and other moving parts becoming a problem due to their kinematic-like behaviour)
What is my best option?
I'm attempting to create a tank out of a series of mobile mesh shapes (using a compound body) and I found that it was missing a few method implementations. Several methods in MobileMeshShape throw a NotImplementedException. I'm using 1.6.0.
Here is the code I am using to fill the compound body, when the tank is instanced.
Code: Select all
CompoundBody body;
List<CompoundShapeEntry> parts = new List<CompoundShapeEntry>();
foreach (var i in articulations)
{
var data = i.Value.part.collision_shape.Data;
MobileMeshShape mesh = new MobileMeshShape(data.Vertices, data.Indices, AffineTransform.Identity, MobileMeshSolidity.Clockwise);
parts.Add(new CompoundShapeEntry(mesh));
}
body = new CompoundBody(parts);
What is my best option?