irrBullet Character example, gravity is along X axis :(

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
poljak
Posts: 9
Joined: Mon Jul 09, 2018 5:20 pm

irrBullet Character example, gravity is along X axis :(

Post 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
poljak
Posts: 9
Joined: Mon Jul 09, 2018 5:20 pm

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

Post by poljak »

still not managed do make it work :(
maybe I should post it in the advanced forum?
CuteAlien
Admin
Posts: 9652
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

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

Post by CuteAlien »

Same guys reading those forums. Just not many people around familiar with irrBullet I suppose.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

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

Post 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?
beer->setMotivationCallback(this);
poljak
Posts: 9
Joined: Mon Jul 09, 2018 5:20 pm

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

Post 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
Post Reply