ソースを参照

Added a bunch of new mesh creation methods (untested)

Marko Pintera 11 年 前
コミット
c010d2c9fc

+ 6 - 6
BansheeEditor/Source/BsSceneGrid.cpp

@@ -110,17 +110,17 @@ namespace BansheeEngine
 
 
 			if (x % mAxisMarkerSpacing == 0)
 			if (x % mAxisMarkerSpacing == 0)
 			{
 			{
-				DrawHelper3D::instance().line_AA(lineStartX, lineEndX, Vector3::UNIT_Y, AXIS_MARKER_WIDTH, 
+				DrawHelper3D::instance().antialiasedLine(lineStartX, lineEndX, Vector3::UNIT_Y, AXIS_MARKER_WIDTH, 
 					AXIS_MARKER_BORDER_WIDTH, AXIS_X_MARKER_COLOR, meshData, vertexOffset, indexOffset);
 					AXIS_MARKER_BORDER_WIDTH, AXIS_X_MARKER_COLOR, meshData, vertexOffset, indexOffset);
 			}
 			}
 			else if (x % mMajorAxisSpacing == 0)
 			else if (x % mMajorAxisSpacing == 0)
 			{
 			{
-				DrawHelper3D::instance().line_AA(lineStartX, lineEndX, Vector3::UNIT_Y, MAJOR_AXIS_WIDTH,
+				DrawHelper3D::instance().antialiasedLine(lineStartX, lineEndX, Vector3::UNIT_Y, MAJOR_AXIS_WIDTH,
 					MAJOR_AXIS_BORDER_WIDTH, Color::White, meshData, vertexOffset, indexOffset);
 					MAJOR_AXIS_BORDER_WIDTH, Color::White, meshData, vertexOffset, indexOffset);
 			}
 			}
 			else
 			else
 			{
 			{
-				DrawHelper3D::instance().line_AA(lineStartX, lineEndX, Vector3::UNIT_Y, LINE_WIDTH,
+				DrawHelper3D::instance().antialiasedLine(lineStartX, lineEndX, Vector3::UNIT_Y, LINE_WIDTH,
 					LINE_BORDER_WIDTH, Color::White, meshData, vertexOffset, indexOffset);
 					LINE_BORDER_WIDTH, Color::White, meshData, vertexOffset, indexOffset);
 			}
 			}
 
 
@@ -135,17 +135,17 @@ namespace BansheeEngine
 
 
 			if (z % mAxisMarkerSpacing == 0)
 			if (z % mAxisMarkerSpacing == 0)
 			{
 			{
-				DrawHelper3D::instance().line_AA(lineStartZ, lineEndZ, Vector3::UNIT_Y, AXIS_MARKER_WIDTH,
+				DrawHelper3D::instance().antialiasedLine(lineStartZ, lineEndZ, Vector3::UNIT_Y, AXIS_MARKER_WIDTH,
 					AXIS_MARKER_BORDER_WIDTH, AXIS_Z_MARKER_COLOR, meshData, vertexOffset, indexOffset);
 					AXIS_MARKER_BORDER_WIDTH, AXIS_Z_MARKER_COLOR, meshData, vertexOffset, indexOffset);
 			}
 			}
 			else if (z % mMajorAxisSpacing == 0)
 			else if (z % mMajorAxisSpacing == 0)
 			{
 			{
-				DrawHelper3D::instance().line_AA(lineStartZ, lineEndZ, Vector3::UNIT_Y, MAJOR_AXIS_WIDTH,
+				DrawHelper3D::instance().antialiasedLine(lineStartZ, lineEndZ, Vector3::UNIT_Y, MAJOR_AXIS_WIDTH,
 					MAJOR_AXIS_BORDER_WIDTH, Color::White, meshData, vertexOffset, indexOffset);
 					MAJOR_AXIS_BORDER_WIDTH, Color::White, meshData, vertexOffset, indexOffset);
 			}
 			}
 			else
 			else
 			{
 			{
-				DrawHelper3D::instance().line_AA(lineStartZ, lineEndZ, Vector3::UNIT_Y, LINE_WIDTH,
+				DrawHelper3D::instance().antialiasedLine(lineStartZ, lineEndZ, Vector3::UNIT_Y, LINE_WIDTH,
 					LINE_BORDER_WIDTH, Color::White, meshData, vertexOffset, indexOffset);
 					LINE_BORDER_WIDTH, Color::White, meshData, vertexOffset, indexOffset);
 			}
 			}
 
 

+ 20 - 18
BansheeEngine/Include/BsDrawHelper2D.h

@@ -28,28 +28,30 @@ namespace BansheeEngine
 		 * 			  Vector2 VES_POSITION
 		 * 			  Vector2 VES_POSITION
 		 * 			  32bit index buffer
 		 * 			  32bit index buffer
 		 * 			  Enough space for 4 vertices and 6 indices
 		 * 			  Enough space for 4 vertices and 6 indices
+		 *
+		 *			Primitives are output in the form of a triangle list.
 		 */
 		 */
