Character Movement with OgreBullet

Daerst

16-05-2008 20:22:52

Hi there,

I've been playing around with OgreBullet for some hours trying to get a basic character movement. I orientated myself by the OgreODE walking character tutorial, but I had problems keeping the sphere at the bottom from rolling. A search in the forums told me that (Ogre)Bullet doesn't support friction on spheres - is that correct? Setting the linear velocity to Vector3::ZERO didn't help either.

Next I tried to just take a cube and move it with setLinearVelocity, but it slingers on the surface. Is stoppable though ;)

My next approach would be taking a look at the WheeledRigidBody that was used in the VehicleDemo. Is there a possibility to fully stop the body when the key is released? I don't want my character to slide all the way over the map :P

What would be the best way to realise such a character movement? I'd need movement (also diagonal so for example forward-right and forward-left), sidestrafing, sliding along walls, jumping... All this stuff. I would appreciate any hint about what basic approach to use :)

Thank you
Daerst

robtherich

16-05-2008 20:55:52

have you checked out the character controller demo that comes with bullet? believe it was added in a fairly recent version.

there is also talk on the bullet forum of updating that demo, so you might want to check out that topic.

Daerst

16-05-2008 22:00:25

Hi robtherich,

up to now I didn't take a look at any of the Bullet demos (thought they wouldn't help me anyway :P) but I'll do that, thank you.

I tried to compile the demo, but I always get tons of GL related linker errors...

..\..\out\debug8\build\appCharacterDemo\Demos\CharacterDemo\CharacterDemo.o||In function `ZN13CharacterDemo20clientMoveAndDisplayEv':|
D:\OgreSDK\ogrebullet\bullet-2.68\Demos\CharacterDemo\CharacterDemo.cpp|321|undefined reference to `glClear@4'|
D:\OgreSDK\ogrebullet\bullet-2.68\Demos\CharacterDemo\CharacterDemo.cpp|386|undefined reference to `glFlush@0'|
..\..\out\debug8\build\appCharacterDemo\Demos\CharacterDemo\CharacterDemo.o||In function `ZN13CharacterDemo15displayCallbackEv':|
D:\OgreSDK\ogrebullet\bullet-2.68\Demos\CharacterDemo\CharacterDemo.cpp|395|undefined reference to `glClear@4'|
D:\OgreSDK\ogrebullet\bullet-2.68\Demos\CharacterDemo\CharacterDemo.cpp|400|undefined reference to `glFlush@0'|

and so on... Seems strange to me, because glut32.lib is linked. I even tried linking my own Glut/Glu/GL libs from MinGW, but without success...

For that matter, I'm a Code::Blocks & MinGW user and this isn't supported by the Bullet demos very well - I feel discriminated :roll:. The libs compiled all well.

Whatever, maybe I can get the point by looking at the code without having seen the binary :D

Thanks
Daerst