Creating a Chain with XPA

Topics: User Forum
May 14, 2007 at 12:13 PM
I've just started using XPA and I'm trying to create a chain entity using a series of Shapes joined with hinges. It's sort of working but after a few seconds the application crashes. The crash is hard to debug; it only happens when running without debugging and when I try and break the execution or attach an external debugger, I get a message box saying "can't break execution". Here's how I'm building the rope - does anything look especially out of place with this method? Is there a better way to do this? The code below adds a new "link" to the existing chain. The chain starts out life with a single root shape connected to the world.

Thanks,
Vance

 public void AddLink()
        {
            //Calculate the next link position
            next_link_position.Y -= 2.0f;
 
            //Create the link
            Solid chain_link = game.PhysicsSimulator.CreateSolid();
            chain_link.Position = next_link_position;
            CapsuleShapeData capsule_data = new CapsuleShapeData();
            capsule_data.Length = 0.5f;
            chain_link.AddShape(capsule_data);
 
            links.Add(chain_link);
 
            //Connect the links
            Joint joint = game.PhysicsSimulator.CreateJoint();
            JointData joint_data = new JointData();
            joint_data.Type = JointType.Hinge;
            joint_data.Solid0 = links[links.Count-2];
            joint_data.Solid1 = links[links.Count-1];
            joint_data.Axis[0].Direction = new Vector3(1.0f, 0.0f, 0.0f);
            joint.Init(joint_data);
 
            joints.Add(joint);
 
            //Rebuild the vertex buffer for chain rendering
            //BuildChainVertexBuffer();
        }
Coordinator
May 15, 2007 at 10:00 AM
There's a lot of bugs which are hard to debug and impossible to fix. It's due to unmanaged code usage.
Sometimes changing ode.dll helps...
May 15, 2007 at 12:16 PM

KleMiX wrote:
There's a lot of bugs which are hard to debug and impossible to fix. It's due to unmanaged code usage.
Sometimes changing ode.dll helps...


I'll try recompiling ODE and debugging from there - Is there any specific version of ODE that XPA is targeting at the moment?

-Vance
Coordinator
May 16, 2007 at 10:18 AM
XPA uses Tao bindings for ODE, so I guess you need ODE that's being used in Tao
May 16, 2007 at 12:10 PM
I built the latest ODE svn and debugged the DLL from VS 2005 Professional. The application still locks up, but for whatever reason, when the application stops responding, so does Visual Studio. You can't force a break - it just becomes unresponsive. I'll look into it more today.

-Vance
Developer
Sep 25, 2007 at 10:16 PM
I'm also experiencing some some very strange behavior as soon as I start using joints. Have anybody found any bugs in this area? Is this a ODE problem, a TAO problem or a XPA problem? And in case of the latter, are these issues going to be adressed in the near future?