[ODE] Interfacing ODE and VB.net via a DLL

Dan Dixon dan at saturnc.com
Wed Jul 31 23:21:02 2002


I have been trying to get ODE and VB.net to work together over the last
several days...

I have been able to get ODE to compile as a DLL thanks to Nate Waddoups,
and VB.net recognizes and works with it on a basic level...

I can create a world, space, contact group, make a box, place it in the
scene, and then read the location of the box from the scene, but then as
soon as I call dWorldstep and then look again at the location of the
box, it's XYZ goes from 5,4,3 to 0,NAN(Not a number),0 .

Here's the relevant ODE code that is called, it's based on the code
included in "test_boxstack.cpp"...


        World = dWorldCreate()
        Space = dHashSpaceCreate()
        ContactGroup = dJointGroupCreate(0)
        dWorldSetGravity(World, 0, 0, -0.5)
        dWorldSetCFM(World, 0.00001)
        dCreatePlane(Space, 0, 0, 1, 0)

        BodyID = dBodyCreate(World)

        dBodySetPosition(BodyID, 5, 4, 3)

        Dim m As dMassType

        dMassSetBox(m, Density, 1, 1, 1)

        GeomID = dCreateBox(Space, sides(0), sides(1), sides(2))

        dGeomSetBody(GeomID, BodyID)


        dBodySetMass(BodyID, m)

        [ Code that calls dBodyGetPosition(BodyID)  -  Returns  5, 4, 3
]

        dWorldStep(World, 0.05)

        [ Code that calls dBodyGetPosition(BodyID)  -  Returns  0, NAN ,
0 ]


Am I missing something that would cause dWorldStep to do this?  Any
thoughts?   Anybody ever tried to get ODE and VB.net to work together?

Thanks...

Dan Dixon