Create engine.cpp

This is the two portal model implementation. The comments are in correspondence with Doxygen guidelines.