This is the original avatar motion control code.   I'm keeping it around but commented out in case I need to re-enable it to tune the the new controls to agree with what used to work.