After viewing the ShapeProcessor from the Geometry Library, I attempted to simple pass the Shape into the Model Tag like so...
public class RigidModelProcessor : ModelProcessor
{
...
public override ModelContent Process(NodeContent input, ContentProcessorContext context)
{
//Let's Get the Model
ModelContent model = base.Process(input, context);
// Get path of the model file.
string sourcePath = Path.GetDirectoryName(input.Identity.SourceFilename);
//remove the . fbx from file
StringBuilder originalFile = new StringBuilder(input.Identity.SourceFilename);
originalFile.Replace(".fbx", string.Empty);
//create the name of the file to look for
string shapeFile = originalFile.ToString() + "_Shape.fbx";
string filePath = Path.GetFullPath(Path.Combine(sourcePath, shapeFile));
//add the shape object to the Model tag
if (File.Exists(filePath))
{
// Use content pipeline to build the asset.
NodeContent shapeNodeContent = context.BuildAndLoadAsset(new ExternalReference(filePath), null);
model.Tag = ProcessShape(shapeNodeContent, context);
}
return model;
}
public Shape ProcessShape(NodeContent input, ContentProcessorContext context)
{
...
the ProcessShape Method is the ShapeProcessor Method provided with your content pipeline example.
For some reason it is not working. It saved the Shape information in the Model Tag (at least that what I see while debugging)
But the models do not move or behave like rigid bodies.
Example Usage..
Model model = Content.Load("gameModel");
Shape modelShape = (Shape)model.tag;
var rigidBody = new RigidBody(modelShape)
{
Pose = pose,
MotionType = motionType,
};
Simulation.RigidBodies.Add(rigidBody);
Note: it works when I load a shape using your ShapeProcessor, Content.Load as the modelShape.
I'm not sure what I'm doing wrong.