Brownian dynamics simulation of rigid bodies and segmented polymer chains. Use of Cartesian rotation vectors as the generalized coordinates describing angular orientations