[SOLVED] Well, it looks like all I was missing was setting a linear and angular velocity on my kinematics body. I calculated this when doing the interpolation between key frames so that each frame also has an associated velocity that is set on each simulation step. [/SOLVED]
I honestly wasn't even sure how to title this, so let me just explain what I'm trying to do.
I created a mesh with an animation in blender (Collada). I'm reading in that animation along with the mesh, interpolating between keyframes, and storing each animation frame's matrix transform in an array (so I don't have to do so dynamically during rendering). I would like to use that animation to move objects in my application. These objects need to be able to collide with a dynamic body (a btSphereShape in this case) and transfer energy to that sphere. Picture something like a pendulum that hits a ball and knocks it around. I would provide the animation for the pendulum which updates the pendulum's physics object every time the simulation is stepped. I do not want the collision to affect the pendulum's animation. It should behave as if its mass is infinite.
While I started implementing the animation system, I realized I had this problem...I am already able to move a rigid body using my animation which moves my model mesh and the physics object associated with that mesh. However, because it's a static rigid body, there is no force being applied to the ball as a result of the collision; though it does move the ball so that both objects are not occupying the same space which gives the impression that a force is being applied, but it is not.
Anyway, I have read some info on Kinematic bodies, but I'm not sure what approach to take to get the desired effect. I'm currently using a btBvhTriangleMeshShape for the rigid body. I have been using that as a catch all for loading a variety of non-basic shapes.
Any advice on which types I should be using and how to use them would be greatly appreciated.
Thanks
[Solved] Animating Kinematic Body that Interacts w/Dyn Body
-
- Posts: 1
- Joined: Sat Sep 05, 2015 11:52 pm