Changed it so that animation matrices are applied in local space before applying the model matrix and the parent's matrix.