This article presents a framework to model and perform time domain dynamic simulations of offshore structures presenting several interconnected rigid bodies. Both fixed and 6 degree of freedom floating structures are considered. It uses a robotics formalism to parameterize the kinematic chain of the structures and is robust with respect to the number of bodies involved. Direct dynamics algorithms are given, using a consistent notation across offshore engineering and robotics fields. They use efficient recursive techniques based on Newton-Euler equations. The advantage of this framework is that tedious analytical developments are no longer needed. Instead of that, it is sufficient to provide a data parameter table as well as principal inertia parameters of each body to entirely describe the mechanical structure. An example of simulation is given, based on the 7 degree of freedom SEAREV Wave Energy Converter.