Not sure what's going on here. These are the relevant slices of code that I know affect jumping behavior:
Am I missing something? Basically, my density and gravity are set to 1.0 and my impulse is 1/4 of the gravity (but in opposite direction of course). This makes my player jump about 5x his height but the up/down time is about 4 seconds. I want that to be quicker...about 1-2 seconds.
Any ideas?
Code:
#define kWorldGravity -1.0
#define kJumpImpulse -.25*kWorldGravity
.....
b2Vec2 gravity;
gravity.Set(0.0f, kWorldGravity);
boxWorld = new b2World(gravity, doSleep);
.....
fixtureDef.density = 1.0f;
boxBody->CreateFixture(&fixtureDef);
.....
boxBody->ApplyImpulse(b2Vec2(0.0,kJumpImpulse), boxBody->GetWorldCenter());
#define kJumpImpulse -.25*kWorldGravity
.....
b2Vec2 gravity;
gravity.Set(0.0f, kWorldGravity);
boxWorld = new b2World(gravity, doSleep);
.....
fixtureDef.density = 1.0f;
boxBody->CreateFixture(&fixtureDef);
.....
boxBody->ApplyImpulse(b2Vec2(0.0,kJumpImpulse), boxBody->GetWorldCenter());
Am I missing something? Basically, my density and gravity are set to 1.0 and my impulse is 1/4 of the gravity (but in opposite direction of course). This makes my player jump about 5x his height but the up/down time is about 4 seconds. I want that to be quicker...about 1-2 seconds.
Any ideas?