Index: code/branches/core7/CMakeLists.txt
===================================================================
--- code/branches/core7/CMakeLists.txt	(revision 10545)
+++ code/branches/core7/CMakeLists.txt	(revision 10547)
@@ -65,4 +65,5 @@
 SET(DEFAULT_ARCHIVE_PATH lib/static)
 SET(DEFAULT_MODULE_PATH  lib/modules)
+SET(DEFAULT_PLUGIN_PATH  lib/plugins)
 SET(DEFAULT_DOC_PATH     doc)
 SET(DEFAULT_DATA_PATH    data)
@@ -76,4 +77,5 @@
 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
 SET(CMAKE_MODULE_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_MODULE_PATH})
+SET(CMAKE_PLUGIN_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_PLUGIN_PATH})
 SET(CMAKE_DOC_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH})
 # Data directories are only inputs, no delclaration here
@@ -83,4 +85,5 @@
 # Set the extension of the dynamic modules
 SET(ORXONOX_MODULE_EXTENSION ".module")
+SET(ORXONOX_PLUGIN_EXTENSION ".plugin")
 
 # Sets where to find the external libraries like OgreMain.dll at runtime
Index: code/branches/core7/cmake/InstallConfig.cmake
===================================================================
--- code/branches/core7/cmake/InstallConfig.cmake	(revision 10545)
+++ code/branches/core7/cmake/InstallConfig.cmake	(revision 10547)
@@ -49,4 +49,5 @@
 SET(ARCHIVE_INSTALL_DIRECTORY ${DEFAULT_ARCHIVE_PATH})
 SET(MODULE_INSTALL_DIRECTORY  ${DEFAULT_MODULE_PATH})
+SET(PLUGIN_INSTALL_DIRECTORY  ${DEFAULT_PLUGIN_PATH})
 SET(DOC_INSTALL_DIRECTORY     ${DEFAULT_DOC_PATH})
 SET(DATA_INSTALL_DIRECTORY    ${DEFAULT_DATA_PATH})
@@ -61,4 +62,5 @@
     SET(ARCHIVE_INSTALL_DIRECTORY lib/games/orxonox/static)
     SET(MODULE_INSTALL_DIRECTORY  lib/games/orxonox/modules)
+    SET(PLUGIN_INSTALL_DIRECTORY  lib/games/orxonox/plugins)
     SET(DOC_INSTALL_DIRECTORY     share/doc/orxonox)
     SET(DATA_INSTALL_DIRECTORY    share/games/orxonox)
@@ -85,7 +87,8 @@
 # The RPATH to be used when installing
 IF(INSTALL_COPYABLE)
-  # Get relative paths from run to lib and from module to lib directory.
+  # Get relative paths from run to lib and from module/plugin to lib directory.
   FILE(RELATIVE_PATH _runtime_rpath "/${RUNTIME_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}")
   FILE(RELATIVE_PATH _module_rpath  "/${MODULE_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}")
+  FILE(RELATIVE_PATH _plugin_rpath  "/${PLUGIN_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}")
   # $ORIGIN (with $ escaped) refers to the actual location of the library
   # The UNIX loader recognises this special variable
@@ -93,8 +96,10 @@
   SET(LIBRARY_RPATH "\$ORIGIN")
   SET(MODULE_RPATH  "\$ORIGIN:\$ORIGIN/${_module_rpath}")
+  SET(PLUGIN_RPATH  "\$ORIGIN:\$ORIGIN/${_plugin_rpath}")
 ELSE()
   SET(RUNTIME_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIRECTORY}")
   SET(LIBRARY_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIRECTORY}")
   SET(MODULE_RPATH  "${LIBRARY_RPATH}:${CMAKE_INSTALL_PREFIX}/${MODULE_INSTALL_DIRECTORY}")
+  SET(PLUGIN_RPATH  "${LIBRARY_RPATH}:${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_DIRECTORY}")
 ENDIF()
 
