Jump problem

Champi Atomik
Posts: 4
Joined: Tue Dec 01, 2009 8:14 am

Jump problem

Post by Champi Atomik »

Hello,

I used Bullet recently to add physics in my project. I'm using Ogre3D.

I have a character controller, and I want him to hold a weapon. I created a box shape, but I don't know how to link it with the hand of the character.

I think I have to use the hand bone and a constraint ?

I also have a character controller representing the enemy, but they don't collide each other with the hero, how can I do that ? I want them to stop when they collide.

Thanks
Last edited by Champi Atomik on Sun Dec 27, 2009 2:09 am, edited 1 time in total.
Champi Atomik
Posts: 4
Joined: Tue Dec 01, 2009 8:14 am

Re: New to Bullet - 2 questions

Post by Champi Atomik »

Someone said I should use raycast, but another said I should use a physic library...

Any idea to solve my problem, linking a weapon to the hand of a character ?
lucaspcamargo
Posts: 3
Joined: Sat Dec 12, 2009 1:32 pm

Re: New to Bullet - 2 questions

Post by lucaspcamargo »

I suppose you are only using skeletal animation, and not ragdolls.

If you only need to render the sword, not test collisions with it, you should obtain the worldspace transform (or another adequate transform) from the hand bone in your 3D engine, not from bullet, and render your sword with it. If testing collisions with the sword is important, create a btGhostObject to represent the sword in bullet and update it's position every frame with that transform. Then, check what collides with the btGO every frame, too.

EDIT: Ah, I overlooked you're using Ogre. You can attach objecvts to bones in Ogre, don't kwnow the method. Search for it in the online Ogre ref.

EDIT2: See it here.
Lucas.
Champi Atomik
Posts: 4
Joined: Tue Dec 01, 2009 8:14 am

Re: Jump problem

Post by Champi Atomik »

Hello

I have another problem, using Ogre3d and Bullet.

I have a character, but when I try to use the "Jump" function, the line codes are in comments, and when I try to put them into my project, I have violated access errors during the application.

Does someone have any idea ? It seems to come from the "m_inverseMass" or something like this into the BtRigidBody.h file.

Thanks for your help.