Because I have no experience at Irrlicht and I don't want to use code twice for the same thing, I am wondering if there is a function to retrieve the distance between two nodes of the scene or if there is a set of math functions for doing operations between matrices and/or vectors.
That only works if the two nodes happen to be children of the same scene node. The expression node1->getAbsolutePosition().getDistanceFrom(node2->getAbsolutePosition()) will avoid this limitation.