Index: code/branches/core7/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/core7/cmake/tools/TargetUtilities.cmake	(revision 10545)
+++ code/branches/core7/cmake/tools/TargetUtilities.cmake	(revision 10547)
@@ -35,4 +35,7 @@
  #      NO_SOURCE_GROUPS:  Don't create msvc source groups
  #      MODULE:            For dynamic module libraries (libraries only)
+ #      PLUGIN:            For dynamic plugin libraries (libraries only)
+ #                         Plugins are a special kind of modules that can be
+ #                         loaded and unloaded during runtime on demand
  #      WIN32:             Inherited from ADD_EXECUTABLE (executables only)
  #      PCH_NO_DEFAULT:    Do not make precompiled header files default if
@@ -77,9 +80,11 @@
 
 MACRO(ORXONOX_ADD_LIBRARY _target_name)
-  TU_ADD_TARGET(${_target_name} LIBRARY "MODULE" ${ARGN})
+  SET(_additional_switches MODULE PLUGIN)
+  TU_ADD_TARGET(${_target_name} LIBRARY "${_additional_switches}" ${ARGN})
 ENDMACRO(ORXONOX_ADD_LIBRARY)
 
 MACRO(ORXONOX_ADD_EXECUTABLE _target_name)
-  TU_ADD_TARGET(${_target_name} EXECUTABLE "WIN32" ${ARGN})
+  SET(_additional_switches WIN32)
+  TU_ADD_TARGET(${_target_name} EXECUTABLE "${_additional_switches}" ${ARGN})
   
   # When using Visual Studio we want to use the output directory as working
@@ -329,7 +334,16 @@
       LIBRARY_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Unix
     )
-    ADD_MODULE(${_target_name})
+    ADD_MODULE_OR_PLUGIN(${_target_name} ${CMAKE_MODULE_OUTPUT_DIRECTORY} ${MODULE_INSTALL_DIRECTORY} ${ORXONOX_MODULE_EXTENSION})
     # Ensure that the main program depends on the module
     SET(ORXONOX_MODULES ${ORXONOX_MODULES} ${_target_name} CACHE INTERNAL "")
+  ENDIF()
+
+  # Configure plugins
+  IF (_arg_PLUGIN)
+    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES
+      RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} # Windows
+      LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} # Unix
+    )
+    ADD_MODULE_OR_PLUGIN(${_target_name} ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} ${PLUGIN_INSTALL_DIRECTORY} ${ORXONOX_PLUGIN_EXTENSION})
   ENDIF()
 
@@ -372,4 +386,6 @@
     IF(_arg_MODULE)
       SET(_rpath "${MODULE_RPATH}")
+    ELSEIF(_arg_PLUGIN)
+      SET(_rpath "${PLUGIN_RPATH}")
     ELSE()
       SET(_rpath "${LIBRARY_RPATH}")
@@ -411,4 +427,9 @@
         RUNTIME DESTINATION ${MODULE_INSTALL_DIRECTORY}
         LIBRARY DESTINATION ${MODULE_INSTALL_DIRECTORY}
+      )
+    ELSEIF(_arg_PLUGIN)
+      INSTALL(TARGETS ${_target_name}
+        RUNTIME DESTINATION ${PLUGIN_INSTALL_DIRECTORY}
+        LIBRARY DESTINATION ${PLUGIN_INSTALL_DIRECTORY}
       )
     ELSE()
@@ -428,4 +449,9 @@
             CONFIGURATIONS ${_config}
           )
+        ELSEIF(_arg_PLUGIN)
+          INSTALL(FILES ${_location_we}.pdb
+            DESTINATION ${PLUGIN_INSTALL_DIRECTORY}
+            CONFIGURATIONS ${_config}
+          )
         ELSE()
           INSTALL(FILES ${_location_we}.pdb
@@ -441,8 +467,8 @@
 
 
-# Creates a helper file with name <name_of_the_library>${ORXONOX_MODULE_EXTENSION}
-# This helps finding dynamically loadable modules at runtime
-
-FUNCTION(ADD_MODULE _target)
+# Creates a helper file with name <name_of_the_library>.<extension>
+# This helps finding dynamically loadable modules or plugins at runtime
+
+FUNCTION(ADD_MODULE_OR_PLUGIN _target _output_dir _install_dir _extension)
   # We use the properties to get the name because the librarys name may differ from
   # the target name (for example orxonox <-> liborxonox)
@@ -459,23 +485,23 @@
   IF(CMAKE_CONFIGURATION_TYPES)
     FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})
