Page 1 of 1

irrBullet Character example, gravity is along X axis :(

Posted: Wed Mar 13, 2019 8:09 pm
by poljak
Hello everyone, I have a problem when I ran the Character example shipped with irrBullet the gravity seem to be set upon X axis instead of -Y :shock:
So the sydney character seem to 'fall' along the X axis and when I press Jump, she jump along X as if the gravity was set along X

I done some fixies in the irrbullet wrapper to make it compiles against bullet 2.88, does have make mistakes? If so you do you guys managed to make it work correctly?

Bonus question: how do you managed to do collisions with an FPS Camera?

Here are the changes done in the IKinematicCharacterController class

Code: Select all

void IKinematicCharacterController::setUpAxis(const irr::core::vector3df& axis)
{
    //  old: Character->setUpAxis(axis);
    Character->setUp(irrlichtToBulletVector(axis));
}
 
// ...
 
void IKinematicCharacterController::setGravity(irr::f32 gravity)
{
    //  old: Character->setGravity(gravity);
    Character->setGravity({0, gravity, 0});
}
 
// ...
 
irr::f32 IKinematicCharacterController::getGravity() const
{
    // old: Character->getGravity();
    return Character->getGravity().getY();
}
Libraries:
https://github.com/danyalzia/irrBullet
Bullet 2.88
irrlicht 1.9

Re: irrBullet Character example, gravity is along X axis :(

Posted: Sun Mar 24, 2019 11:48 am
by poljak
still not managed do make it work :(
maybe I should post it in the advanced forum?

Re: irrBullet Character example, gravity is along X axis :(

Posted: Sun Mar 24, 2019 2:52 pm
by CuteAlien
Same guys reading those forums. Just not many people around familiar with irrBullet I suppose.

Re: irrBullet Character example, gravity is along X axis :(

Posted: Sun Mar 24, 2019 9:52 pm
by polylux
I'm not too familiar with bullet, but shouldn't you rather set the correct gravity in e.g. your btDiscreteDynamicsWorld rather than for the character?

Re: irrBullet Character example, gravity is along X axis :(

Posted: Sat Mar 30, 2019 11:09 am
by poljak
The gravity is ok with the world (see image at bottom of the post, crates are failling correctly. The problem is with the character)
I did a try to set upAxis vector, get better results BUT now the capsule is now horizontal (leading a discrepancy with the sydney model) :(

character->setUpAxis(core::vector3df(0.0,1.0,0.0));

Visual result
https://prnt.sc/n5121p