overview
For my graduate-level class CIS 4620: Computer Animation, I helped develop an FK/IK editor as a Unity plugin using C++. This project's base Unity file was mostly complete, and my contribution was entirely coding the actual implementation of the FK/IK editor, then compiling it as a dynamic library to be loaded into Unity as a native plugin.
features
There were 3 primary parts to this project:
Forward Kinematics Editor
This involves computing the position and orientation of each joint in a skeleton relative to the world given the local joint transformations. To do this, I created the joint hierarchy of the character and computed each joint's transformation with respect to its parent and the world, then implemented update functions for each joint.
Inverse Kinematics Editor
This involves creating an IK chain and implementing the cyclic coordinate descent (CCD) method of determining IK.
Guided Animation Foot IK
With the FK editor done, we can apply BVH animations to the character! But on a large landscape, these animations won't look right unless the character correctly reacts to the environment. In each frame of BVH animation, I now use ray casting to get the height and normal of the terrain at the positions of the left and right feet of the character, then use IK to correctly orient the feet based on surface normal and forward direction.