BearishSun 11 лет назад
Родитель
Сommit
30c7b9fa90

+ 16 - 0
BansheeForwardRenderer/Include/BsForwardRenderer.h

@@ -5,15 +5,31 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Default renderer for Banshee. Performs frustum culling, sorting and renders
+	 *			objects plainly according to their shaders with no fancy effects.
+	 *
+	 * TODO - Update doc when I implement this properly
+	 */
 	class BS_FWDRND_EXPORT ForwardRenderer : public Renderer
 	{
 	public:
 		ForwardRenderer();
 		~ForwardRenderer();
 
+		/**
+		 * @copydoc	Renderer::getName
+		 */
 		virtual const String& getName() const;
 
+		/**
+		 * @copydoc	Renderer::renderAll
+		 */
 		virtual void renderAll();
+
+		/**
+		 * @brief	Renders all objects visible by the provided camera.
+		 */
 		virtual void render(const HCamera& camera);
 
 	private:

+ 11 - 0
BansheeForwardRenderer/Include/BsForwardRendererFactory.h

@@ -7,10 +7,21 @@ namespace BansheeEngine
 {
 	const String SystemName = "BansheeForwardRenderer";
 
+	/**
+	 * @brief	Renderer factory implementation that creates and initializes the default Banshee renderer.
+	 *			Used by the RendererManager.
+	 */
 	class BS_FWDRND_EXPORT ForwardRendererFactory : public RendererFactory
 	{
 	public:
+		/**
+		 * @copydoc	RendererFactory::create
+		 */
 		virtual RendererPtr create();
+
+		/**
+		 * @copydoc	RendererFactory::name
+		 */
 		virtual const String& name() const;
 	};
 }

+ 6 - 0
BansheeForwardRenderer/Source/BsForwardRendererPlugin.cpp

@@ -4,11 +4,17 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Returns a name of the plugin.
+	 */
 	extern "C" BS_FWDRND_EXPORT const String& getPluginName()
 	{
 		return SystemName;
 	}
 
+	/**
+	 * @brief	Entry point to the plugin. Called by the engine when the plugin is loaded.
+	 */
 	extern "C" BS_FWDRND_EXPORT void* loadPlugin()
 	{
 		RendererManager::instance()._registerFactory(cm_shared_ptr<ForwardRendererFactory>());

+ 24 - 0
BansheeOctreeSM/Include/BsOctreeSceneManager.h

@@ -5,19 +5,43 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Default scene manager implementation. Allows you to query
+	 *			the scene graph for various uses.
+	 *
+	 * TODO - Update doc when I implement this properly
+	 */
 	class BS_SM_EXPORT OctreeSceneManager : public SceneManager
 	{
 	public:
 		OctreeSceneManager() {}
 		~OctreeSceneManager() {}
 
+		/**
+		 * @brief	Returns a list of all cameras in the scene.
+		 */
 		const Vector<HCamera>& getAllCameras() const { return mCachedCameras; }
 
+		/**
+		 * @brief	Returns a list of all renderables visible by the provided camera.
+		 */
 		Vector<HRenderable> getVisibleRenderables(const HCamera& camera) const;
 
+		/**
+		 * @brief	Update world bounds of all renderables. This should be called
+		 *			at the end or beginning of every frame to ensure bounds are kept
+		 *			up to date.
+		 */
 		void updateRenderableBounds();
 	private:
+		/**
+		 * @brief	Called by scene objects whenever a new component is added to the scene.
+		 */
 		void notifyComponentAdded(const HComponent& component);
+
+		/**
+		 * @brief	Called by scene objects whenever a new component is destroyed.
+		 */
 		void notifyComponentRemoved(const HComponent& component);
 
 		Vector<HCamera> mCachedCameras;

+ 9 - 0
BansheeOctreeSM/Source/BsSceneManagerPlugin.cpp

@@ -3,12 +3,18 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Returns a name of the plugin.
+	 */
 	extern "C" BS_SM_EXPORT const String& getPluginName()
 	{
 		static String pluginName = "BansheeOctreeSM";
 		return pluginName;
 	}
 
+	/**
+	 * @brief	Entry point to the plugin. Called by the engine when the plugin is loaded.
+	 */
 	extern "C" BS_SM_EXPORT void* loadPlugin()
 	{
 		SceneManager::startUp<OctreeSceneManager>();
@@ -16,6 +22,9 @@ namespace BansheeEngine
 		return nullptr;
 	}
 
+	/**
+	 * @brief	Exit point of the plugin. Called by the engine just before the plugin is unloaded.
+	 */
 	extern "C" BS_SM_EXPORT void unloadPlugin()
 	{
 		SceneManager::shutDown();

+ 6 - 3
CamelotCore/Include/CmRenderer.h

@@ -7,8 +7,11 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Allows you to customize how are objects rendered. You need to
-	 * 			provide your own implementation of your class.
+	 * @brief	Primarily rendering class that allows you to specify how to render objects that exist
+	 *			in the scene graph. You need to provide your own implementation of your class.
+	 *
+	 * @note	Normally you would iterate over all cameras, find visible objects for each camera and render
+	 *			those objects in some way.
 	 */
 	class CM_EXPORT Renderer
 	{
@@ -20,7 +23,7 @@ namespace BansheeEngine
 		virtual const String& getName() const = 0;
 
 		/**
-		 * @brief	Called in order to render all currentlx active cameras.
+		 * @brief	Called in order to render all currently active cameras.
 		 */
 		virtual void renderAll() = 0;
 

+ 1 - 1
CamelotCore/Include/CmRendererFactory.h

@@ -17,7 +17,7 @@ namespace BansheeEngine
 	{
 	public:
 		/**
-		 * @brief	Creates a new renderer.
+		 * @brief	Creates a new instance of the renderer.
 		 */
 		virtual RendererPtr create() = 0;
 

+ 38 - 16
CamelotFBXImporter/Include/CmFBXImporter.h

@@ -10,6 +10,10 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Importer implementation that handles FBX/OBJ/DAE/3DS file import 
+	 *			by using the FBX SDK.
+	 */
 	class CM_FBX_EXPORT FBXImporter : public SpecificImporter
 	{
 	public:
@@ -17,35 +21,53 @@ namespace BansheeEngine
 		virtual ~FBXImporter();
 
 		/**
-		 * @brief	Should only be called by the plugin when its being loaded.
+		 * @copydoc	SpecificImporter::isExtensionSupported
 		 */
-		static void startUp()
-		{
-			static FBXImporter* importer = nullptr;
-			if(importer == nullptr)
-			{
-				importer = cm_new<FBXImporter>();
-				Importer::instance()._registerAssetImporter(importer);
-			}
-		}
-
-		/** Inherited from SpecificImporter */
 		virtual bool isExtensionSupported(const WString& ext) const;
 
-		/** Inherited from SpecificImporter */
+		/**
+		 * @copydoc	SpecificImporter::isMagicNumberSupported
+		 */
 		virtual bool isMagicNumberSupported(const UINT8* magicNumPtr, UINT32 numBytes) const; 
 
-		/** Inherited from SpecificImporter */
+		/**
+		 * @copydoc	SpecificImporter::import
+		 */
 		virtual ResourcePtr import(const Path& filePath, ConstImportOptionsPtr importOptions);
 	private:
-		Vector<WString> mExtensions;
-
+		/**
+		 * @brief	Starts up FBX SDK. Must be called before any other operations.
+		 *			Outputs an FBX manager and FBX scene instances you should use in
+		 *			further operations.
+		 */
 		void startUpSdk(FbxManager*& manager, FbxScene*& scene);
+
+		/**
+		 * @brief	Shuts down FBX SDK. Must be called after any other operations.
+		 */
 		void shutDownSdk(FbxManager* manager);
 
+		/**
+		 * @brief	Loads the data from the file at the provided path into the provided FBX scene. 
+		 *			Throws exception if data cannot be loaded.
+		 */
 		void loadScene(FbxManager* manager, FbxScene* scene, const Path& filePath);
+
+		/**
+		 * @brief	Parses an FBX scene. Find all meshes in the scene and returns mesh data object
+		 *			containing all vertices, indexes and other mesh information. Also outputs
+		 *			a sub-mesh array that allows you locate specific sub-meshes within the returned
+		 *			mesh data object.
+		 */
 		MeshDataPtr parseScene(FbxManager* manager, FbxScene* scene, Vector<SubMesh>& subMeshes);
 
+		/**
+		 * @brief	Parses an FBX mesh. Converts it from FBX SDK format into a mesh data object containing
+		 *			one or multiple sub-meshes.
+		 */
 		MeshDataPtr parseMesh(FbxMesh* mesh, Vector<SubMesh>& subMeshes, bool createTangentsIfMissing = true);
+
+	private:
+		Vector<WString> mExtensions;
 	};
 }

+ 9 - 1
CamelotFBXImporter/Source/CmFBXPlugin.cpp

@@ -1,17 +1,25 @@
 #include "CmFBXPrerequisites.h"
 #include "CmFBXImporter.h"
+#include "CmImporter.h"
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Returns a name of the plugin.
+	 */
 	extern "C" CM_FBX_EXPORT const String& getPluginName()
 	{
 		static String pluginName = "FBXImporter";
 		return pluginName;
 	}
 
+	/**
+	 * @brief	Entry point to the plugin. Called by the engine when the plugin is loaded.
+	 */
 	extern "C" CM_FBX_EXPORT void* loadPlugin()
 	{
-		FBXImporter::startUp();
+		FBXImporter* importer = cm_new<FBXImporter>();
+		Importer::instance()._registerAssetImporter(importer);
 
 		return nullptr;
 	}

+ 12 - 15
CamelotFontImporter/Include/CmFontImporter.h

@@ -6,6 +6,10 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Importer implementation that handles font import 
+	 *			by using the FreeType library.
+	 */
 	class CM_FONT_EXPORT FontImporter : public SpecificImporter
 	{
 	public:
@@ -13,29 +17,22 @@ namespace BansheeEngine
 		virtual ~FontImporter();
 
 		/**
-		 * @brief	Should only be called by the plugin when its being loaded.
+		 * @copydoc	SpecificImporter::isExtensionSupported
 		 */
-		static void startUp()
-		{
-			static FontImporter* importer = nullptr;
-			if(importer == nullptr)
-			{
-				importer = cm_new<FontImporter>();
-				Importer::instance()._registerAssetImporter(importer);
-			}
-		}
-
-		/** Inherited from SpecificImporter */
 		virtual bool isExtensionSupported(const WString& ext) const;
 
-		/** Inherited from SpecificImporter */
+		/**
+		 * @copydoc	SpecificImporter::isMagicNumberSupported
+		 */
 		virtual bool isMagicNumberSupported(const UINT8* magicNumPtr, UINT32 numBytes) const; 
 
-		/** Inherited from SpecificImporter */
+		/**
+		 * @copydoc	SpecificImporter::import
+		 */
 		virtual ResourcePtr import(const Path& filePath, ConstImportOptionsPtr importOptions);
 
 		/**
-		 * @copydoc SpecificImporter::createImportOptions().
+		 * @copydoc SpecificImporter::createImportOptions
 		 */
 		virtual ImportOptionsPtr createImportOptions() const;
 	private:

+ 9 - 1
CamelotFontImporter/Source/CmFontPlugin.cpp

@@ -1,17 +1,25 @@
 #include "CmFontPrerequisites.h"
+#include "CmImporter.h"
 #include "CmFontImporter.h"
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Returns a name of the plugin.
+	 */
 	extern "C" CM_FONT_EXPORT const String& getPluginName()
 	{
 		static String pluginName = "FontImporter";
 		return pluginName;
 	}
 
+	/**
+	 * @brief	Entry point to the plugin. Called by the engine when the plugin is loaded.
+	 */
 	extern "C" CM_FONT_EXPORT void* loadPlugin()
 	{
-		FontImporter::startUp();
+		FontImporter* importer = cm_new<FontImporter>();
+		Importer::instance()._registerAssetImporter(importer);
 
 		return nullptr;
 	}

+ 47 - 6
CamelotOISInput/Include/CmInputHandlerOIS.h

@@ -10,6 +10,9 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Raw input handler using OIS library for acquiring input.
+	 */
 	class CM_OIS_EXPORT InputHandlerOIS : public RawInputHandler, public OIS::KeyListener, public OIS::MouseListener
 	{
 	public:
@@ -17,22 +20,60 @@ namespace BansheeEngine
 		virtual ~InputHandlerOIS();
 
 	private:
-		OIS::InputManager*	mInputManager;
-		OIS::Mouse*			mMouse;
-		OIS::Keyboard*		mKeyboard;
-
-		UINT64				mTimestampClockOffset;
-
+		/**
+		 * @brief	Called by OIS whenever a keyboard button is pressed.
+		 */
 		virtual bool keyPressed(const OIS::KeyEvent& arg);
+
+		/**
+		 * @brief	Called by OIS whenever a keyboard button is released.
+		 */
 		virtual bool keyReleased(const OIS::KeyEvent& arg);
+
+		/**
+		 * @brief	Called by OIS whenever mouse is moved.
+		 */
 		virtual bool mouseMoved(const OIS::MouseEvent& arg);
+
+		/**
+		 * @brief	Called by OIS whenever is a mouse button pressed.
+		 */
 		virtual bool mousePressed(const OIS::MouseEvent& arg, OIS::MouseButtonID id);
+
+		/**
+		 * @brief	Called by OIS whenever is a mouse button released
+		 */
 		virtual bool mouseReleased(const OIS::MouseEvent& arg, OIS::MouseButtonID id);
 
+		/**
+		 * @brief	Called once per frame.
+		 *
+		 * @note	Internal method.
+		 */
 		virtual void _update();
+
+		/**
+		 * @brief	Called whenever the currently focused window changes.
+		 *
+		 * @note	Internal method.
+		 */
 		virtual void _inputWindowChanged(const RenderWindow& win);
 
+		/**
+		 * @brief	Converts an OIS key code into engine button code.
+		 */
 		ButtonCode keyCodeToButtonCode(OIS::KeyCode keyCode) const;
+
+		/**
+		 * @brief	Converts an OIS mouse button code into engine button code.
+		 */
 		ButtonCode mouseButtonToButtonCode(OIS::MouseButtonID mouseBtn) const;
+
+	private:
+		OIS::InputManager* mInputManager;
+		OIS::Mouse*	mMouse;
+		OIS::Keyboard* mKeyboard;
+
+		UINT64 mTimestampClockOffset;
 	};
 }

+ 6 - 0
CamelotOISInput/Source/CmOISPlugin.cpp

@@ -6,12 +6,18 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Returns a name of the plugin.
+	 */
 	extern "C" CM_OIS_EXPORT const String& getPluginName()
 	{
 		static String pluginName = "OISInput";
 		return pluginName;
 	}
 
+	/**
+	 * @brief	Entry point to the plugin. Called by the engine when the plugin is loaded.
+	 */
 	extern "C" CM_OIS_EXPORT void* loadPlugin()
 	{
 		RenderWindowPtr primaryWindow = gApplication().getPrimaryWindow();

+ 6 - 1
Polish.txt

@@ -30,4 +30,9 @@ DISREGARD MONITOR INDEX ON DX9
 
  Refactor:
  - Make CmApplication a base of BsApplication
- - If I merge CmApp and BsApp consider refactoring CmApplication::mainLoopCallback
+ - If I merge CmApp and BsApp consider refactoring CmApplication::mainLoopCallback
+
+ Rename BansheeOctreeSM -> BansheeSceneManager
+Rename BansheForwardRenderer -> BansheeRenderer
+
+Both project and classes in the project.