Fixed rotation and offsets

Math changes and things to make parenting work better.