IrrBullet Rigid body Character

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Jenerik Industries
Posts: 1
Joined: Wed Jul 17, 2013 2:28 pm

IrrBullet Rigid body Character

Post by Jenerik Industries »

Hi I'm new here so sorry if I'm posting in the wrong section. I've been trying to make an MOG (Multiplayer Online Game) with Irrlicht and IrrBullet and everything works great except the character physics. Currently I'm using a Kinematic Character Controller for the player's character and I've been trying to use it for the other players too but it makes the model shake occasionally when walking and doesn't collide with the other characters. I tried using the translate method of the Rigid Body, but that only stops the shaking, and makes it only collide with the ground, not the walls. Any other method of movement such as setLinearVelocity does not work at all. Is there any way I can get my characters to move right?
MrGuy
Posts: 18
Joined: Mon Oct 29, 2012 11:05 pm

Re: IrrBullet Rigid body Character

Post by MrGuy »

Mhm. I made one some time ago for a quick-and-dirty-test. I needed some properties of a RigidBodyControl so i made one, but it aint good code or anything like comfortable using. But it was patched together in a matter of minutes and maybe you find some inspiration in it? :)

Header:
http://pastebin.com/jdPyYDFG

cpp-File:
http://pastebin.com/C7QA97h0



But be warned, rly. Its NO CLEAN CODE. It was a quick-'n-dirty testing thing and only meant for inspiration.
Even tho it kinda works like a charme for what i needed it for. ( Movement through a voxel generated world (smooth, no blocks) with some feedback etc implemented in the collisonlisteners. Not implemented in that one here, tho. )
Otaka
Posts: 17
Joined: Fri Nov 16, 2012 1:47 pm

Re: IrrBullet Rigid body Character

Post by Otaka »

Fast "hack" that works for me-

Code: Select all

 
btVector3 vector(position.X, position.Y, position.Z);
btMotionState*mste=rigidBody->getMotionState();
btTransform tr; 
tr=rigidBody->getWorldTransform();
tr.setOrigin(vector);
rigidBody->setWorldTransform(tr);
mste->getWorldTransform(tr);
tr.setOrigin(vector);
mste->setWorldTransform(tr);
 
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: IrrBullet Rigid body Character

Post by thanhle »

Can someone repost MrGuy example please.

Thanks
Thanh
GameDude
Posts: 498
Joined: Thu May 24, 2007 12:24 am

Re: IrrBullet Rigid body Character

Post by GameDude »

Cool "hack", just recently came across this post.
Post Reply