Inverse Kinematics
Here's what I did:
- Because of a miscommunication about deadlines I was unable to complete the IK part of my proposal. I did however get a good start:
- I created a class tgIKObstacle which extended tgCharacter. This represents all three points connected by two lines (like the midterm problem). I treated the position as the part of the object that would move and the other points would be calulated from. tgIKObstacle had a method called updateIK which would be called every frame and I only got as far as calculating the location of the middle point from the position point. I was able to make this work properly, but I am certain there are only minor mathematical errors preventing this from working.
- I planned on having a sprite for the IK chain and it would have fit easilly into the framework of the my sprite animation. The class tgIKObstacleRenderer takes care of actually drawing a representation. There isn't much to show right now so I have the IK stuff turned off.
- You can download the code in the Final Submission.