public bool Extend() { if (CurrentDistanceSqr >= MaxDistanceSqr) { return(false); } float moveDist = extensionData.MoveSpeed * Game.FrameTime; Vector3 translation = direction * moveDist; Matrix newMatrix = Matrix.Scaling(1.0f, 1.0f, 1.0f) * Matrix.Translation(translation) * bone.Matrix; float newDistanceSqr = Vector3.DistanceSquared(MatrixUtils.DecomposeTranslation(newMatrix), bone.OriginalTranslation); // check if the new matrix overpasses the distance limits if (newDistanceSqr > MaxDistanceSqr) { return(false); } bone.Translate(translation); return(true); }