• Home
  • Products
    • Game Engine
      • Base
      • Mathematics
      • Geometry
      • Physics
      • Particles
      • Animation
      • Graphics
      • Game
      • Game UI
    • Windows Forms
      • Docking Windows
      • Text Editor Control
  • Downloads
  • Buy
    • Overview
    • Professional
    • Indie
    • Non-Commercial
  • Support
    • Overview
    • Blog
    • Forum
    • License FAQ
    • Documentation
  • About
    • About Us
      • Services
    • Contact Us
    • Press
    • Legal Terms
      • Imprint (English)
      • Imprint (German)
Select the search type
 
  • Site
  • Web
Search
DigitalRune.com
Login |Register
NEWS News RSS Feed BLOG Blog RSS Feed FORUM News RSS Feed DOCUMENTATION DigitalRune Software on YouTube DigitalRune Software on Twitter
You are here: SupportForum

If you want to contribute to the forum discussions, please Register or Login.

SearchHome
  • 1
  • 2
  • 3
  • 4
  • 5
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineWorking with the Content PipelineWorking with the Content Pipeline
Previous
 
Next
New Post
12/13/2011 7:27 PM
 
Nelxon
No Ranking

www.nelxon.com
Joined: 12/3/2010
Posts: 29
Working with the Content Pipeline  Modified By Nelxon  on 12/15/2011 5:22:18 PM

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. 




Nelxon! ::.. Artist, Animator, Programmer, Game Developer..::
 
New Post
12/14/2011 10:07 AM
 
MartinG
7th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 446
Re: Working with the Content Pipeline 

I just tried to reproduce your problem - I copied your code for the RigidModelProcessor and added the methods from the ShapeProcessor. But I don't see any problems. It works fine here.

If it works when using the ShapeProcessor, I don't see any reason why it should not work using your RigidModelProcessor.

One thing you could check: The Content project needs to reference DigitalRune.Mathematics.Content.Pipeline.dll and DigitalRune.Geometry.Content.Pipeline.dll. (But if these references were missing, you should actually get an error when building the content project or at least an exception at runtime.)

Other than that, I currently have no idea why it is not working in your project.

If the problem persists, you send us a stripped down version of the project for debugging. (office@digitalrune.com)

 
New Post
12/14/2011 12:19 PM
 
Nelxon
No Ranking

www.nelxon.com
Joined: 12/3/2010
Posts: 29
Re: Working with the Content Pipeline 

All of the references are included, it may have something to do with my entity class,
I will do a few more tests to pinpoint the problem, Thanks.

My second question is could you extend the ShapeProcessor  and add LoadCapsule, LoadCylinder and LoadCone
- and any more if you think they would be useful in the future...


These shapes exists in the Geometry library , so I figured you already have a solution.

Currently I am converting Capsule, Cylinders and Cones into ConvexPolyhedron shapes from the Processor, 
but I don't know if that effects performance. 

 this would really be helpful.


Nelxon! ::.. Artist, Animator, Programmer, Game Developer..::
 
New Post
12/14/2011 4:31 PM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Working with the Content Pipeline 

We have left these shapes as an exercise for our users ;-) 
(Nevertheless, I have added it to our todo list.)

If the ConvexPolyhedron consists of many points, it requires more memory and should be slower than the capsule/cylinder/cone. Although, in certain convex-convex tests it could also be fasters because it has more flat faces (which let any iterative algorithms converge faster). And rigid bodies come to rest faster because of the flat faces... *sigh*...real world performance predictions are never easy.

I think it should not be too difficult to add these shapes: Simply add all mesh points to an AABB (as in LoadBox). Then you can derive the capsule/cylinder heights and radii from the AABB extents.

 

 

 
New Post
12/14/2011 6:12 PM
 
Nelxon
No Ranking

www.nelxon.com
Joined: 12/3/2010
Posts: 29
Re: Working with the Content Pipeline 
HelmutG wrote:

 Simply add all mesh points to an AABB (as in LoadBox). Then you can derive the capsule/cylinder heights and radii from the AABB extents.

 Thanks, I just needed to be pointed in the right direction.


FYI, It would be nice to have a showcase area in the forums, I would love to see what other users are doing with with this software. :)


Nelxon! ::.. Artist, Animator, Programmer, Game Developer..::
 
New Post
12/15/2011 4:19 PM
 
Nelxon
No Ranking

www.nelxon.com
Joined: 12/3/2010
Posts: 29
Re: Working with the Content Pipeline  Modified By Nelxon  on 12/15/2011 5:20:02 PM

I solved the content pipeline issue.

After viewing the Shapes with DebugDrawer, I noticed the scale in the content pipeline wasn't working so I called base.Process after the ProcessShape call and it worked perfectly. Thanks again for your help. :)



Nelxon! ::.. Artist, Animator, Programmer, Game Developer..::
 
New Post
12/19/2011 1:46 PM
 
MartinG
7th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 446
Re: Working with the Content Pipeline 
Nelxon wrote:

FYI, It would be nice to have a showcase area in the forums, I would love to see what other users are doing with with this software. :)

I have started a sticky thread: Showcase

 
 Page 1 of 1
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineWorking with the Content PipelineWorking with the Content Pipeline


DigitalRune is a trademark of Garstenauer Information Technology OG.

Garstenauer Information Technology OG
Weingartenstrasse 35, 4452 Ternberg
Austria (EUROPE)
office@digitalrune.com

Home Products Downloads Buy Support About Us
Game Engine Particles Windows Forms Professional Blog Services
Base Animation Docking Windows Indie Forum Contact Us
Mathematics Graphics Text Editor Control Non-Commercial License FAQ Press (News)
Geometry Game Documentation Legal Terms
Physics Game UI Imprint
Impressum
Copyright © 2006-2012 Garstenauer Information Technology OG Terms Of UsePrivacy Statement