Problems Redoing Basic Demo

cobolt_dink
Posts: 72
Joined: Fri Apr 04, 2008 6:07 pm

Problems Redoing Basic Demo

Post by cobolt_dink »

Trying to figure out how Bullet works so I'm trying to port the Basic Demo to DirectX. I cut and pasted the initPhysics() and exitPhysics() functions from the supplied code and also the code to convert a btTransform into D3DXMATRIX. When my box hits the plane it dances and spins around on a corner and generally rotates until its under the plane. Also if I position the box so its sitting on the plane it kind of shakes a bit. I noticed this in the real Basic Demo if I only rendered one box right on top of the plane. The only thing different I think I'm doing is this: m_dynamicsWorld->stepSimulation(1.f/60.f,0), since I have no timer function I just wanted constant time.

Also, in this piece: btStaticPlaneShape(btVector3(0,1,0),50) what is the 50 for? Maybe I missed the help section that explains what paramaters for functions are.

Just to add, my cube model is 50 units square. When I create the physics box I use 25 which works but the box comes to rest above the plane. If I take it down to one it rests on the plane but does a fine Irish jig when it gets there.
cobolt_dink
Posts: 72
Joined: Fri Apr 04, 2008 6:07 pm

Re: Problems Redoing Basic Demo

Post by cobolt_dink »

Maybe I didn't copy everything or I changed something and didn't remember it. I copied the init data again and it seems like its working now. But I do have another problem, I just drop a cube straight down and when it bounces it comes to rest on a edge instead of flat face.