Kinematic Objects?

Eltharyon
Posts: 13
Joined: Wed Jun 07, 2006 12:55 pm

Kinematic Objects?

Post by Eltharyon »

Hi again,

my use of bullet continues and so do my questions.

I've been experimenting with animated objects, that is to say an object (like a character) which is moving without regard for physics, but objects in its way are pushed away appropriately.

I'd very much like these states to be switchable. I'm currently using the following approach:

While the object is animated it is set to be static (CollisionObject::isStatic flag), but when it is switched to physics activated the static flag is removed. I am "animating" the object by directly writing to the motion state. In order to prevent objects from failing to collide I'm activating it when changing states.

This approach currently produces reasonable results (at least in the demo I was making), but I am wondering whether there is a different way of dealing with animations. Am I missing something? Bullet is very neat in that it is very flexible, but I sometimes get lost in the source code ;)

Cheers,

Robin
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

What is your issue exactly? There is build-in support for kinematic/static objects that are moved by the user. The angular/linear velocity is automatically calculated, see

Code: Select all

bool		CcdPhysicsController::SynchronizeMotionStates(float time)
However, this doesn't prevent things like a character control pushing through dynamic objects, because the kinematic objects has 'infinite mass'.
Bullet is very neat in that it is very flexible, but I sometimes get lost in the source code
Indeed, it would be good to cleanup some code, especially the CcdPhysicsEnvironment and the sample code. Can you point to locations that are most urgently needing cleanup?

Do you have a stripped version of your terrain code, that can be included in Bullet?

Thanks,
Erwin
Eltharyon
Posts: 13
Joined: Wed Jun 07, 2006 12:55 pm

Post by Eltharyon »

I was simply wondering whether my approach of moving kinematic objects (which I understand are simply physics objects set to be static?) by directly changing their motion state was appropriate. The animated object IS intended to knock objects down, but I didn't want it to get knocked down itself.

Do you have a stripped version of your terrain code, that can be included in Bullet?
I do, I've been intending to upload a demo including the source code for days, but I've been distracted.

Do you have a preferred way of receiving the source code? E-mail?

Robin