It’s not necessary for roaming ralph but for some specific circumstances that code comes in handy, for example if you have a node and you’re interested its direction vector without the pitch.
getNetTransform().getMat() returns the total transformation of a node as a matrix. getRow3(1) returns the Y axis of the transformation matrix as a vector.
backward.setZ(0)
This ‘flattens’ the vector on the Z axis so that the vector is only applicable to the XY axis