B_old wrote:Hi,
I found my problem.
For static stuff it seems to be important, that you don't forget, to call btTransform::setIdentity() before you set the origin ect.. I just assumed btTransform would be constructed as being identity.
Just like the C/C++ built-in types like float and int, the math classes btScalar, btVector3, btTransform needs to be initialized before usage. I can put asserts in the operators in debug mode, to easily detect uninitialized data, or put it in the documentation (or both).
I drop a box straight down on a static plane (a)/big static box (b).
In case a) the box just falls down bounces upwards a little bit and everything looks normal.
In case b) the box falls down and bounces around a little more also having some spin to it.
So although you might expect the same behaviour in both cases, this is not the case (not that dramatic either though...).
My fault?
Single Convex Collision Objects should be moderately sized. Using the default settings, none of the objects should be larger then say 40 units, or smaller then 0.2 units. The btPlaneShape tesselated the ground into triangles on-the-fly, by projecting objects onto the plane.
getOpenGLSubMatrix(), what is so OpenGL about this?
I use this matrix as it is, rendering with D3D. That is, neither do I transpose the matrix nor invert any axis. (Although I believe I had to do that when I used the finished transformation matrix, which I rather calculate myself now)
The btTransform::getOpenGLMatrix(..) returns a matrix that is compatible with OpenGL. Referring to this well documented and multiplatform graphics API should help developers synchronize the physics worldtransform with the graphics worldtransform. If you use another API, you can find out how the memory layout of the matrix differs from OpenGL, or just convert the Bullet transform element by element.
Thanks for your feedback. This will all be added to the documentation (work in progress, see the Bullet TODO topic).