Moving controlled objects over a moving object

Post Reply
kulebril
Posts: 10
Joined: Wed Jan 16, 2013 1:36 pm

Moving controlled objects over a moving object

Post by kulebril »

Hi:

I have a btGhostController to control a ghost character.

When I put my character over another body (a box), if i move the box (using Linear Impulse), the character (who is resting in top of the box) is not carried away with it.

How can I achieve this?

thanks!
Spaddlewit
Posts: 28
Joined: Fri Sep 04, 2009 8:23 pm

Re: Moving controlled objects over a moving object

Post by Spaddlewit »

You will probably need to make your btGhostObject a btRigidBody to get what you want.

Or you could do something kludgy and perhaps shoot a ray downwards from your btGhostObject every tick, get the moving object's getLinearVelocity(), and do btGhostObject.setLinearVelocity() with the result... however that may not give the effect you desire.
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: Moving controlled objects over a moving object

Post by MaxDZ8 »

I have experimented with this with moderately (but still far from satisfactory) results.
I did maintain a list of "floors" which could move the object. A "floor transform" would be tracked and, in case of change, it would be forwarded to the resting object.
Because of time restraints, I didn't actually explore all the possibilities, I was only interested in making a kinematic move on top of another kinematic.

I'm signing this thread for notifications because I'm interested as well.
Post Reply