Rigidity theory deals mostly with the topological computation in mechanical systems, i.e. it aims at making generic statements. Mechanism theory is mainly concerned with the geometrical analysis but again also with generic statements. Even more so for mobility analysis where one is interested in both the generic mobility and that of a particular mechanism. In rigidity theory the mathematical foundation is the topology representation using bar-joint and body-bar graphs, and the corresponding rigidity matrix. In this paper novel geometric rules for constructing the body-bar rigidity matrix are derived for general planar mechanisms comprising revolute and prismatic joints. This allows, for the first time, the treatment of general planar mechanisms with the body-bar approach. The rigidity matrix is also derived for spatial mechanisms with spherical joints. The bar-joint rigidity matrix is shown to be a special case of body-bar representation. It is shown that the rigidity matrices allow for mobility calculation as shown in the paper. This paper is aimed at supplying a unified view and as a result to enable the mechanisms community to employ the theorems and methods used in rigidity theory. An algorithm for mobility determination -The pebble game- is discussed. This algorithm always finds the correct generic mobility if the mechanism can be represented by a body-bar graph.