Calculates the y coordinate of the spline corresponding to the x coordinate
resultToPack is a 2-dimensional array with
resultToPack[spline][derivative], where the 0th derivative is the position, 1st velocity etc...
Computes the Center of Mass location and total linear and angular momentum
about the center of mass for the subtree rooted at the specified root
Joint.