-		void quad(const RectF& area, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+		void solidQuad(const RectF& area, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::line_Pixel
+		 * @copydoc	DrawHelperTemplate::pixelLine
 		 */
 		 */
-		void line_Pixel(const Vector2& a, const Vector2& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+		void pixelLine(const Vector2& a, const Vector2& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::line_AA
+		 * @copydoc	DrawHelperTemplate::antialiasedLine
 		 */
 		 */
-		void line_AA(const Vector2& a, const Vector2& b, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+		void antialiasedLine(const Vector2& a, const Vector2& b, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::lineList_Pixel
+		 * @copydoc	DrawHelperTemplate::pixelLineList
 		 */
 		 */
-		void lineList_Pixel(const Vector<Vector2>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+		void pixelLineList(const Vector<Vector2>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::lineList_AA
+		 * @copydoc	DrawHelperTemplate::antialiasedLineList
 		 */
 		 */
-		void lineList_AA(const Vector<Vector2>& linePoints, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+		void antialiasedLineList(const Vector<Vector2>& linePoints, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
 		 * @brief	Constructs a quad and draws it in the specified camera. 
 		 * @brief	Constructs a quad and draws it in the specified camera. 
@@ -61,7 +63,7 @@ namespace BansheeEngine
 		 *						the quad will stretch with the viewport so its normalized coordinates stay the same.
 		 *						the quad will stretch with the viewport so its normalized coordinates stay the same.
 		 * @param	timeout		Optional timeout on how long to display the quad in seconds. If 0 the quad will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the quad in seconds. If 0 the quad will be displayed one frame.
 		 */
 		 */
-		void drawQuad(const HCamera& camera, const RectF& area, const Color& color = Color::White, DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
+		void drawSolidQuad(const HCamera& camera, const RectF& area, const Color& color = Color::White, DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 
 
 		/**
 		/**
 		 * @brief	Constructs a pixel perfect line and draws it in the specified camera. 
 		 * @brief	Constructs a pixel perfect line and draws it in the specified camera. 
@@ -74,7 +76,7 @@ namespace BansheeEngine
 		 *						the line will stretch with the viewport so its normalized coordinates stay the same.
 		 *						the line will stretch with the viewport so its normalized coordinates stay the same.
 		 * @param	timeout		Optional timeout on how long to display the line in seconds. If 0 the line will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the line in seconds. If 0 the line will be displayed one frame.
 		 */
 		 */
-		void drawLine_Pixel(const HCamera& camera, const Vector2& a, const Vector2& b, const Color& color = Color::White, 
+		void drawPixelLine(const HCamera& camera, const Vector2& a, const Vector2& b, const Color& color = Color::White, 
 			DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 			DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 
 
 		/**
 		/**
@@ -90,7 +92,7 @@ namespace BansheeEngine
 		 *						the line will stretch with the viewport so its normalized coordinates stay the same.
 		 *						the line will stretch with the viewport so its normalized coordinates stay the same.
 		 * @param	timeout		Optional timeout on how long to display the line in seconds. If 0 the line will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the line in seconds. If 0 the line will be displayed one frame.
 		 */
 		 */
-		void drawLine_AA(const HCamera& camera, const Vector2& a, const Vector2& b, float width, float borderWidth, 
+		void drawAntialiasedLine(const HCamera& camera, const Vector2& a, const Vector2& b, float width, float borderWidth, 
 			const Color& color = Color::White, DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 			const Color& color = Color::White, DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 
 
 		/**
 		/**
@@ -104,7 +106,7 @@ namespace BansheeEngine
 		 *						the line list will stretch with the viewport so its normalized coordinates stay the same.
 		 *						the line list will stretch with the viewport so its normalized coordinates stay the same.
 		 * @param	timeout		Optional timeout on how long to display the line list in seconds. If 0 the line list will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the line list in seconds. If 0 the line list will be displayed one frame.
 		 */
 		 */
-		void drawLineList_Pixel(const HCamera& camera, const Vector<Vector2>& linePoints, const Color& color = Color::White, 
+		void drawPixelLineList(const HCamera& camera, const Vector<Vector2>& linePoints, const Color& color = Color::White, 
 			DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 			DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 
 
 		/**
 		/**
@@ -120,20 +122,20 @@ namespace BansheeEngine
 		 *						the line list will stretch with the viewport so its normalized coordinates stay the same.
 		 *						the line list will stretch with the viewport so its normalized coordinates stay the same.
 		 * @param	timeout		Optional timeout on how long to display the line list in seconds. If 0 the line list will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the line list in seconds. If 0 the line list will be displayed one frame.
 		 */
 		 */
-		void drawLineList_AA(const HCamera& camera, const Vector<Vector2>& linePoints, float width, float borderWidth, 
+		void drawAntialiasedLineList(const HCamera& camera, const Vector<Vector2>& linePoints, float width, float borderWidth, 
 			const Color& color = Color::White, DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 			const Color& color = Color::White, DebugDrawCoordType coordType = DebugDrawCoordType::Pixel, float timeout = 0.0f);
 
 
 	protected:
 	protected:
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::line_AA(const Vector2&, const Vector2&, const Vector2&, float, float, const Color&, UINT8*, UINT8*, UINT32, UINT32, UINT32*, UINT32)
+		 * @copydoc	DrawHelperTemplate::antialiasedLine(const Vector2&, const Vector2&, const Vector2&, float, float, const Color&, UINT8*, UINT8*, UINT32, UINT32, UINT32*, UINT32)
 		 */
 		 */
-		void line_AA(const Vector2& a, const Vector2& b, const Vector2& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors, 
+		void antialiasedLine(const Vector2& a, const Vector2& b, const Vector2& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors, 
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::polygon_AA(const Vector<Vector2>&, const Vector2&, float, const Color&, UINT8*, UINT8*, UINT32, UINT32, UINT32*, UINT32)
+		 * @copydoc	DrawHelperTemplate::antialiasedPolygon(const Vector<Vector2>&, const Vector2&, float, const Color&, UINT8*, UINT8*, UINT32, UINT32, UINT32*, UINT32)
 		 */
 		 */
-		void polygon_AA(const Vector<Vector2>& points, const Vector2& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
+		void antialiasedPolygon(const Vector<Vector2>& points, const Vector2& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
 
 
 	private:
 	private:

+ 369 - 25
BansheeEngine/Include/BsDrawHelper3D.h

@@ -17,10 +17,9 @@ namespace BansheeEngine
 		DrawHelper3D();
 		DrawHelper3D();
 
 
 		/**
 		/**
-		 * @brief	Fills the mesh data with vertices representing an axis aligned box.
+		 * @brief	Fills the mesh data with vertices representing an outline of axis aligned box.
 		 *
 		 *
-		 * @param	aabox			Axis aligned box to get the mesh data for
-		 * @param	color			Color of the line.
+		 * @param	aabox			Axis aligned box to create the mesh data for
 		 * @param	meshData		Mesh data that will be populated.
 		 * @param	meshData		Mesh data that will be populated.
 		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
 		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
@@ -28,30 +27,236 @@ namespace BansheeEngine
 		 * @note	Provided MeshData must have some specific elements at least:
 		 * @note	Provided MeshData must have some specific elements at least:
 		 * 			  Vector3 VES_POSITION
 		 * 			  Vector3 VES_POSITION
 		 * 			  32bit index buffer
 		 * 			  32bit index buffer
-		 * 			  Enough space for 8 vertices and 36 indices
+		 * 			  Enough space for 8 vertices and 24 indices
+		 *
+		 *			Primitives are output in the form of a line list.
+		 */
+		void wireAABox(const AABox& box, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing a solid axis aligned box.
+		 *
+		 * @param	aabox			Axis aligned box to create the mesh data for
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * 							
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 *			  Vector3 VES_NORMAL
+		 * 			  32bit index buffer
+		 * 			  Enough space for 24 vertices and 36 indices
+		 *
+		 *			Primitives are output in the form of a triangle list.
+		 */
+		void solidAABox(const AABox& box, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing an outline of a sphere.
+		 *
+		 * @param	sphere			Sphere to get the mesh data for
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the sphere will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 *
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 * 			  32bit index buffer
+		 * 			  Enough space for 3 * ((quality + 1) * 5) vertices 
+		 *			  Enough space for 6 * ((quality + 1) * 5 - 1) indices
+		 *
+		 *			Primitives are output in the form of a line list.
+		 */
+		void wireSphere(const Sphere& sphere, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality = 10);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing a sphere.
+		 *
+		 * @param	sphere			Sphere to get the mesh data for
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the sphere will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 *
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 *			  Vector3 VES_NORMAL
+		 * 			  32bit index buffer
+		 * 			  Enough space for 20 * (4 * (3 ^ quality)) vertices 
+		 *			  Enough space for 20 * (4 * (3 ^ quality)) indices
+		 *
+		 *			Primitives are output in the form of a triangle list.
+		 */
+		void solidSphere(const Sphere& sphere, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality = 1);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing an outline of an arc.
+		 *
+		 * @param	center			Center of the arc to generate geometry for.
+		 * @param	radius			Radius of the arc to generate geometry for.
+		 * @param	normal			Normal around which the arc is generated. Arc geometry will be perpendicular to the normal.
+		 * @param	startAngle		Angle at which the arc starts.
+		 * @param	amountAngle		Angle that the arc spans.
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the arc will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 *
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 * 			  32bit index buffer
+		 * 			  Enough space for ((quality + 1) * 5) vertices 
+		 *			  Enough space for (((quality + 1) * 5 - 1) * 2) indices
+		 *
+		 *			Primitives are output in the form of a line list.
+		 */
+		void wireArc(const Vector3& center, float radius, const Vector3& normal, Degree startAngle, Degree amountAngle,
+			const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality = 10);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing a solid arc.
+		 *
+		 * @param	center			Center of the arc to generate geometry for.
+		 * @param	radius			Radius of the arc to generate geometry for.
+		 * @param	normal			Normal around which the arc is generated. Arc geometry will be perpendicular to the normal.
+		 * @param	startAngle		Angle at which the arc starts.
+		 * @param	amountAngle		Angle that the arc spans.
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the arc will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 *
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 *			  Vector3 VES_NORMAL
+		 * 			  32bit index buffer
+		 * 			  Enough space for ((quality + 1) * 5 + 1) vertices 
+		 *			  Enough space for (((quality + 1) * 5 - 1) * 3) indices
+		 *
+		 *			Primitives are output in the form of a triangle list.
+		 */
+		void solidArc(const Vector3& center, float radius, const Vector3& normal, Degree startAngle, Degree amountAngle,
+			const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality = 10);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing an outline of a disc.
+		 *
+		 * @param	center			Center of the disc to generate geometry for.
+		 * @param	radius			Radius of the disc to generate geometry for.
+		 * @param	normal			Normal around which the disc is generated. Disc geometry will be perpendicular to the normal.
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the disc will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 *
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 * 			  32bit index buffer
+		 * 			  Enough space for ((quality + 1) * 5) vertices 
+		 *			  Enough space for (((quality + 1) * 5 - 1) * 2) indices
+		 *
+		 *			Primitives are output in the form of a line list.
+		 */
+		void wireDisc(const Vector3& center, float radius, const Vector3& normal, const MeshDataPtr& meshData, 
+			UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality = 10);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing a solid disc.
+		 *
+		 * @param	center			Center of the disc to generate geometry for.
+		 * @param	radius			Radius of the disc to generate geometry for.
+		 * @param	normal			Normal around which the disc is generated. Disc geometry will be perpendicular to the normal.
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the disc will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 *
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 *			  Vector3 VES_NORMAL
+		 * 			  32bit index buffer
+		 * 			  Enough space for ((quality + 1) * 5 + 1) vertices 
+		 *			  Enough space for (((quality + 1) * 5 - 1) * 3) indices
+		 *
+		 *			Primitives are output in the form of a triangle list.
+		 */
+		void solidDisc(const Vector3& center, float radius, const Vector3& normal, const MeshDataPtr& meshData, 
+			UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality = 10);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing an outline of an camera frustum. Frustum will
+		 *			be facing -z and be positioned at world origin.
+		 *
+		 * @param	aspect			Aspect ratio (width / height).
+		 * @param	FOV				Horizontal field of view angle.
+		 * @param	near			Distance to near clipping plane.
+		 * @param	far				Distance to far clipping plane.
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * 							
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 * 			  32bit index buffer
+		 * 			  Enough space for 8 vertices and 24 indices
+		 *
+		 *			Primitives are output in the form of a line list.
+		 */
+		void wireFrustum(float aspect, Degree FOV, float near, float far,
+			const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+
+		/**
+		 * @brief	Fills the mesh data with vertices representing a solid cone.
+		 *
+		 * @param	base			World position of the cone base.
+		 * @param	normal			Direction of the pointed part of the cone.
+		 * @param	height			Cone height (distance from base to the top).
+		 * @param	radius			Cone radius (distance from base center to outer edge).
+		 * @param	meshData		Mesh data that will be populated.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the cone will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 *
+		 * @note	Provided MeshData must have some specific elements at least:
+		 * 			  Vector3 VES_POSITION
+		 *			  Vector3 VES_NORMAL
+		 * 			  32bit index buffer
+		 * 			  Enough space for ((quality + 1) * 4 + 1) * 2 vertices 
+		 *			  Enough space for (((quality + 1) * 4 - 1) * 6) indices
+		 *
+		 *			Primitives are output in the form of a triangle list.
 		 */
 		 */
-		void aabox(const AABox& box, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+		void solidCone(const Vector3& base, const Vector3& normal, float height, float radius,
+			const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality = 10);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::line_Pixel
+		 * @copydoc	DrawHelperTemplate::pixelLine
 		 */
 		 */
-		void line_Pixel(const Vector3& a, const Vector3& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+		void pixelLine(const Vector3& a, const Vector3& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::line_AA
+		 * @copydoc	DrawHelperTemplate::antialiasedLine
 		 */
 		 */
-		void line_AA(const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, const Color& color, 
+		void antialiasedLine(const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, const Color& color, 
 			const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 			const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::lineList_Pixel
+		 * @copydoc	DrawHelperTemplate::pixelLineList
 		 */
 		 */
-		void lineList_Pixel(const Vector<Vector3>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
+		void pixelLineList(const Vector<Vector3>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::lineList_AA
+		 * @copydoc	DrawHelperTemplate::antialiasedLineList
 		 */
 		 */
-		void lineList_AA(const Vector<Vector3>& linePoints, const Vector3& up, float width, float borderWidth, 
+		void antialiasedLineList(const Vector<Vector3>& linePoints, const Vector3& up, float width, float borderWidth, 
 			const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 			const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset);
 
 
 		/**
 		/**
@@ -63,7 +268,7 @@ namespace BansheeEngine
 		 * @param	color		Color of the line.
 		 * @param	color		Color of the line.
 		 * @param	timeout		Optional timeout on how long to display the line in seconds. If 0 the line will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the line in seconds. If 0 the line will be displayed one frame.
 		 */
 		 */
-		void drawLine_Pixel(const HCamera& camera, const Vector3& a, const Vector3& b, const Color& color = Color::White, float timeout = 0.0f);
+		void drawPixelLine(const HCamera& camera, const Vector3& a, const Vector3& b, const Color& color = Color::White, float timeout = 0.0f);
 
 
 		/**
 		/**
 		 * @brief	Constructs an antialiased line with custom width and draws it in the specified camera. 
 		 * @brief	Constructs an antialiased line with custom width and draws it in the specified camera. 
@@ -77,7 +282,7 @@ namespace BansheeEngine
 		 * @param	color		Color of the line.
 		 * @param	color		Color of the line.
 		 * @param	timeout		Optional timeout on how long to display the line in seconds. If 0 the line will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the line in seconds. If 0 the line will be displayed one frame.
 		 */
 		 */
-		void drawLine_AA(const HCamera& camera, const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, 
+		void drawAntialiasedLine(const HCamera& camera, const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, 
 			const Color& color = Color::White, float timeout = 0.0f);
 			const Color& color = Color::White, float timeout = 0.0f);
 
 
 		/**
 		/**
@@ -89,7 +294,7 @@ namespace BansheeEngine
 		 * @param	color		Color of the line list.
 		 * @param	color		Color of the line list.
 		 * @param	timeout		Optional timeout on how long to display the line list in seconds. If 0 the line list will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the line list in seconds. If 0 the line list will be displayed one frame.
 		 */
 		 */
-		void drawLineList_Pixel(const HCamera& camera, const Vector<Vector3>& linePoints, const Color& color = Color::White, float timeout = 0.0f);
+		void drawPixelLineList(const HCamera& camera, const Vector<Vector3>& linePoints, const Color& color = Color::White, float timeout = 0.0f);
 
 
 		/**
 		/**
 		 * @brief	Constructs an list of antialiased lines with custom width and draws them in the specified camera. 
 		 * @brief	Constructs an list of antialiased lines with custom width and draws them in the specified camera. 
@@ -103,7 +308,7 @@ namespace BansheeEngine
 		 * @param	color		Color of the line list.
 		 * @param	color		Color of the line list.
 		 * @param	timeout		Optional timeout on how long to display the line list in seconds. If 0 the line list will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the line list in seconds. If 0 the line list will be displayed one frame.
 		 */
 		 */
-		void drawLineList_AA(const HCamera& camera, const Vector<Vector3>& linePoints, const Vector3& up, float width, float borderWidth, 
+		void drawAntialiasedLineList(const HCamera& camera, const Vector<Vector3>& linePoints, const Vector3& up, float width, float borderWidth, 
 			const Color& color = Color::White, float timeout = 0.0f);
 			const Color& color = Color::White, float timeout = 0.0f);
 
 
 		/**
 		/**
@@ -114,34 +319,137 @@ namespace BansheeEngine
 		 * @param	color		Color of the box.
 		 * @param	color		Color of the box.
 		 * @param	timeout		Optional timeout on how long to display the box in seconds. If 0 the box will be displayed one frame.
 		 * @param	timeout		Optional timeout on how long to display the box in seconds. If 0 the box will be displayed one frame.
 		 */
 		 */
-		void drawAABox(const HCamera& camera, const AABox& box, const Color& color = Color::White, float timeout = 0.0f);
+		void drawWireAABox(const HCamera& camera, const AABox& box, const Color& color = Color::White, float timeout = 0.0f);
 
 
 	protected:
 	protected:
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::line_AA(const Vector3&, const Vector3&, const Vector3&, float, float, const Color&, UINT8*, UINT8*, UINT32, UINT32, UINT32*, UINT32)
+		 * @copydoc	DrawHelperTemplate::antialiasedLine(const Vector3&, const Vector3&, const Vector3&, float, float, const Color&, UINT8*, UINT8*, UINT32, UINT32, UINT32*, UINT32)
 		 */
 		 */
-		void line_AA(const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors, 
+		void antialiasedLine(const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors, 
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @copydoc	DrawHelperTemplate::polygon_AA(const Vector<Vector3>&, const Vector3&, float, const Color&, UINT8*, UINT8*, UINT32, UINT32, UINT32*, UINT32)
+		 * @copydoc	DrawHelperTemplate::antialiasedPolygon(const Vector<Vector3>&, const Vector3&, float, const Color&, UINT8*, UINT8*, UINT32, UINT32, UINT32*, UINT32)
 		 */
 		 */
-		void polygon_AA(const Vector<Vector3>& points, const Vector3& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors, 
+		void antialiasedPolygon(const Vector<Vector3>& points, const Vector3& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors, 
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
 
 
 		/**
 		/**
-		 * @brief	Fills the provided buffers with position and index data representing an axis aligned box.
+		 * @brief	Fills the provided buffers with position and index data representing an outline of an axis aligned box.
 		 *
 		 *
 		 * @param	box				Box to create geometry for.
 		 * @param	box				Box to create geometry for.
 		 * @param	outVertices		Output buffer that will store the vertex position data.
 		 * @param	outVertices		Output buffer that will store the vertex position data.
 		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
 		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
-		 * @param	vertexStride	Size of a single vertex, in bytes. (Same for both position and color buffer)
+		 * @param	vertexStride	Size of a single vertex, in bytes.
+		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 */
+		void wireAABox(const AABox& box, UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride, 
+			UINT32* outIndices, UINT32 indexOffset);
+
+		/**
+		 * @brief	Fills the provided buffers with position and index data representing a solid axis aligned box.
+		 *
+		 * @param	box				Box to create geometry for.
+		 * @param	outVertices		Output buffer that will store the vertex position data.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	vertexStride	Size of a single vertex, in bytes. (Same for both position and normal buffer)
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 */
 		 */
-		void aabox(const AABox& box, UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride, 
+		void solidAABox(const AABox& box, UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride, 
 			UINT32* outIndices, UINT32 indexOffset);
 			UINT32* outIndices, UINT32 indexOffset);
 
 
+		/**
+		 * @brief	Fills the provided buffers with position and index data representing a sphere.
+		 *
+		 * @param	sphere			Sphere to create geometry for.
+		 * @param	outVertices		Output buffer that will store the vertex position data.
+		 * @param	outNormals		Output buffer that will store the vertex normal data.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	vertexStride	Size of a single vertex, in bytes. (Same for both position and normal buffer)
+		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the sphere will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 */
+		void solidSphere(const Sphere& sphere, UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride,
+			UINT32* outIndices, UINT32 indexOffset, UINT32 quality);
+
+		/**
+		 * @brief	Fills the provided buffers with position and index data representing an outline of an arc.
+		 *
+		 * @param	center			Center of the arc to generate geometry for.
+		 * @param	radius			Radius of the arc to generate geometry for.
+		 * @param	normal			Normal around which the arc is generated. Arc geometry will be perpendicular to the normal.
+		 * @param	startAngle		Angle at which the arc starts.
+		 * @param	amountAngle		Angle that the arc spans.
+		 * @param	outVertices		Output buffer that will store the vertex position data.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	vertexStride	Size of a single vertex, in bytes.
+		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the arc will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 */
+		void wireArc(const Vector3& center, float radius, const Vector3& normal, Degree startAngle, Degree amountAngle, 
+			UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset, UINT32 quality);
+
+		/**
+		 * @brief	Fills the provided buffers with position and index data representing a solid arc.
+		 *
+		 * @param	center			Center of the arc to generate geometry for.
+		 * @param	radius			Radius of the arc to generate geometry for.
+		 * @param	normal			Normal around which the arc is generated. Arc geometry will be perpendicular to the normal.
+		 * @param	startAngle		Angle at which the arc starts.
+		 * @param	amountAngle		Angle that the arc spans.
+		 * @param	outVertices		Output buffer that will store the vertex position data.
+		 * @param	outNormals		Output buffer that will store the vertex normal data.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	vertexStride	Size of a single vertex, in bytes. (Same for both position and normal buffer)
+		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the arc will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 */
+		void solidArc(const Vector3& center, float radius, const Vector3& normal, Degree startAngle, Degree amountAngle, 
+			UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset, UINT32 quality);
+
+		/**
+		 * @brief	Fills the provided buffers with position and index data representing an outline of an axis aligned box.
+		 *
+		 * @param	aspect			Aspect ratio (width / height).
+		 * @param	FOV				Horizontal field of view angle.
+		 * @param	near			Distance to near clipping plane.
+		 * @param	far				Distance to far clipping plane.
+		 * @param	outVertices		Output buffer that will store the vertex position data.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	vertexStride	Size of a single vertex, in bytes.
+		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 */
+		void wireFrustum(float aspect, Degree FOV, float near, float far,
+			UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset);
+
+		/**
+		 * @brief	Fills the provided buffers with position and index data representing a solid cone.
+		 *
+		 * @param	base			World position of the cone base.
+		 * @param	normal			Direction of the pointed part of the cone.
+		 * @param	height			Cone height (distance from base to the top).
+		 * @param	radius			Cone radius (distance from base center to outer edge).
+		 * @param	outVertices		Output buffer that will store the vertex position data.
+		 * @param	outNormals		Output buffer that will store the vertex normal data.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	vertexStride	Size of a single vertex, in bytes. (Same for both position and normal buffer)
+		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
+		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
+		 * @param	quality			Represents the level of tessellation the cone will have. Higher level means higher quality
+		 *							but also more vertices and primitives.
+		 */
+		void solidCone(const Vector3& base, const Vector3& normal, float height, float radius,
+			UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset, UINT32 quality);
+
 	private:
 	private:
 		/**
 		/**
 		 * @brief	Calculates the center of the provided vertices.
 		 * @brief	Calculates the center of the provided vertices.
@@ -154,6 +462,42 @@ namespace BansheeEngine
 		 */
 		 */
 		Vector3 calcCenter(UINT8* vertices, UINT32 numVertices, UINT32 vertexStride);
 		Vector3 calcCenter(UINT8* vertices, UINT32 numVertices, UINT32 vertexStride);
 
 
+		/**
+		 * @brief	Subdivides the provided triangle so it approximates a curved surface of a sphere.
+		 *
+		 * @param	center			Center of the sphere to approximate.
+		 * @param	radius			Radius of the sphere to approximate.
+		 * @param	numLevels		Number of times to subdivide the triangle. Higher number means better approximation.
+		 * @param	a				First corner of the triangle. Must be normalized.
+		 * @param	b				Second corner of the triangle. Must be normalized.
+		 * @param	c				Third corner of the triangle. Must be normalized.
+		 * @param	outVertices		Output buffer that will store the vertex position data.
+		 * @param	outNormals		Output buffer that will store the vertex normal data.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	vertexStride	Size of a single vertex, in bytes. (Same for both position and color buffer)
+		 *
+		 * @returns	Number of vertices generated (3 * (4 ^ numLevels)).
+		 */
+		UINT32 subdivideTriangleOnSphere(const Vector3& center, float radius, UINT32 numLevels,
+			const Vector3& a, const Vector3& b, const Vector3& c,
+			UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride);
+
+		/**
+		 * @brief	Generates vertices that are part of an arc approximation.
+		 *
+		 * @param	center		Determines world position of the arc.
+		 * @param	up			Determines rotation of the arc. Arc vertices will be perpendicular to this direction.
+		 * @param	radius		Distance of arc vertices from the center.
+		 * @param	startAngle	Angle in degrees to start the arc at.
+		 * @param	angleAmount	Angle in degrees to extend the arc from the start angle.
+		 * @param	numVertices	Number of vertices to generate for the arc. Higher number means better arc approximation. Must be 2 or higher.
+		 * @param	outVertices		Output buffer that will store the vertex position data.
+		 * @param	vertexOffset	Offset in number of vertices from the start of the buffer to start writing at.
+		 * @param	vertexStride	Size of a single vertex, in bytes. (Same for both position and color buffer)
+		 */
+		void generateArcVertices(const Vector3& center, const Vector3& up, float radius, Degree startAngle, Degree angleAmount, UINT32 numVertices,
+			UINT8* outvertices, UINT32 vertexOffset, UINT32 vertexStride);
+
 		VertexDataDescPtr mVertexDesc;
 		VertexDataDescPtr mVertexDesc;
 	};
 	};
 }
 }

+ 23 - 14
BansheeEngine/Include/BsDrawHelperTemplate.h

@@ -85,8 +85,10 @@ namespace BansheeEngine
 		 * 			  UINT32  VES_COLOR
 		 * 			  UINT32  VES_COLOR
 		 * 			  32bit index buffer
 		 * 			  32bit index buffer
 		 * 			  Enough space for 2 vertices and 2 indices
 		 * 			  Enough space for 2 vertices and 2 indices
+		 *
+		 *			Primitives are output in the form of a line list.
 		 */
 		 */
-		void line_Pixel(const T& a, const T& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+		void pixelLine(const T& a, const T& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 		{
 		{
 			UINT32* indexData = meshData->getIndices32();
 			UINT32* indexData = meshData->getIndices32();
 			UINT8* positionData = meshData->getElementData(VES_POSITION);
 			UINT8* positionData = meshData->getElementData(VES_POSITION);
@@ -95,7 +97,7 @@ namespace BansheeEngine
 			assert((vertexOffset + 2) <= meshData->getNumVertices());
 			assert((vertexOffset + 2) <= meshData->getNumVertices());
 			assert((indexOffset + 2) <= meshData->getNumIndices());
 			assert((indexOffset + 2) <= meshData->getNumIndices());
 
 
-			line_Pixel(a, b, color, positionData, colorData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
+			pixelLine(a, b, color, positionData, colorData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
 		}
 		}
 
 
 		/**
 		/**
@@ -116,8 +118,10 @@ namespace BansheeEngine
 		 * 			  UINT32  VES_COLOR
 		 * 			  UINT32  VES_COLOR
 		 * 			  32bit index buffer
 		 * 			  32bit index buffer
 		 *			  Enough space for 8 vertices and 30 indices
 		 *			  Enough space for 8 vertices and 30 indices
+		 *
+		 *			Primitives are output in the form of a triangle list.
 		 */
 		 */
-		void line_AA(const T& a, const T& b, const T& up, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+		void antialiasedLine(const T& a, const T& b, const T& up, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 		{
 		{
 			UINT32* indexData = meshData->getIndices32();
 			UINT32* indexData = meshData->getIndices32();
 			UINT8* positionData = meshData->getElementData(VES_POSITION);
 			UINT8* positionData = meshData->getElementData(VES_POSITION);
@@ -126,7 +130,7 @@ namespace BansheeEngine
 			assert((vertexOffset + NUM_VERTICES_AA_LINE) <= meshData->getNumVertices());
 			assert((vertexOffset + NUM_VERTICES_AA_LINE) <= meshData->getNumVertices());
 			assert((indexOffset + NUM_INDICES_AA_LINE) <= meshData->getNumIndices());
 			assert((indexOffset + NUM_INDICES_AA_LINE) <= meshData->getNumIndices());
 
 
-			line_AA(a, b, up, width, borderWidth, color, positionData, colorData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
+			antialiasedLine(a, b, up, width, borderWidth, color, positionData, colorData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
 		}
 		}
 
 
 		/**
 		/**
@@ -143,8 +147,10 @@ namespace BansheeEngine
 		 * 			  UINT32  VES_COLOR
 		 * 			  UINT32  VES_COLOR
 		 * 			  32bit index buffer
 		 * 			  32bit index buffer
 		 * 			  Enough space for (numLines * 2) vertices and (numLines * 2) indices
 		 * 			  Enough space for (numLines * 2) vertices and (numLines * 2) indices
+		 *
+		 *			Primitives are output in the form of a line list.
 		 */
 		 */
-		void lineList_Pixel(const typename Vector<T>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+		void pixelLineList(const typename Vector<T>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 		{
 		{
 			assert(linePoints.size() % 2 == 0);
 			assert(linePoints.size() % 2 == 0);
 
 
@@ -161,7 +167,7 @@ namespace BansheeEngine
 			UINT32 numPoints = (UINT32)linePoints.size();
 			UINT32 numPoints = (UINT32)linePoints.size();
 			for(UINT32 i = 0; i < numPoints; i += 2)
 			for(UINT32 i = 0; i < numPoints; i += 2)
 			{
 			{
-				line_Pixel(linePoints[i], linePoints[i + 1], color, positionData, colorData, curVertOffset, meshData->getVertexDesc()->getVertexStride(), indexData, curIdxOffset);
+				pixelLine(linePoints[i], linePoints[i + 1], color, positionData, colorData, curVertOffset, meshData->getVertexDesc()->getVertexStride(), indexData, curIdxOffset);
 
 
 				curVertOffset += 2;
 				curVertOffset += 2;
 				curIdxOffset += 2;
 				curIdxOffset += 2;
@@ -185,8 +191,10 @@ namespace BansheeEngine
 		 * 			  UINT32  VES_COLOR
 		 * 			  UINT32  VES_COLOR
 		 * 			  32bit index buffer
 		 * 			  32bit index buffer
 		 *			  Enough space for (numLines * 8) vertices and (numLines * 30) indices
 		 *			  Enough space for (numLines * 8) vertices and (numLines * 30) indices
+		 *
+		 *			Primitives are output in the form of a triangle list.
 		 */
 		 */
-		void lineList_AA(const typename Vector<T>& linePoints, const T& up, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+		void antialiasedLineList(const typename Vector<T>& linePoints, const T& up, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 		{
 		{
 			assert(linePoints.size() % 2 == 0);
 			assert(linePoints.size() % 2 == 0);
 
 
@@ -203,13 +211,14 @@ namespace BansheeEngine
 			UINT32 numPoints = (UINT32)linePoints.size();
 			UINT32 numPoints = (UINT32)linePoints.size();
 			for(UINT32 i = 0; i < numPoints; i += 2)
 			for(UINT32 i = 0; i < numPoints; i += 2)
 			{
 			{
-				line_AA(linePoints[i], linePoints[i + 1], up, width, borderWidth, color, positionData, colorData, curVertOffset, meshData->getVertexDesc()->getVertexStride(), indexData, curIdxOffset);
+				antialiasedLine(linePoints[i], linePoints[i + 1], up, width, borderWidth, color, positionData, colorData, curVertOffset, meshData->getVertexDesc()->getVertexStride(), indexData, curIdxOffset);
 
 
 				curVertOffset += NUM_VERTICES_AA_LINE;
 				curVertOffset += NUM_VERTICES_AA_LINE;
 				curIdxOffset += NUM_INDICES_AA_LINE;
 				curIdxOffset += NUM_INDICES_AA_LINE;
 			}
 			}
 		}
 		}
 
 
+	protected:
 		/**
 		/**
 		 * @brief	Fills the provided buffers with vertices representing a per-pixel line.
 		 * @brief	Fills the provided buffers with vertices representing a per-pixel line.
 		 *
 		 *
@@ -223,7 +232,7 @@ namespace BansheeEngine
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 */
 		 */
-		void line_Pixel(const T& a, const T& b, const Color& color, UINT8* outVertices, UINT8* outColors, 
+		void pixelLine(const T& a, const T& b, const Color& color, UINT8* outVertices, UINT8* outColors, 
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 		{
 		{
 			outVertices += (vertexOffset * vertexStride);
 			outVertices += (vertexOffset * vertexStride);
@@ -262,7 +271,7 @@ namespace BansheeEngine
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 */
 		 */
-		virtual void line_AA(const T& a, const T& b, const T& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors, 
+		virtual void antialiasedLine(const T& a, const T& b, const T& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors, 
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset) = 0;
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset) = 0;
 
 
 		/**
 		/**
@@ -279,7 +288,7 @@ namespace BansheeEngine
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 */
 		 */
-		virtual void polygon_AA(const typename Vector<T>& points, const T& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
+		virtual void antialiasedPolygon(const typename Vector<T>& points, const T& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset) = 0;
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset) = 0;
 
 
 		/**
 		/**
@@ -293,7 +302,7 @@ namespace BansheeEngine
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 */
 		 */
-		void polygonFill_Pixel(const typename Vector<T>& points, UINT8* outVertices, 
+		void pixelSolidPolygon(const typename Vector<T>& points, UINT8* outVertices, 
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 		{
 		{
 			outVertices += (vertexOffset * vertexStride);
 			outVertices += (vertexOffset * vertexStride);
@@ -329,7 +338,7 @@ namespace BansheeEngine
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	outIndices		Output buffer that will store the index data. Indices are 32bit.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 * @param	indexOffset 	Offset in number of indices from the start of the buffer to start writing at.
 		 */
 		 */
-		void polygonBorder_Pixel(const typename Vector<T>& points, const Color& color, UINT8* outVertices, UINT8* outColors, 
+		void pixelWirePolygon(const typename Vector<T>& points, const Color& color, UINT8* outVertices, UINT8* outColors, 
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 			UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 		{
 		{
 			INT32 numPoints = (INT32)points.size();
 			INT32 numPoints = (INT32)points.size();
@@ -337,7 +346,7 @@ namespace BansheeEngine
 			UINT32 curIdxOffset = indexOffset;
 			UINT32 curIdxOffset = indexOffset;
 			for(INT32 i = 0, j = numPoints - 1; i < numPoints; j = i++)
 			for(INT32 i = 0, j = numPoints - 1; i < numPoints; j = i++)
 			{
 			{
-				line_Pixel(points[j], points[i], color, outVertices, outColors, curVertOffset, vertexStride, outIndices, curIdxOffset);
+				pixelLine(points[j], points[i], color, outVertices, outColors, curVertOffset, vertexStride, outIndices, curIdxOffset);
 				curVertOffset += 2;
 				curVertOffset += 2;
 				curIdxOffset += 2;
 				curIdxOffset += 2;
 			}
 			}

+ 25 - 25
BansheeEngine/Source/BsDrawHelper2D.cpp

@@ -23,7 +23,7 @@ namespace BansheeEngine
 		mVertexDesc->addVertElem(VET_COLOR, VES_COLOR);
 		mVertexDesc->addVertElem(VET_COLOR, VES_COLOR);
 	}
 	}
 
 
-	void DrawHelper2D::quad(const RectF& area, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	void DrawHelper2D::solidQuad(const RectF& area, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
 		UINT32* indexData = meshData->getIndices32();
 		UINT32* indexData = meshData->getIndices32();
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
@@ -37,34 +37,34 @@ namespace BansheeEngine
 		points.push_back(Vector2(area.x + area.width, area.y + area.height));
 		points.push_back(Vector2(area.x + area.width, area.y + area.height));
 		points.push_back(Vector2(area.x, area.y + area.height));	
 		points.push_back(Vector2(area.x, area.y + area.height));	
 
 
-		polygonFill_Pixel(points, positionData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
+		pixelSolidPolygon(points, positionData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
 	}
 	}
 
 
-	void DrawHelper2D::line_Pixel(const Vector2& a, const Vector2& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	void DrawHelper2D::pixelLine(const Vector2& a, const Vector2& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
-		DrawHelperTemplate<Vector2>::line_Pixel(a, b, color, meshData, vertexOffset, indexOffset);
+		DrawHelperTemplate<Vector2>::pixelLine(a, b, color, meshData, vertexOffset, indexOffset);
 	}
 	}
 
 
-	void DrawHelper2D::line_AA(const Vector2& a, const Vector2& b, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	void DrawHelper2D::antialiasedLine(const Vector2& a, const Vector2& b, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
-		DrawHelperTemplate<Vector2>::line_AA(a, b, Vector2::ZERO, width, borderWidth, color, meshData, vertexOffset, indexOffset);
+		DrawHelperTemplate<Vector2>::antialiasedLine(a, b, Vector2::ZERO, width, borderWidth, color, meshData, vertexOffset, indexOffset);
 	}
 	}
 
 
-	void DrawHelper2D::lineList_Pixel(const Vector<Vector2>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	void DrawHelper2D::pixelLineList(const Vector<Vector2>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
-		DrawHelperTemplate<Vector2>::lineList_Pixel(linePoints, color, meshData, vertexOffset, indexOffset);
+		DrawHelperTemplate<Vector2>::pixelLineList(linePoints, color, meshData, vertexOffset, indexOffset);
 	}
 	}
 
 
-	void DrawHelper2D::lineList_AA(const Vector<Vector2>& linePoints, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	void DrawHelper2D::antialiasedLineList(const Vector<Vector2>& linePoints, float width, float borderWidth, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
-		DrawHelperTemplate<Vector2>::lineList_AA(linePoints, Vector2::ZERO, width, borderWidth, color, meshData, vertexOffset, indexOffset);
+		DrawHelperTemplate<Vector2>::antialiasedLineList(linePoints, Vector2::ZERO, width, borderWidth, color, meshData, vertexOffset, indexOffset);
 	}
 	}
 
 
 	/************************************************************************/
 	/************************************************************************/
 	/* 								2D - DRAW	                     		*/
 	/* 								2D - DRAW	                     		*/
 	/************************************************************************/
 	/************************************************************************/
 
 
-	void DrawHelper2D::drawQuad(const HCamera& camera, const RectF& area, const Color& color, DebugDrawCoordType coordType, float timeout)
+	void DrawHelper2D::drawSolidQuad(const HCamera& camera, const RectF& area, const Color& color, DebugDrawCoordType coordType, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
 
 
@@ -80,7 +80,7 @@ namespace BansheeEngine
 		if(coordType == DebugDrawCoordType::Normalized)
 		if(coordType == DebugDrawCoordType::Normalized)
 			actualArea = normalizedCoordToClipSpace(area);
 			actualArea = normalizedCoordToClipSpace(area);
 
 
-		quad(actualArea, meshData, 0, 0);
+		solidQuad(actualArea, meshData, 0, 0);
 
 
 		UINT32 vertexStride = mVertexDesc->getVertexStride();
 		UINT32 vertexStride = mVertexDesc->getVertexStride();
 		UINT8* colorData = meshData->getElementData(VES_COLOR);
 		UINT8* colorData = meshData->getElementData(VES_COLOR);
@@ -114,7 +114,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void DrawHelper2D::drawLine_Pixel(const HCamera& camera, const Vector2& a, const Vector2& b, const Color& color, DebugDrawCoordType coordType, float timeout)
+	void DrawHelper2D::drawPixelLine(const HCamera& camera, const Vector2& a, const Vector2& b, const Color& color, DebugDrawCoordType coordType, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
 
 
@@ -134,7 +134,7 @@ namespace BansheeEngine
 			actualB = normalizedCoordToClipSpace(b);
 			actualB = normalizedCoordToClipSpace(b);
 		}
 		}
 
 
-		line_Pixel(actualA, actualB, color, meshData, 0, 0);
+		pixelLine(actualA, actualB, color, meshData, 0, 0);
 
 
 		HMesh mesh = Mesh::create(meshData, MeshBufferType::Static, DOT_LINE_LIST);
 		HMesh mesh = Mesh::create(meshData, MeshBufferType::Static, DOT_LINE_LIST);
 
 
@@ -153,7 +153,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void DrawHelper2D::drawLine_AA(const HCamera& camera, const Vector2& a, const Vector2& b, float width, float borderWidth, const Color& color, DebugDrawCoordType coordType, float timeout)
+	void DrawHelper2D::drawAntialiasedLine(const HCamera& camera, const Vector2& a, const Vector2& b, float width, float borderWidth, const Color& color, DebugDrawCoordType coordType, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
 
 
@@ -173,7 +173,7 @@ namespace BansheeEngine
 			actualB = normalizedCoordToClipSpace(b);
 			actualB = normalizedCoordToClipSpace(b);
 		}
 		}
 
 
-		line_AA(actualA, actualB, width, borderWidth, color, meshData, 0, 0);
+		antialiasedLine(actualA, actualB, width, borderWidth, color, meshData, 0, 0);
 
 
 		HMesh mesh = Mesh::create(meshData);
 		HMesh mesh = Mesh::create(meshData);
 
 
@@ -192,7 +192,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void DrawHelper2D::drawLineList_Pixel(const HCamera& camera, const Vector<Vector2>& linePoints, const Color& color, 
+	void DrawHelper2D::drawPixelLineList(const HCamera& camera, const Vector<Vector2>& linePoints, const Color& color, 
 		DebugDrawCoordType coordType, float timeout)
 		DebugDrawCoordType coordType, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
@@ -213,11 +213,11 @@ namespace BansheeEngine
 			for(UINT32 i = 0; i < numPoints; i++)
 			for(UINT32 i = 0; i < numPoints; i++)
 				points.push_back(normalizedCoordToClipSpace(linePoints[i]));
 				points.push_back(normalizedCoordToClipSpace(linePoints[i]));
 
 
-			lineList_Pixel(points, color, meshData, 0, 0);
+			pixelLineList(points, color, meshData, 0, 0);
 		}
 		}
 		else
 		else
 		{
 		{
-			lineList_Pixel(linePoints, color, meshData, 0, 0);
+			pixelLineList(linePoints, color, meshData, 0, 0);
 		}		
 		}		
 
 
 		HMesh mesh = Mesh::create(meshData, MeshBufferType::Static, DOT_LINE_LIST);
 		HMesh mesh = Mesh::create(meshData, MeshBufferType::Static, DOT_LINE_LIST);
@@ -237,7 +237,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void DrawHelper2D::drawLineList_AA(const HCamera& camera, const Vector<Vector2>& linePoints, float width, float borderWidth, 
+	void DrawHelper2D::drawAntialiasedLineList(const HCamera& camera, const Vector<Vector2>& linePoints, float width, float borderWidth, 
 		const Color& color, DebugDrawCoordType coordType, float timeout)
 		const Color& color, DebugDrawCoordType coordType, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
@@ -257,11 +257,11 @@ namespace BansheeEngine
 			for(UINT32 i = 0; i < numPoints; i++)
 			for(UINT32 i = 0; i < numPoints; i++)
 				points.push_back(normalizedCoordToClipSpace(linePoints[i]));
 				points.push_back(normalizedCoordToClipSpace(linePoints[i]));
 
 
-			lineList_AA(points, width, borderWidth, color, meshData, 0, 0);
+			antialiasedLineList(points, width, borderWidth, color, meshData, 0, 0);
 		}
 		}
 		else
 		else
 		{
 		{
-			lineList_AA(linePoints, width, borderWidth, color, meshData, 0, 0);
+			antialiasedLineList(linePoints, width, borderWidth, color, meshData, 0, 0);
 		}		
 		}		
 
 
 		HMesh mesh = Mesh::create(meshData);
 		HMesh mesh = Mesh::create(meshData);
@@ -281,7 +281,7 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void DrawHelper2D::line_AA(const Vector2& a, const Vector2& b, const Vector2& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
+	void DrawHelper2D::antialiasedLine(const Vector2& a, const Vector2& b, const Vector2& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
 		UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 		UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 	{
 	{
 		Vector2 dir = b - a;
 		Vector2 dir = b - a;
@@ -309,10 +309,10 @@ namespace BansheeEngine
 		points[2] = v2;
 		points[2] = v2;
 		points[3] = v3;
 		points[3] = v3;
 
 
-		polygon_AA(points, up, borderWidth, color, outVertices, outColors, vertexOffset, vertexStride, outIndices, indexOffset);
+		antialiasedPolygon(points, up, borderWidth, color, outVertices, outColors, vertexOffset, vertexStride, outIndices, indexOffset);
 	}
 	}
 
 
-	void DrawHelper2D::polygon_AA(const Vector<Vector2>& points, const Vector2& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
+	void DrawHelper2D::antialiasedPolygon(const Vector<Vector2>& points, const Vector2& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
 		UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 		UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 	{
 	{
 		UINT32 numCoords = (UINT32)points.size();
 		UINT32 numCoords = (UINT32)points.size();

+ 561 - 92
BansheeEngine/Source/BsDrawHelper3D.cpp

@@ -3,6 +3,8 @@
 #include "BsMesh.h"
 #include "BsMesh.h"
 #include "BsTime.h"
 #include "BsTime.h"
 #include "BsVector2.h"
 #include "BsVector2.h"
+#include "BsQuaternion.h"
+#include "BsSphere.h"
 #include "BsMaterial.h"
 #include "BsMaterial.h"
 #include "BsPass.h"
 #include "BsPass.h"
 #include "BsCoreApplication.h"
 #include "BsCoreApplication.h"
@@ -14,6 +16,12 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	inline UINT8* writeVector3(UINT8* buffer, UINT32 stride, const Vector3& value)
+	{
+		*(Vector3*)buffer = value;
+		return buffer + stride;
+	}
+
 	DrawHelper3D::DrawHelper3D()
 	DrawHelper3D::DrawHelper3D()
 	{
 	{
 		mVertexDesc = bs_shared_ptr<VertexDataDesc>();
 		mVertexDesc = bs_shared_ptr<VertexDataDesc>();
@@ -21,44 +29,170 @@ namespace BansheeEngine
 		mVertexDesc->addVertElem(VET_COLOR, VES_COLOR);
 		mVertexDesc->addVertElem(VET_COLOR, VES_COLOR);
 	}
 	}
 
 
-	void DrawHelper3D::aabox(const AABox& box, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	void DrawHelper3D::wireAABox(const AABox& box, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	{
+		UINT32* indexData = meshData->getIndices32();
+		UINT8* positionData = meshData->getElementData(VES_POSITION);
+
+		assert((vertexOffset + 8) <= meshData->getNumVertices());
+		assert((indexOffset + 24) <= meshData->getNumIndices());	
+
+		wireAABox(box, positionData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
+	}
+
+	void DrawHelper3D::solidAABox(const AABox& box, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	{
+		UINT32* indexData = meshData->getIndices32();
+		UINT8* positionData = meshData->getElementData(VES_POSITION);
+		UINT8* normalData = meshData->getElementData(VES_NORMAL);
+
+		assert((vertexOffset + 24) <= meshData->getNumVertices());
+		assert((indexOffset + 36) <= meshData->getNumIndices());
+
+		solidAABox(box, positionData, normalData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
+	}
+
+	void DrawHelper3D::wireSphere(const Sphere& sphere, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality)
+	{
+		UINT32* indexData = meshData->getIndices32();
+		UINT8* positionData = meshData->getElementData(VES_POSITION);
+
+		UINT32 requiredNumVertices = 3 * ((quality + 1) * 4);
+		UINT32 requiredNumIndices = 6 * ((quality + 1) * 4);
+
+		assert((vertexOffset + requiredNumVertices) <= meshData->getNumVertices());
+		assert((indexOffset + requiredNumIndices) <= meshData->getNumIndices());
+
+		UINT32 verticesPerArc = (quality + 1) * 5;
+		UINT32 indicesPerArc = (verticesPerArc - 1) * 2;
+
+		wireDisc(sphere.getCenter(), sphere.getRadius(), Vector3::UNIT_X, meshData,
+			vertexOffset, indexOffset, quality);
+
+		wireDisc(sphere.getCenter(), sphere.getRadius(), Vector3::UNIT_Y, meshData,
+			vertexOffset + verticesPerArc, indexOffset + indicesPerArc, quality);
+
+		wireDisc(sphere.getCenter(), sphere.getRadius(), Vector3::UNIT_Z, meshData,
+			vertexOffset + verticesPerArc * 2, indexOffset + indicesPerArc * 2, quality);
+	}
+
+	void DrawHelper3D::solidSphere(const Sphere& sphere, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality)
+	{
+		UINT32* indexData = meshData->getIndices32();
+		UINT8* positionData = meshData->getElementData(VES_POSITION);
+		UINT8* normalData = meshData->getElementData(VES_NORMAL);
+
+		UINT32 requiredNumVertices = 20 * (4 * ((UINT32)std::pow(3, quality)));
+		UINT32 requiredNumIndices = requiredNumVertices;
+
+		assert((vertexOffset + requiredNumVertices) <= meshData->getNumVertices());
+		assert((indexOffset + requiredNumIndices) <= meshData->getNumIndices());
+
+		solidSphere(sphere, positionData, normalData, vertexOffset, 
+			meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset, quality);
+	}
+
+	void DrawHelper3D::wireDisc(const Vector3& center, float radius, const Vector3& normal, const MeshDataPtr& meshData,
+		UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality)
+	{
+		wireArc(center, radius, normal, Degree(0), Degree(360), meshData, vertexOffset, indexOffset, quality);
+	}
+
+	void DrawHelper3D::solidDisc(const Vector3& center, float radius, const Vector3& normal, const MeshDataPtr& meshData,
+		UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality)
+	{
+		solidArc(center, radius, normal, Degree(0), Degree(360), meshData, vertexOffset, indexOffset, quality);
+	}
+
+	void DrawHelper3D::wireArc(const Vector3& center, float radius, const Vector3& normal, Degree startAngle, Degree amountAngle,
+		const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality)
+	{
+		UINT32* indexData = meshData->getIndices32();
+		UINT8* positionData = meshData->getElementData(VES_POSITION);
+
+		UINT32 requiredNumVertices = (quality + 1) * 5;
+		UINT32 requiredNumIndices = ((quality + 1) * 5 - 1) * 2;
+
+		assert((vertexOffset + requiredNumVertices) <= meshData->getNumVertices());
+		assert((indexOffset + requiredNumIndices) <= meshData->getNumIndices());
+
+		wireArc(center, radius, normal, startAngle, amountAngle, positionData, vertexOffset,
+			meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset, quality);
+	}
+
+	void DrawHelper3D::solidArc(const Vector3& center, float radius, const Vector3& normal, Degree startAngle, Degree amountAngle,
+		const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality)
+	{
+		UINT32* indexData = meshData->getIndices32();
+		UINT8* positionData = meshData->getElementData(VES_POSITION);
+		UINT8* normalData = meshData->getElementData(VES_NORMAL);
+
+		UINT32 requiredNumVertices = (quality + 1) * 5 + 1;
+		UINT32 requiredNumIndices = ((quality + 1) * 5 - 1) * 3;
+
+		assert((vertexOffset + requiredNumVertices) <= meshData->getNumVertices());
+		assert((indexOffset + requiredNumIndices) <= meshData->getNumIndices());
+
+		solidArc(center, radius, normal, startAngle, amountAngle, positionData, normalData, vertexOffset,
+			meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset, quality);
+	}
+
+	void DrawHelper3D::wireFrustum(float aspect, Degree FOV, float near, float far,
+		const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
 		UINT32* indexData = meshData->getIndices32();
 		UINT32* indexData = meshData->getIndices32();
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 
 
 		assert((vertexOffset + 8) <= meshData->getNumVertices());
 		assert((vertexOffset + 8) <= meshData->getNumVertices());
-		assert((indexOffset + 36) <= meshData->getNumIndices());	
+		assert((indexOffset + 24) <= meshData->getNumIndices());
 
 
-		aabox(box, positionData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
+		wireFrustum(aspect, FOV, near, far, positionData, vertexOffset, meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset);
 	}
 	}
 
 
-	void DrawHelper3D::line_Pixel(const Vector3& a, const Vector3& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	void DrawHelper3D::solidCone(const Vector3& base, const Vector3& normal, float height, float radius,
+		const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset, UINT32 quality)
 	{
 	{
-		DrawHelperTemplate<Vector3>::line_Pixel(a, b, color, meshData, vertexOffset, indexOffset);
+		UINT32* indexData = meshData->getIndices32();
+		UINT8* positionData = meshData->getElementData(VES_POSITION);
+		UINT8* normalData = meshData->getElementData(VES_NORMAL);
+
+		UINT32 requiredNumVertices = ((quality + 1) * 4 + 1) * 2;
+		UINT32 requiredNumIndices = ((quality + 1) * 4 - 1) * 6;
+
+		assert((vertexOffset + requiredNumVertices) <= meshData->getNumVertices());
+		assert((indexOffset + requiredNumIndices) <= meshData->getNumIndices());
+
+		solidCone(base, normal, height, radius, positionData, normalData, vertexOffset,
+			meshData->getVertexDesc()->getVertexStride(), indexData, indexOffset, quality);
+	}
+
+	void DrawHelper3D::pixelLine(const Vector3& a, const Vector3& b, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	{
+		DrawHelperTemplate<Vector3>::pixelLine(a, b, color, meshData, vertexOffset, indexOffset);
 	}
 	}
 
 
-	void DrawHelper3D::line_AA(const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, 
+	void DrawHelper3D::antialiasedLine(const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, 
 		const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 		const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
-		DrawHelperTemplate<Vector3>::line_AA(a, b, up, width, borderWidth, color, meshData, vertexOffset, indexOffset);
+		DrawHelperTemplate<Vector3>::antialiasedLine(a, b, up, width, borderWidth, color, meshData, vertexOffset, indexOffset);
 	}
 	}
 
 
-	void DrawHelper3D::lineList_Pixel(const Vector<Vector3>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
+	void DrawHelper3D::pixelLineList(const Vector<Vector3>& linePoints, const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
-		DrawHelperTemplate<Vector3>::lineList_Pixel(linePoints, color, meshData, vertexOffset, indexOffset);
+		DrawHelperTemplate<Vector3>::pixelLineList(linePoints, color, meshData, vertexOffset, indexOffset);
 	}
 	}
 
 
-	void DrawHelper3D::lineList_AA(const Vector<Vector3>& linePoints, const Vector3& up, float width, float borderWidth, 
+	void DrawHelper3D::antialiasedLineList(const Vector<Vector3>& linePoints, const Vector3& up, float width, float borderWidth, 
 		const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 		const Color& color, const MeshDataPtr& meshData, UINT32 vertexOffset, UINT32 indexOffset)
 	{
 	{
-		DrawHelperTemplate<Vector3>::lineList_AA(linePoints, up, width, borderWidth, color, meshData, vertexOffset, indexOffset);
+		DrawHelperTemplate<Vector3>::antialiasedLineList(linePoints, up, width, borderWidth, color, meshData, vertexOffset, indexOffset);
 	}
 	}
 
 
 	/************************************************************************/
 	/************************************************************************/
 	/* 								DRAW	                     			*/
 	/* 								DRAW	                     			*/
 	/************************************************************************/
 	/************************************************************************/
 
 
-	void DrawHelper3D::drawLine_Pixel(const HCamera& camera, const Vector3& a, const Vector3& b, const Color& color, float timeout)
+	void DrawHelper3D::drawPixelLine(const HCamera& camera, const Vector3& a, const Vector3& b, const Color& color, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
 
 
@@ -70,7 +204,7 @@ namespace BansheeEngine
 
 
 		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>(2, 2, mVertexDesc);
 		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>(2, 2, mVertexDesc);
 
 
-		line_Pixel(a, b, color, meshData, 0, 0);
+		pixelLine(a, b, color, meshData, 0, 0);
 
 
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
@@ -82,7 +216,7 @@ namespace BansheeEngine
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 	}
 	}
 
 
-	void DrawHelper3D::drawLine_AA(const HCamera& camera, const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, const Color& color, float timeout)
+	void DrawHelper3D::drawAntialiasedLine(const HCamera& camera, const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, const Color& color, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
 
 
@@ -94,7 +228,7 @@ namespace BansheeEngine
 
 
 		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>(8, 30, mVertexDesc);
 		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>(8, 30, mVertexDesc);
 
 
-		line_AA(a, b, up, width, borderWidth, color, meshData, 0, 0);
+		antialiasedLine(a, b, up, width, borderWidth, color, meshData, 0, 0);
 
 
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
@@ -106,7 +240,7 @@ namespace BansheeEngine
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 	}
 	}
 
 
-	void DrawHelper3D::drawLineList_Pixel(const HCamera& camera, const Vector<Vector3>& linePoints, const Color& color, float timeout)
+	void DrawHelper3D::drawPixelLineList(const HCamera& camera, const Vector<Vector3>& linePoints, const Color& color, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
 
 
@@ -119,7 +253,7 @@ namespace BansheeEngine
 		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>(
 		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>(
 			(UINT32)(linePoints.size() * 2), (UINT32)(linePoints.size() * 2), mVertexDesc);
 			(UINT32)(linePoints.size() * 2), (UINT32)(linePoints.size() * 2), mVertexDesc);
 
 
-		lineList_Pixel(linePoints, color, meshData, 0, 0);
+		pixelLineList(linePoints, color, meshData, 0, 0);
 
 
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
@@ -131,7 +265,7 @@ namespace BansheeEngine
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 	}
 	}
 
 
-	void DrawHelper3D::drawLineList_AA(const HCamera& camera, const Vector<Vector3>& linePoints, const Vector3& up, float width, float borderWidth,
+	void DrawHelper3D::drawAntialiasedLineList(const HCamera& camera, const Vector<Vector3>& linePoints, const Vector3& up, float width, float borderWidth,
 		const Color& color, float timeout)
 		const Color& color, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
@@ -144,7 +278,7 @@ namespace BansheeEngine
 
 
 		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>((UINT32)(linePoints.size() * 4), (UINT32)(linePoints.size() * 15), mVertexDesc);
 		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>((UINT32)(linePoints.size() * 4), (UINT32)(linePoints.size() * 15), mVertexDesc);
 
 
-		lineList_AA(linePoints, up, width, borderWidth, color, meshData, 0, 0);	
+		antialiasedLineList(linePoints, up, width, borderWidth, color, meshData, 0, 0);	
 
 
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
@@ -156,7 +290,7 @@ namespace BansheeEngine
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 	}
 	}
 
 
-	void DrawHelper3D::drawAABox(const HCamera& camera, const AABox& box, const Color& color, float timeout)
+	void DrawHelper3D::drawWireAABox(const HCamera& camera, const AABox& box, const Color& color, float timeout)
 	{
 	{
 		const Viewport* viewport = camera->getViewport().get();
 		const Viewport* viewport = camera->getViewport().get();
 
 
@@ -166,9 +300,9 @@ namespace BansheeEngine
 		DebugDrawCommand& dbgCmd = commands.back();
 		DebugDrawCommand& dbgCmd = commands.back();
 		dbgCmd.endTime = gTime().getTime() + timeout;
 		dbgCmd.endTime = gTime().getTime() + timeout;
 
 
-		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>(8, 36, mVertexDesc);
+		MeshDataPtr meshData = bs_shared_ptr<MeshData, ScratchAlloc>(8, 24, mVertexDesc);
 
 
-		aabox(box, meshData, 0, 0);	
+		wireAABox(box, meshData, 0, 0);	
 
 
 		UINT32 vertexStride = mVertexDesc->getVertexStride();
 		UINT32 vertexStride = mVertexDesc->getVertexStride();
 		UINT8* colorData = meshData->getElementData(VES_COLOR);
 		UINT8* colorData = meshData->getElementData(VES_COLOR);
@@ -184,106 +318,360 @@ namespace BansheeEngine
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		UINT8* positionData = meshData->getElementData(VES_POSITION);
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
 		dbgCmd.worldCenter = calcCenter(positionData, meshData->getNumVertices(), mVertexDesc->getVertexStride());
 
 
-		HMesh mesh = Mesh::create(meshData);
+		HMesh mesh = Mesh::create(meshData, MeshBufferType::Static, DOT_LINE_LIST);
 
 
 		dbgCmd.mesh = mesh;
 		dbgCmd.mesh = mesh;
 		dbgCmd.type = DebugDrawType::WorldSpace;
 		dbgCmd.type = DebugDrawType::WorldSpace;
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 		dbgCmd.matInfo3D = BuiltinResources::instance().createDebugDraw3DMaterial();
 	}
 	}
 
 
-	void DrawHelper3D::aabox(const AABox& box, UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
+	void DrawHelper3D::wireAABox(const AABox& box, UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
+	{
+		outVertices += vertexOffset * vertexStride;
+
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_LEFT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_RIGHT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_RIGHT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_LEFT_TOP));
+
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_RIGHT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_LEFT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_LEFT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_RIGHT_TOP));
+
+		outIndices += indexOffset;
+
+		// Front
+		outIndices[0] = vertexOffset + 0;
+		outIndices[1] = vertexOffset + 1;
+
+		outIndices[2] = vertexOffset + 1;
+		outIndices[3] = vertexOffset + 2;
+
+		outIndices[4] = vertexOffset + 2;
+		outIndices[5] = vertexOffset + 3;
+
+		outIndices[6] = vertexOffset + 3;
+		outIndices[7] = vertexOffset + 0;
+
+		// Center
+		outIndices[8] = vertexOffset + 0;
+		outIndices[9] = vertexOffset + 5;
+
+		outIndices[10] = vertexOffset + 1;
+		outIndices[11] = vertexOffset + 4;
+
+		outIndices[12] = vertexOffset + 2;
+		outIndices[13] = vertexOffset + 7;
+
+		outIndices[14] = vertexOffset + 3;
+		outIndices[15] = vertexOffset + 6;
+
+		// Back
+		outIndices[16] = vertexOffset + 4;
+		outIndices[17] = vertexOffset + 5;
+
+		outIndices[18] = vertexOffset + 5;
+		outIndices[19] = vertexOffset + 6;
+
+		outIndices[20] = vertexOffset + 6;
+		outIndices[21] = vertexOffset + 7;
+
+		outIndices[22] = vertexOffset + 7;
+		outIndices[23] = vertexOffset + 4;
+	}
+
+	void DrawHelper3D::solidAABox(const AABox& box, UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride,
+		UINT32* outIndices, UINT32 indexOffset)
 	{
 	{
 		outVertices += (vertexOffset * vertexStride);
 		outVertices += (vertexOffset * vertexStride);
+		Vector3* corners = (Vector3*)outVertices;
+
+		// Front face
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_LEFT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_RIGHT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_RIGHT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_LEFT_TOP));
+
+		// Back face
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_RIGHT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_LEFT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_LEFT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_RIGHT_TOP));
+
+		// Left face
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_LEFT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_LEFT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_LEFT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_LEFT_TOP));
+
+		// Right face
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_RIGHT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_RIGHT_BOTTOM));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_RIGHT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_RIGHT_TOP));
+
+		// Top face
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_LEFT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_LEFT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_RIGHT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_RIGHT_TOP));
+
+		// Bottom face
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_LEFT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_LEFT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::NEAR_RIGHT_TOP));
+		outVertices = writeVector3(outVertices, vertexStride, box.getCorner(AABox::FAR_RIGHT_TOP));
+
+		static const Vector3 faceNormals[6] = 
+		{
+			Vector3(0, 0, 1),
+			Vector3(0, 0, -1),
+			Vector3(0, 1, 0),
+			Vector3(0, -1, 0),
+			Vector3(1, 0, 0),
+			Vector3(-1, 0, 0)
+		};
+
+		outNormals += (vertexOffset + vertexStride);
+		for (UINT32 face = 0; face < 6; face++)
+		{
+			outNormals = writeVector3(outNormals, vertexStride, faceNormals[face]);
+			outNormals = writeVector3(outNormals, vertexStride, faceNormals[face]);
+			outNormals = writeVector3(outNormals, vertexStride, faceNormals[face]);
+			outNormals = writeVector3(outNormals, vertexStride, faceNormals[face]);
+		}
+
+		UINT32* indices = outIndices + indexOffset;
+		for (UINT32 face = 0; face < 6; face++)
+		{
+			UINT32 faceVertOffset = vertexOffset + face * 4;
+
+			indices[face * 6 + 0] = faceVertOffset + 0;
+			indices[face * 6 + 1] = faceVertOffset + 1;
+			indices[face * 6 + 2] = faceVertOffset + 2;
+			indices[face * 6 + 3] = faceVertOffset + 2;
+			indices[face * 6 + 3] = faceVertOffset + 3;
+			indices[face * 6 + 3] = faceVertOffset + 0;
+		}
+	}
 
 
-		Vector3 pt;
+	void DrawHelper3D::solidSphere(const Sphere& sphere, UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, 
+		UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset, UINT32 quality)
+	{
+		// Create icosahedron
+		static const float x = 0.525731112119133606f;
+		static const float z = 0.850650808352039932f;
 
 
-		pt = box.getCorner(AABox::FAR_LEFT_BOTTOM);
-		memcpy(outVertices, &pt, sizeof(pt));
-		outVertices += vertexStride;
+		static const Vector3 vertices[12] = 
+		{
+			Vector3(-x,		0.0f,	z),
+			Vector3(x,		0.0f,	z),
+			Vector3(-x,		0.0f,	-z),
+			Vector3(x,		0.0f,	-z),
+			Vector3(0.0f,	z,		x),
+			Vector3(0.0f,	z,		-x),
+			Vector3(0.0f,	-z,		x),
+			Vector3(0.0f,	-z,		-x),
+			Vector3(z,		x,		0.0f),
+			Vector3(-z,		x,		0.0f),
+			Vector3(z,		-x,		0.0f),
+			Vector3(-z,		-x,		0.0f)
+		};
+
+		static const UINT32 triangles[20][3] = 
+		{
+				{ 0, 4, 1 },  { 0, 9, 4 },	{ 9, 5, 4 },	{ 4, 5, 8 },
+				{ 4, 8, 1 },  { 8, 10, 1 }, { 8, 3, 10 },	{ 5, 3, 8 },
+				{ 5, 2, 3 },  { 2, 7, 3 },	{ 7, 10, 3 },	{ 7, 6, 10 },
+				{ 7, 11, 6 }, { 11, 0, 6 }, { 0, 1, 6 },	{ 6, 1, 10 },
+				{ 9, 0, 11 }, { 9, 11, 2 }, { 9, 2, 5 },	{ 7, 2, 11 }
+		};
+
+		// Tessellate it
+		UINT32 curVertOffset = vertexOffset;
+		for (int i = 0; i < 20; ++i) 
+		{
+			curVertOffset += subdivideTriangleOnSphere(sphere.getCenter(), sphere.getRadius(), quality,
+				vertices[triangles[i][0]], vertices[triangles[i][1]], vertices[triangles[i][2]],
+				outVertices, outNormals, curVertOffset, vertexStride);
+		}
 
 
-		pt = box.getCorner(AABox::FAR_RIGHT_BOTTOM);
-		memcpy(outVertices, &pt, sizeof(pt));
-		outVertices += vertexStride;
+		// Create indices
+		outIndices += indexOffset;
 
 
-		pt = box.getCorner(AABox::FAR_LEFT_TOP);
-		memcpy(outVertices, &pt, sizeof(pt));
-		outVertices += vertexStride;
+		UINT32 numTriangles = 20 * (3 * ((UINT32)std::pow(4L, (long)quality)));
+		for (UINT32 i = 0; i < numTriangles * 3; i += 3)
+		{
+			outIndices[i] = vertexOffset + i;
+			outIndices[i + 1] = vertexOffset + i + 1;
+			outIndices[i + 2] = vertexOffset + i + 2;
+		}
+	}
 
 
-		pt = box.getCorner(AABox::FAR_RIGHT_TOP);
-		memcpy(outVertices, &pt, sizeof(pt));
-		outVertices += vertexStride;
+	void DrawHelper3D::wireArc(const Vector3& center, float radius, const Vector3& normal, Degree startAngle, Degree amountAngle, 
+		UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset, UINT32 quality)
+	{
+		UINT32 numVertices = (quality + 1) * 5;
 
 
-		pt = box.getCorner(AABox::NEAR_LEFT_BOTTOM);
-		memcpy(outVertices, &pt, sizeof(pt));
-		outVertices += vertexStride;
+		generateArcVertices(center, normal, radius, startAngle, amountAngle,
+			numVertices, outVertices, vertexOffset, vertexStride);
 
 
-		pt = box.getCorner(AABox::NEAR_RIGHT_BOTTOM);
-		memcpy(outVertices, &pt, sizeof(pt));
-		outVertices += vertexStride;
+		outIndices += indexOffset;
+		UINT32 numLines = numVertices - 1;
+		for (UINT32 i = 0; i < numLines; i++)
+		{
+			outIndices[i * 2 + 0] = vertexOffset + i;
+			outIndices[i * 2 + 1] = vertexOffset + i + 1;
+		}
+	}
 
 
-		pt = box.getCorner(AABox::NEAR_LEFT_TOP);
-		memcpy(outVertices, &pt, sizeof(pt));
-		outVertices += vertexStride;
+	void DrawHelper3D::solidArc(const Vector3& center, float radius, const Vector3& normal, Degree startAngle, Degree amountAngle, 
+		UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset, UINT32 quality)
+	{
+		Vector3* centerVertex = (Vector3*)(outVertices + (vertexOffset * vertexStride));
+		*centerVertex = center;
 
 
-		pt = box.getCorner(AABox::NEAR_RIGHT_TOP);
-		memcpy(outVertices, &pt, sizeof(pt));
-		outVertices += vertexStride;
+		UINT32 numArcVertices = (quality + 1) * 5;
+		generateArcVertices(center, normal, radius, startAngle, amountAngle,
+			numArcVertices, outVertices, vertexOffset + 1, vertexStride);
+
+		UINT32 totalNumVertices = numArcVertices + 1;
+		outNormals += vertexOffset * vertexStride;
+		for (UINT32 i = 0; i < totalNumVertices; i++)
+		{
+			outNormals = writeVector3(outNormals, vertexStride, normal);
+		}
+
+		outIndices += indexOffset;
+		UINT32 numTriangles = numArcVertices - 1;
+		for (UINT32 i = 0; i < numTriangles; i++)
+		{
+			outIndices[i * 3 + 0] = vertexOffset + 0;
+			outIndices[i * 3 + 1] = vertexOffset + i;
+			outIndices[i * 3 + 2] = vertexOffset + i + 1;
+		}
+	}
+
+	void DrawHelper3D::wireFrustum(float aspect, Degree FOV, float near, float far,
+		UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
+	{
+		float fovTan = Math::tan(FOV);
+
+		Vector3 nearPoint(0, 0, near);
+		Vector3 nearWidth(near * fovTan * aspect, 0, 0);
+		Vector3 nearHeight(0, (near * fovTan) / aspect, 0);
+
+		Vector3 farPoint(0, 0, far);
+		Vector3 farWidth(far * fovTan * aspect, 0, 0);
+		Vector3 farHeight(0, (far * fovTan) / aspect, 0);
+
+		Vector3 points[8] = 
+		{
+			nearPoint + nearWidth + nearHeight,
+			nearPoint - nearWidth + nearHeight,
+			nearPoint - nearWidth - nearHeight,
+			nearPoint + nearWidth - nearHeight,
+			farPoint + farWidth + farHeight,
+			farPoint - farWidth + farHeight,
+			farPoint - farWidth - farHeight,
+			farPoint + farWidth - farHeight
+		};
+
+		outVertices += vertexOffset * vertexStride;
+
+		for (UINT32 i = 0; i < 8; i++)
+			outVertices = writeVector3(outVertices, vertexStride, points[i]);
 
 
 		outIndices += indexOffset;
 		outIndices += indexOffset;
 
 
 		// Front
 		// Front
-		outIndices[0] = vertexOffset + 6;
-		outIndices[1] = vertexOffset + 7;
-		outIndices[2] = vertexOffset + 5;
+		outIndices[0] = vertexOffset + 0; outIndices[1] = vertexOffset + 1;
+		outIndices[2] = vertexOffset + 1; outIndices[3] = vertexOffset + 2;
+		outIndices[4] = vertexOffset + 2; outIndices[5] = vertexOffset + 3;
+		outIndices[6] = vertexOffset + 3; outIndices[7] = vertexOffset + 0;
 
 
-		outIndices[3] = vertexOffset + 6;
-		outIndices[4] = vertexOffset + 5;
-		outIndices[5] = vertexOffset + 4;
+		// Center
+		outIndices[8] = vertexOffset + 0; outIndices[9] = vertexOffset + 4;
+		outIndices[10] = vertexOffset + 1; outIndices[11] = vertexOffset + 5;
+		outIndices[12] = vertexOffset + 2; outIndices[13] = vertexOffset + 6;
+		outIndices[14] = vertexOffset + 3; outIndices[15] = vertexOffset + 7;
 
 
 		// Back
 		// Back
-		outIndices[6] = vertexOffset + 2;
-		outIndices[7] = vertexOffset + 1;
-		outIndices[8] = vertexOffset + 3;
+		outIndices[16] = vertexOffset + 4; outIndices[17] = vertexOffset + 5;
+		outIndices[18] = vertexOffset + 5; outIndices[19] = vertexOffset + 6;
+		outIndices[20] = vertexOffset + 6; outIndices[21] = vertexOffset + 7;
+		outIndices[22] = vertexOffset + 7; outIndices[23] = vertexOffset + 4;
+	}
 
 
-		outIndices[9] = vertexOffset + 2;
-		outIndices[10] = vertexOffset + 0;
-		outIndices[11] = vertexOffset + 1;
+	void DrawHelper3D::solidCone(const Vector3& base, const Vector3& normal, float height, float radius,
+		UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset, UINT32 quality)
+	{
+		outVertices += vertexOffset * vertexStride;
+		outNormals += vertexOffset * vertexStride;
+		outIndices += indexOffset;
 
 
-		// Left
-		outIndices[12] = vertexOffset + 2;
-		outIndices[13] = vertexOffset + 6;
-		outIndices[14] = vertexOffset + 4;
+		// Generate base disc
+		UINT32 numArcVertices = (quality + 1) * 4;
 
 
-		outIndices[15] = vertexOffset + 2;
-		outIndices[16] = vertexOffset + 4;
-		outIndices[17] = vertexOffset + 0;
+		generateArcVertices(base, normal, radius, Degree(0), Degree(360),
+			numArcVertices + 1, outVertices, 0, vertexStride);
 
 
-		// Right
-		outIndices[18] = vertexOffset + 7;
-		outIndices[19] = vertexOffset + 3;
-		outIndices[20] = vertexOffset + 1;
+		outVertices += numArcVertices * vertexStride;
+		outVertices = writeVector3(outVertices, vertexStride, base); // Write base vertex
 
 
-		outIndices[21] = vertexOffset + 7;
-		outIndices[22] = vertexOffset + 1;
-		outIndices[23] = vertexOffset + 5;
+		UINT32 baseIdx = numArcVertices;
 
 
-		// Top
-		outIndices[24] = vertexOffset + 6;
-		outIndices[25] = vertexOffset + 2;
-		outIndices[26] = vertexOffset + 3;
+		UINT32 totalNumBaseVertices = numArcVertices + 1;
+		for (UINT32 i = 0; i < totalNumBaseVertices; i++)
+		{
+			outNormals = writeVector3(outNormals, vertexStride, -normal);
+		}
+
+		UINT32 numTriangles = numArcVertices;
+		for (UINT32 i = 0; i < numTriangles; i++)
+		{
+			outIndices[i * 3 + 0] = vertexOffset + baseIdx;
+			outIndices[i * 3 + 1] = vertexOffset + i;
+			outIndices[i * 3 + 2] = vertexOffset + i + 1;
+		}
+
+		// Generate cone
+		generateArcVertices(base, normal, radius, Degree(0), Degree(360),
+			numArcVertices + 1, outVertices, 0, vertexStride);
+
+		Vector3 topVertex = base + normal * height;
+
+		UINT32 totalNumConeVertices = numArcVertices;
+		for (UINT32 i = 0; i < totalNumConeVertices; i++)
+		{
+			int offsetA = i;
+			int offsetB = (i + 1) % totalNumConeVertices;
+
+			Vector3* a = (Vector3*)(outVertices + (offsetA * vertexStride));
+			Vector3* b = (Vector3*)(outVertices + (offsetB * vertexStride));
+
+			Vector3 triNormal = *a - topVertex;
+			triNormal = triNormal.cross(*b - topVertex);
+			triNormal.normalize();
+
+			outNormals = writeVector3(outNormals, vertexStride, triNormal); // TODO - Smooth normals?
+		}
 
 
-		outIndices[27] = vertexOffset + 6;
-		outIndices[28] = vertexOffset + 3;
-		outIndices[29] = vertexOffset + 7;
+		*(Vector3*)outNormals = normal;
 
 
-		// Bottom
-		outIndices[30] = vertexOffset + 5;
-		outIndices[31] = vertexOffset + 1;
-		outIndices[32] = vertexOffset + 0;
+		outVertices += numArcVertices * vertexStride;
+		outVertices = writeVector3(outVertices, vertexStride, topVertex); // Write top vertex
+		UINT32 topIdx = numArcVertices * 2 + 2;
 
 
-		outIndices[33] = vertexOffset + 5;
-		outIndices[34] = vertexOffset + 0;
-		outIndices[35] = vertexOffset + 4;
+		outIndices += numTriangles * 3;
+		UINT32 curVertOffset = vertexOffset + numArcVertices + 1;
+		for (UINT32 i = 0; i < numTriangles; i++)
+		{
+			outIndices[i * 3 + 0] = curVertOffset + topIdx;
+			outIndices[i * 3 + 1] = curVertOffset + i;
+			outIndices[i * 3 + 2] = curVertOffset + i + 1;
+		}
 	}
 	}
 
 
 	Vector3 DrawHelper3D::calcCenter(UINT8* vertices, UINT32 numVertices, UINT32 vertexStride)
 	Vector3 DrawHelper3D::calcCenter(UINT8* vertices, UINT32 numVertices, UINT32 vertexStride)
@@ -301,7 +689,7 @@ namespace BansheeEngine
 		return center;
 		return center;
 	}
 	}
 
 
-	void DrawHelper3D::line_AA(const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
+	void DrawHelper3D::antialiasedLine(const Vector3& a, const Vector3& b, const Vector3& up, float width, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
 		UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 		UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 	{
 	{
 		Vector3 dir = b - a;
 		Vector3 dir = b - a;
@@ -326,10 +714,10 @@ namespace BansheeEngine
 		points[2] = v2;
 		points[2] = v2;
 		points[3] = v3;
 		points[3] = v3;
 
 
-		polygon_AA(points, up, borderWidth, color, outVertices, outColors, vertexOffset, vertexStride, outIndices, indexOffset);
+		antialiasedPolygon(points, up, borderWidth, color, outVertices, outColors, vertexOffset, vertexStride, outIndices, indexOffset);
 	}
 	}
 
 
-	void DrawHelper3D::polygon_AA(const Vector<Vector3>& points, const Vector3& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
+	void DrawHelper3D::antialiasedPolygon(const Vector<Vector3>& points, const Vector3& up, float borderWidth, const Color& color, UINT8* outVertices, UINT8* outColors,
 		UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 		UINT32 vertexOffset, UINT32 vertexStride, UINT32* outIndices, UINT32 indexOffset)
 	{
 	{
 		UINT32 numCoords = (UINT32)points.size();
 		UINT32 numCoords = (UINT32)points.size();
@@ -415,4 +803,85 @@ namespace BansheeEngine
 			outIndices[idxCnt++] = vertexOffset + i;
 			outIndices[idxCnt++] = vertexOffset + i;
 		}
 		}
 	}
 	}
+
+	UINT32 DrawHelper3D::subdivideTriangleOnSphere(const Vector3& center, float radius, UINT32 numLevels,
+		const Vector3& a, const Vector3& b, const Vector3& c,
+		UINT8* outVertices, UINT8* outNormals, UINT32 vertexOffset, UINT32 vertexStride)
+	{
+		outVertices += (vertexOffset * vertexStride);
+		outNormals += (vertexOffset * vertexStride);
+
+		UINT32 numVertices = 0;
+
+		if (numLevels > 0)
+		{
+			Vector3 sub1 = Vector3::normalize((a + b) * 0.5f);
+			Vector3 sub2 = Vector3::normalize((b + c) * 0.5f);
+			Vector3 sub3 = Vector3::normalize((c + a) * 0.5f);
+
+			numLevels--;
+			UINT32 curVertOffset = vertexOffset + numVertices;
+
+			numVertices += subdivideTriangleOnSphere(center, radius, numLevels, a, sub1, sub3, outVertices, 
+				outNormals, vertexOffset + numVertices, vertexStride);
+			numVertices += subdivideTriangleOnSphere(center, radius, numLevels, sub1, b, sub2, outVertices, 
+				outNormals, vertexOffset + numVertices, vertexStride);
+			numVertices += subdivideTriangleOnSphere(center, radius, numLevels, sub1, sub2, sub3, outVertices, 
+				outNormals, vertexOffset + numVertices, vertexStride);
+			numVertices += subdivideTriangleOnSphere(center, radius, numLevels, sub3, sub2, c, outVertices, 
+				outNormals, vertexOffset + numVertices, vertexStride);
+		}
+		else
+		{
+			*((Vector3*)outVertices) = center + a * radius;
+			*((Vector3*)outNormals) = a;
+
+			outVertices += vertexStride;
+			outNormals += vertexStride;
+
+			*((Vector3*)outVertices) = center + b * radius;
+			*((Vector3*)outNormals) = b;
+
+			outVertices += vertexStride;
+			outNormals += vertexStride;
+
+			*((Vector3*)outVertices) = center + c * radius;
+			*((Vector3*)outNormals) = c;
+
+			outVertices += vertexStride;
+			outNormals += vertexStride;
+
+			numVertices += 3;
+		}
+
+		return numVertices;
+	}
+
+	void DrawHelper3D::generateArcVertices(const Vector3& center, const Vector3& up, float radius, Degree startAngle, Degree angleAmount, UINT32 numVertices,
+		UINT8* outVertices, UINT32 vertexOffset, UINT32 vertexStride)
+	{
+		assert(numVertices >= 2);
+
+		Vector3 normalizedUp = Vector3::normalize(up);
+		Vector3 right;
+
+		if (Math::abs(normalizedUp.dot(Vector3::UNIT_Z)) <= 0.95f)
+			right = normalizedUp.cross(Vector3::UNIT_Z);
+		else
+			right = normalizedUp.cross(Vector3::UNIT_Y);
+
+		right.normalize();
+		Quaternion moveToStart(up, startAngle);
+		Vector3 start = moveToStart.rotate(right);
+
+		Quaternion increment(up, angleAmount / (float)(numVertices - 1));
+
+		outVertices += vertexOffset * vertexStride;
+		Vector3 curDirection = start * radius;
+		for (UINT32 i = 0; i < numVertices; i++)
+		{
+			outVertices = writeVector3(outVertices, vertexStride, center + curDirection);
+			curDirection = increment.rotate(curDirection);
+		}
+	}
 }
 }

+ 4 - 1
SceneView.txt

@@ -2,9 +2,12 @@
 TODO:
 TODO:
  - Core thread gets stuck on shutdown when OpenGL is used...Somewhere in kernel
  - Core thread gets stuck on shutdown when OpenGL is used...Somewhere in kernel
 
 
-Weekend:
+IMMEDIATE:
  - SceneGrid is very ugly. Consider using default lines for now and come back with a better approach later.
  - SceneGrid is very ugly. Consider using default lines for now and come back with a better approach later.
  - In Picking code I don't set main texture when rendering with alpha
  - In Picking code I don't set main texture when rendering with alpha
+ - Picking code is completely untested and will likely need major fixing
+ - Disable DX9 for editor as I will likely want to use geometry shaders for icon rendering, and possibly new AA line shader
+   - Or just use MeshHeap and update the icon/lines every frame?
 
 
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 Handles
 Handles