-      SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_config}/${_target_name}${ORXONOX_MODULE_EXTENSION})
-
-      FILE(WRITE ${_module_filename})
+      SET(_helper_filename ${_output_dir}/${_config}/${_target_name}${_extension})
+
+      FILE(WRITE ${_helper_filename})
 
       INSTALL(
-        FILES ${_module_filename}
-        DESTINATION ${MODULE_INSTALL_DIRECTORY}
+        FILES ${_helper_filename}
+        DESTINATION ${_install_dir}
         CONFIGURATIONS ${_config}
       )
     ENDFOREACH()
   ELSE()
-    SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_target_name}${ORXONOX_MODULE_EXTENSION})
-
-    FILE(WRITE ${_module_filename})
+    SET(_helper_filename ${_output_dir}/${_target_name}${_extension})
+
+    FILE(WRITE ${_helper_filename})
 
     INSTALL(
-      FILES ${_module_filename}
-      DESTINATION ${MODULE_INSTALL_DIRECTORY}
+      FILES ${_helper_filename}
+      DESTINATION ${_install_dir}
     )
   ENDIF()
-ENDFUNCTION(ADD_MODULE)
+ENDFUNCTION(ADD_MODULE_OR_PLUGIN)
Index: code/branches/core7/src/CMakeLists.txt
===================================================================
--- code/branches/core7/src/CMakeLists.txt	(revision 10545)
+++ code/branches/core7/src/CMakeLists.txt	(revision 10547)
@@ -39,4 +39,5 @@
 ADD_SUBDIRECTORY(orxonox)
 SET(ORXONOX_MODULES CACHE INTERNAL "")
+SET(ORXONOX_PLUGINS CACHE INTERNAL "")
 ADD_SUBDIRECTORY(modules)
 
@@ -72,5 +73,5 @@
   OUTPUT_NAME orxonox
 )
-# Main executable should depend on all modules
+# Main executable should depend on all modules (but not on plugins)
 ADD_DEPENDENCIES(orxonox-main ${ORXONOX_MODULES})
 
Index: code/branches/core7/src/SpecialConfig.h.in
===================================================================
--- code/branches/core7/src/SpecialConfig.h.in	(revision 10545)
+++ code/branches/core7/src/SpecialConfig.h.in	(revision 10547)
@@ -60,4 +60,5 @@
     const char defaultArchivePath[] = "@DEFAULT_ARCHIVE_PATH@";
     const char defaultModulePath[]  = "@DEFAULT_MODULE_PATH@";
+    const char defaultPluginPath[]  = "@DEFAULT_PLUGIN_PATH@";
     const char defaultDocPath[]     = "@DEFAULT_DOC_PATH@";
     const char defaultDataPath[]    = "@DEFAULT_DATA_PATH@";
@@ -69,4 +70,5 @@
     const char dataInstallDirectory[]       = "@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIRECTORY@";
     const char moduleInstallDirectory[]     = "@CMAKE_INSTALL_PREFIX@/@MODULE_INSTALL_DIRECTORY@";
+    const char pluginInstallDirectory[]     = "@CMAKE_INSTALL_PREFIX@/@PLUGIN_INSTALL_DIRECTORY@";
 #endif
 
@@ -76,8 +78,10 @@
 #ifdef CMAKE_CONFIGURATION_TYPES
     const char moduleDevDirectory[]         = "@CMAKE_MODULE_OUTPUT_DIRECTORY@/" CMAKE_INTDIR;
+    const char pluginDevDirectory[]         = "@CMAKE_PLUGIN_OUTPUT_DIRECTORY@/" CMAKE_INTDIR;
     const char configDevDirectory[]         = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" CMAKE_INTDIR;
     const char logDevDirectory[]            = "@CMAKE_LOG_OUTPUT_DIRECTORY@/"    CMAKE_INTDIR;
 #else
     const char moduleDevDirectory[]         = "@CMAKE_MODULE_OUTPUT_DIRECTORY@";
