I am kind of new using bullet and I am trying to create a 8 ball pool game with it.
It was pretty hard for me to find a good configuration for friction, gravity and etc.. that would look familiar to a pool game.
My selection was :
Code: Select all
// Global physics parameters
#define PHYS_GLOBAL_SCALE_FACTOR (10.0f)
#define PHYS_SCALED(x) ((x) * PHYS_GLOBAL_SCALE_FACTOR)
#define PHYS_CONTACT_BREAK_THRESH (PHYS_SCALED(0.02f) * 0.1f)
#define PHYS_GRAVITY_Y_AXIS_SI PHYS_SCALED(-9.8f)
// Balls
#define PHYS_BALL_MASS (0.170f)
#define PHYS_BALL_RADIUS PHYS_SCALED(0.029f)
#define PHYS_BALL_FRICTION (0.2f)
#define PHYS_BALL_ROLL_FRICTION (0.1f)
#define PHYS_BALL_RESTITUTION (0.9f)
#define PHYS_BALL_LIN_DAMPING (0.0f)
#define PHYS_BALL_ANG_DAMPING (0.8f)
#define PHYS_BALL_LIN_SLEEP_THRESH (0.1f)
#define PHYS_BALL_ANG_SLEEP_THRESH (0.1f)
// Table floor
#define PHYS_FLOOR_FRICTION (0.3f)
#define PHYS_FLOOR_ROLL_FRICTION (0.1f)
When I try to apply an impulse to the center of mass of a sphere, this ball does not describe a straight line as a path, instead of it, the ball describes a path thats looks more like a curve of an exponential function.
eg : ball_rb->applyCentralImpulse(btVector3(1.5f,0.0f, 0.5f));
Describes:
Instead of :
I am also attaching my modified version of "RollingFrictionDemo" (I just edited the RollingFrictionDemo.cpp) to show my problem. Run the main and the ball will move after 2 seconds.
Any solutions?
Kind Regards, Rodrigo Ney.