I created an Open-Source Space Simulation toolbox, Open-SESSAME (http://spacecraft.sourceforge.net) which is used for research & education of spacecraft dynamics and controls. It also utilizes a lot of other open-source tools and libraries (such as Doxygen, math library, etc.)
There is a paper in the upcoming Space Mission Challenges in Information Technology conference (http://smc-it.jpl.nasa.gov/) that discusses it and other open-source simulation software.