+    const char pluginDevDirectory[]         = "@CMAKE_PLUGIN_OUTPUT_DIRECTORY@";
     const char configDevDirectory[]         = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@";
     const char logDevDirectory[]            = "@CMAKE_LOG_OUTPUT_DIRECTORY@";
@@ -88,6 +92,7 @@
 #endif
 
-    // Module extension
+    // Module and plugin extension
     const char moduleExtension[] = "@ORXONOX_MODULE_EXTENSION@";
+    const char pluginExtension[] = "@ORXONOX_PLUGIN_EXTENSION@";
 
     // OGRE PLUGINS
Index: code/branches/core7/src/libraries/core/ApplicationPaths.cc
===================================================================
--- code/branches/core7/src/libraries/core/ApplicationPaths.cc	(revision 10545)
+++ code/branches/core7/src/libraries/core/ApplicationPaths.cc	(revision 10547)
@@ -74,4 +74,5 @@
         , executablePath_(*(new bf::path()))
         , modulePath_(*(new bf::path()))
+        , pluginPath_(*(new bf::path()))
         , bBuildDirectoryRun_(false)
     {
@@ -121,7 +122,7 @@
         executablePath_ = bf::path(buffer).branch_path();
 
-        /////////////////////
-        // SET MODULE PATH //
-        /////////////////////
+        /////////////////////////////////
+        // SET MODULE AND PLUGIN PATHS //
+        /////////////////////////////////
 
         if (bf::exists(executablePath_ / "orxonox_dev_build.keep_me"))
@@ -130,4 +131,5 @@
             ApplicationPaths::bBuildDirectoryRun_ = true;
             modulePath_ = specialConfig::moduleDevDirectory;
+            pluginPath_ = specialConfig::pluginDevDirectory;
         }
         else
@@ -144,12 +146,14 @@
                 ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?");
 
-            // Module path is fixed as well
+            // Module and plugin paths are fixed as well
             modulePath_ = rootPath_ / specialConfig::defaultModulePath;
+            pluginPath_ = rootPath_ / specialConfig::defaultPluginPath;
 
 #else
 
             // There is no root path, so don't set it at all
-            // Module path is fixed as well
+            // Module and plugin paths are fixed as well
             modulePath_ = specialConfig::moduleInstallDirectory;
+            pluginPath_ = specialConfig::pluginInstallDirectory;
 
 #endif
@@ -162,19 +166,29 @@
         delete &executablePath_;
         delete &modulePath_;
+        delete &pluginPath_;
     }
 
     std::vector<std::string> ApplicationPaths::getModulePaths()
     {
-        std::vector<std::string> modulePaths;
+        return this->getModuleOrPluginPaths(modulePath_, specialConfig::moduleExtension);
+    }
+
+    std::vector<std::string> ApplicationPaths::getPluginPaths()
+    {
+        return this->getModuleOrPluginPaths(pluginPath_, specialConfig::pluginExtension);
+    }
+
+    std::vector<std::string> ApplicationPaths::getModuleOrPluginPaths(boost::filesystem::path& directory, const std::string& extension)
+    {
+        std::vector<std::string> paths;
 
         // We search for helper files with the following extension
-        const std::string& moduleextension = specialConfig::moduleExtension;
-        size_t moduleextensionlength = moduleextension.size();
-
-        // Make sure the path exists, otherwise don't load modules
-        if (!boost::filesystem::exists(modulePath_))
-            return modulePaths;
-
-        boost::filesystem::directory_iterator file(modulePath_);
+        size_t extensionlength = extension.size();
+
+        // Make sure the path exists, otherwise don't load modules/plugins
+        if (!boost::filesystem::exists(directory))
+            return paths;
+
+        boost::filesystem::directory_iterator file(directory);
         boost::filesystem::directory_iterator end;
 
@@ -185,11 +199,11 @@
 
             // Check if the file ends with the extension in question
-            if (filename.size() > moduleextensionlength)
+            if (filename.size() > extensionlength)
             {
-                if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)
+                if (filename.substr(filename.size() - extensionlength) == extension)
                 {
                     // We've found a helper file
-                    const std::string& library = filename.substr(0, filename.size() - moduleextensionlength);
-                    modulePaths.push_back(getModulePathString() + library);
+                    const std::string& library = filename.substr(0, filename.size() - extensionlength);
+                    paths.push_back(directory.BF_GENERIC_STRING() + '/' + library);
                 }
             }
