Bullet Debug behaviour differs completely from Release

EnlightenedOne
Posts: 37
Joined: Wed Sep 08, 2010 2:57 pm

Bullet Debug behaviour differs completely from Release

Post by EnlightenedOne »

Hi there I am in over my head trying to solve a problem relating to Bullet,

I have just linked my entire application together for a release build and every component except bullet is exhibiting identical behaviour to the behaviour seen in debug compilation. I am in Visual Studio 2010 with DX9. I have a rewritten world importer but other than that my code is pretty standard.

Basically in my worlds all of the rigidbodies do not appear where they should be or in the case of raycast vehicles appear where they should be at unexplainable angles which have no correlation to their intended rotational angle. Collisions can happen because when objects appear they can collide with objects on a different axial alignment to the one they collide with in the debug compilation. On tryng to debug the runtime for the release I can see a great deal of objects but I cannot resolve the pointers to collision shapes held by my class which holds a pointer to rigid body data so it can get the transforms. Is it even plausible for a release application to fail to link together properly and execute code ignoring values which are not readable? When I try to view the code for my rididbody's in pointer form I get "pBTColObject CXX0017: Error: symbol "" not found" Which I presume is a way of saying the compiler is failing hard at viewing the object. All the data I can visibly see coming out of the object such as transformation data going to the rendering process is massive undeclared values as if the object does not exist but is silently going along with the charade. The world importer is certainly keeping tabs on the data but my pointer "pBTColShape = pbtAllFileLoader->getCollisionShapeByIndex(x)" does not appear to get the data.

Any clues where to start with this sort of an error? Could some bullet compiler definition be confusing which direction the world is facing in the physics engine? The idea of the alignment between graphics and physics being wrong in a release compile scares me far more than all my rigid bodies silently not existing.

How can the data from the debug differ from the data in the release with optimisations disabled?, the only thing being changed is floating points which are at fast instead of precise.
Physics.jpg
The only small shred of hope is that when the cars get auto reset by my car flipper they reset with up in the right direction. Hopefully I am making some textbook compilation error someone can pick up on in release compilation... anyone got any ideas?
You do not have the required permissions to view the files attached to this post.
Kanttori
Posts: 38
Joined: Thu Jul 08, 2010 12:52 am

Re: Bullet Debug behaviour differs completely from Release

Post by Kanttori »

Just guessing, I'm not a VS or DX guru:
If you've compiled both release and debug bullet also, any chance you'd have BT_USE_DOUBLE_PRECISION in one and not the other? You might be casting pointers and using doubles as floats or vice versa.

If you've compiled a release version you wouldn't normally expect to be able to debug it, you'd have to enable debug symbols somehow for the release version too (will get you a lot of variables "optimized out" but you should see something at least).
EnlightenedOne
Posts: 37
Joined: Wed Sep 08, 2010 2:57 pm

Re: Bullet Debug behaviour differs completely from Release

Post by EnlightenedOne »

Optimisations are disabled, I enabled the symbols to show data in debug format and found I had been a fool in all class declarations I had set all values explictly however in updating the graphics matricies with physics matrix information I had declared temporary intermediates without defining their values. I had never known that all values were set to zero for me by the compiler but had known of the practice of setting all values to defaults in classes and general before their use.. stupid coder error++.

As a benefit from your advice I have started making headway I already have every object consistently spawning in the right place so that is something :) I need to run through all my classes and check for this bad behaviour, I will never make this mistake again!
britney12
Posts: 1
Joined: Fri Jul 22, 2011 9:55 am

Re: Bullet Debug behaviour differs completely from Release

Post by britney12 »

This almost always means there's a bug in your code that MSDEV in debug
mode lets you get away with Texas Hold Em Tex. Usually you're trashing the heap or the
stack or free/deleting something twice or overwriting a buffer....
Last edited by britney12 on Wed May 22, 2013 9:02 am, edited 2 times in total.
EnlightenedOne
Posts: 37
Joined: Wed Sep 08, 2010 2:57 pm

Re: Bullet Debug behaviour differs completely from Release

Post by EnlightenedOne »

You are entirely correct, this was solved a long time ago the project was completed and now I am working on getting bullet physics going on the iOS for an App :)

All my freeing/deleting code is in Macros that check the data exists before allowing it to be deleted/freed, and deleting data that is not there causes an exception in all cases I can think of. I believe the issue was as I stated before just a matter of using an object I had defined but not set to identity. The matrix for the object therefore had not been multiplied correctly when added to the world and therefore all orientation was mute.