Weird collision response when things collide slowly

Post Reply
piku
Posts: 3
Joined: Thu Feb 16, 2012 2:54 pm

Weird collision response when things collide slowly

Post by piku »

I'm having a bit of a strange issue when using Bullet in an iOS game I'm creating.

I have some btRigidBody objects that use btSphereShapes for collision, following one of the examples I found on the web. There is no gravity (I've set it to (0,0,0)).

To move the objects around I use setLinearVelocity() with a vector to describe the direction. Every frame I use this to set the direction and speed the objects should move in, tick the physics engine and then use getMotionState() to update my own rendering code.

Things move around the screen like I want, but collisions don't seem to work as I expect.

For example, at really slow speeds (so the player is trying to carefully steer the ship around and is barely moving) if two objects collide the response is unpredictable. Often the moving object will fly away at an insane speed that bears no relation to its speed before collision.

I suspect this is something I am doing wrong - I don't quite understand the most suitable way to make things move about, or what values I should be using. Are there any guidelines for setting weights and velocity values so that things work properly?
Post Reply