This project is read-only.

Problems with MeshShapeData

Topics: User Forum
Dec 27, 2006 at 3:36 PM
Thanks for the excellent library it has been really straight forward using the API.

I have successfully modified the xna content creation pipeline to give read access to the vertex and index buffers for my level geometry that I wanted to use to create a MeshShapeData object to use as static solid in the physics simulation.

I am having problems however with the collision not responding between the static mesh and a non static solid created with a SphereShapeData and can not track down the issue. I made sure the contact groups were set up (even after trying the default groups) and that the information in the vertex buffers and index buffers are correct.

Since my level geometry in this case is a cylinder (or hollow tube) with the sphere inside it I was wondering if there was any issues with curves and collision detection that was causing problems. My next step will be try much simpler level meshes to rule this out.

If it helps I will be happy to post my source code somewhere appropriate. Also look forward to the meshShapeData tutorial (are there any other relevent samples I can see?)

Dec 27, 2006 at 3:57 PM
I just tried it with a basic large box as my static level geometry and a non-static sphere solid and just got this exception:

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
at Tao.Ode.Ode.dCollide(IntPtr o1, IntPtr o2, Int32 flags, dContactGeom[] contacts, Int32 skip)
at XnaDevRu.Physics.Ode.OdeHelper.CollisionCallback(IntPtr data, dGeomID o0, dGeomID o1) in C:\Documents and Settings\User\Desktop\xnadevru\XnaDevRu.Physics\XnaDevRu.Physics.Ode\OdeHelper.cs:line 174
at XnaDevRu.Physics.Ode.OdeHelper.CollisionCallbackRunner(IntPtr data, IntPtr o0, IntPtr o1) in C:\Documents and Settings\User\Desktop\xnadevru\XnaDevRu.Physics\XnaDevRu.Physics.Ode\OdeHelper.cs:line 14
at Tao.Ode.Ode.dSpaceCollide(IntPtr space, IntPtr data, dNearCallback callback)
at XnaDevRu.Physics.Ode.OdeSimulator.StepPhysics() in C:\Documents and Settings\User\Desktop\xnadevru\XnaDevRu.Physics\XnaDevRu.Physics.Ode\OdeSimulator.cs:line 371
at XnaDevRu.Physics.Simulator.Simulate(Single dt) in C:\Documents and Settings\User\Desktop\xnadevru\XnaDevRu.Physics\XnaDevRu.Physics\Simulator.cs:line 161
at WindowsGame1.Game1.Update(GameTime gameTime) in C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\Copy of WindowsGame1\WindowsGame1\Game1.cs:line 176
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.Run()
at WindowsGame1.Program.Main(String[] args) in C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\Copy of WindowsGame1\WindowsGame1\Program.cs:line 14

Any ideas what could cause that?
Dec 27, 2006 at 7:48 PM
How you can see from the exception it's Ode problem... we have found many issues that are hard to determine without able to debug Ode so we started to work on Bullet. Mesh collisions is known issue. Ode will not be supported in future versions...