@@ -197,5 +211,5 @@
         }
 
-        return modulePaths;
+        return paths;
     }
 
@@ -214,3 +228,8 @@
         return getInstance().modulePath_.BF_GENERIC_STRING() + '/';
     }
+
+    /*static*/ std::string ApplicationPaths::getPluginPathString()
+    {
+        return getInstance().pluginPath_.BF_GENERIC_STRING() + '/';
+    }
 }
Index: code/branches/core7/src/libraries/core/ApplicationPaths.h
===================================================================
--- code/branches/core7/src/libraries/core/ApplicationPaths.h	(revision 10545)
+++ code/branches/core7/src/libraries/core/ApplicationPaths.h	(revision 10547)
@@ -49,5 +49,5 @@
         The ApplicationPaths class is a singleton which provides static paths of the application.
     @details
-        The class provides information about the executable, root and module path.
+        The class provides information about the executable, root and module/plugin path.
         It determines those by the use of platform specific functions.
     @remarks
@@ -63,5 +63,5 @@
             /**
             @brief
-                Retrieves the executable path and sets all hard coded fixed paths (currently only the module path)
+                Retrieves the executable path and sets all hard coded fixed paths (currently only the module and the plugin paths)
                 Also checks for "orxonox_dev_build.keep_me" in the executable directory.
                 If found it means that this is not an installed run, hence we
@@ -82,4 +82,7 @@
             static const boost::filesystem::path& getModulePath()
                 { return getInstance().modulePath_; }
+            //! Returns the path to the plugins as boost::filesystem::path
+            static const boost::filesystem::path& getPluginPath()
+                { return getInstance().pluginPath_; }
 
             //! Returns the path to the root folder as std::string
@@ -89,4 +92,6 @@
             //! Returns the path to the modules as std::string
             static std::string getModulePathString();
+            //! Returns the path to the plugins as std::string
+            static std::string getPluginPathString();
 
             //! Return true for runs in the build directory (not installed)
@@ -95,7 +100,11 @@
             //! Returns a list with all modules declared by a *.module file in the module folder.
             std::vector<std::string> getModulePaths();
+            //! Returns a list with all plugins declared by a *.plugin file in the plugin folder.
+            std::vector<std::string> getPluginPaths();
 
         private:
             ApplicationPaths(const ApplicationPaths&); //!< Don't use (undefined symbol)
+
+            std::vector<std::string> getModuleOrPluginPaths(boost::filesystem::path& directory, const std::string& extension);
 
             //! Path to the parent directory of the ones above if program was installed with relative paths
@@ -103,4 +112,5 @@
             boost::filesystem::path& executablePath_;        //!< Path to the executable
             boost::filesystem::path& modulePath_;            //!< Path to the modules
+            boost::filesystem::path& pluginPath_;            //!< Path to the plugins
 
             bool                     bBuildDirectoryRun_;    //!< True for runs in the build directory (not installed)
Index: code/branches/core7/src/libraries/core/Core.cc
===================================================================
--- code/branches/core7/src/libraries/core/Core.cc	(revision 10545)
+++ code/branches/core7/src/libraries/core/Core.cc	(revision 10547)
@@ -142,4 +142,5 @@
         orxout(internal_info) << "Executable path: " << ApplicationPaths::getExecutablePathString() << endl;
         orxout(internal_info) << "Modules path:    " << ApplicationPaths::getModulePathString() << endl;
+        orxout(internal_info) << "Plugins path:    " << ApplicationPaths::getPluginPathString() << endl;
 
         orxout(internal_info) << "Data path:       " << ConfigurablePaths::getDataPathString() << endl;
