TriangleMesh Load null ptr exception

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
lazy
Posts: 26
Joined: Tue Dec 08, 2009 2:56 pm
Location: stockholm, Sweden
Contact:

TriangleMesh Load null ptr exception

Post by lazy »

Hi!

I create a TriangleMesh from 2304 vertices and 12960 indices.
I use save to stream. ( from a content writer )
When I load it( from the content reader ) using load from stream I get an null ptr exeption in BEPUphysics.dll.

I suppose Load/Save is supposed to work? What kind of errors may I have made?

I've written other data to the stream before calling save. That data looks ok when loading.

I've also tried with a smaller mesh ( 1502 vertices and 9072 indice). Same exception.

thanks!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: TriangleMesh Load null ptr exception

Post by Norbo »

Sorry about this, it looks like this known bug slipped through the cracks of v0.10.2. The fix was applied to v0.11.0 internally, but apparently it didn't make it into v0.10.2.

To verify, the stack trace says something like this, correct?
" at System.Threading.Monitor.Enter(Object obj)\r\n at BEPUphysics.DataStructures.TriangleBoundingVolumeHierarchy.reconstructHierarchy()\r\n at BEPUphysics.DataStructures.TriangleBoundingVolumeHierarchy.System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(Object sender)\r\n at ..."

I'll try to get a patch out for this quickly.
lazy
Posts: 26
Joined: Tue Dec 08, 2009 2:56 pm
Location: stockholm, Sweden
Contact:

Re: TriangleMesh Load null ptr exception

Post by lazy »

Ah I forgot to write. I'm using v0.10.1.

I'll upgrade to XNA 3.1 and v0.10.2 and try again.

thanks
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: TriangleMesh Load null ptr exception

Post by Norbo »

If it's the problem I think it is, v0.10.2 should still have the problem. I've e-mailed you a release candidate for BEPUphysics v0.10.3; give it a try to see if it solves your issue. If it does, I'll put it up for download on the site.
Post Reply