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!
Moving controlled objects over a moving object
-
- Posts: 28
- Joined: Fri Sep 04, 2009 8:23 pm
Re: Moving controlled objects over a moving object
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.
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.
Re: Moving controlled objects over a moving object
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.
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.