Twichy cone, capsule, cylinder, weird sphere

Xilliah
Posts: 5
Joined: Fri Apr 18, 2008 11:20 am

Twichy cone, capsule, cylinder, weird sphere

Post by Xilliah »

Yo mates!

Bullet physics is working out great for me. But earlier this week I tried adding some spheres, cones, capsules and cylinders to my scene, and WOOP all kinds of weird stuff happens that I simply can't explain.

I wasted 2 days on this problem:
1. Body with either a cone, cylinder or capsule 'twitches'. Means: The rotation constantly changes a little bit, eventhough nothing is touching it etc.
2. Body with sphere works just fine, but it only wants to roll over one local axis. If you push it from the 'side' it won't just roll, it will turn in that direction and then roll 'forwards'.

Init code:

Code: Select all

	collisionConfiguration = new btDefaultCollisionConfiguration();

	dispatcher = new btCollisionDispatcher(collisionConfiguration);

	btVector3 worldAabbMin(-10000,-10000,-10000);
	btVector3 worldAabbMax(10000,10000,1000);
	int	maxProxies = 1024;
	overlappingPairCache = new btAxisSweep3(worldAabbMin,worldAabbMax,maxProxies);

	solver = new btSequentialImpulseConstraintSolver;
	
	dWorld = new btDiscreteDynamicsWorld(dispatcher,overlappingPairCache,solver,collisionConfiguration);
	
	dWorld->setGravity(btVector3(0, 0, -9.8f));
Code that manages physical side of an Entity: http://codepad.org/9MSNzuAN
Weird stuff explained: Collision bodies are not deleted after removal because it didn't matter so far. Entities named "Sickle Pellet" get some special treatment in 'LoadShapes()' because I wanted to see it wasn't a serialization problem.

Minor problem: Updating a child transformation in a compound shape really inspires a crash unless you turn off the dynamic tree thingie.

Thanks upfront for anyone willing to help this poor, God forsaken soul.