Kinematic body

dcp
Posts: 9
Joined: Tue Jul 13, 2010 7:52 pm

Kinematic body

Post by dcp »

I am creating a body that will rotate but I do not want it to be affected by any collision. I believe that is a kinematic object. The object seems to fall when I give it a mass. I need the object to stay in place and be able to spin.

Should I set the mass to 0 and set it as a kinematic object?

I actually want it to spin and slow down over time and eventually come to a stop. How do i do this?
User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Re: Kinematic body

Post by Garibalde »

With kinematic objects the mass has to be set to 0.
Once the object is kinematic you have to control its position and orientation. so you can use a sin function with a gain
to make waht you want happen.

Angle = K(t)*sin(Wt)

K gain will be a function of time which will ramp to zero.
W is the frequency
t is the time.

Hope this helps.
dcp
Posts: 9
Joined: Tue Jul 13, 2010 7:52 pm

Re: Kinematic body

Post by dcp »

Angle = K(t)*sin(Wt)

K gain will be a function of time which will ramp to zero.
W is the frequency
t is the time.

How do I know what values to put for K, W?
Isn't there a way to just apply a rotational force to the object and let bullet do all the work while I poll for the rotation?

Sample code would be greatly appreciated.
LEgregius
Posts: 26
Joined: Tue Oct 14, 2008 1:34 am

Re: Kinematic body

Post by LEgregius »

It won't be kinematic if you want to apply a force. Actually, you would apply a torque, but you need to slow it down. You can either apply a an angular damping or have it sit on something with friction, but the latter will be harder to bend to your will :-).
dcp
Posts: 9
Joined: Tue Jul 13, 2010 7:52 pm

Re: Kinematic body

Post by dcp »

Angle = K(t)*sin(Wt)

K gain will be a function of time which will ramp to zero.
W is the frequency
t is the time.

How do I know what values to put for K, W?