summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/mesh/mesh2d_data.h
blob: ad4b6c8c0ca0a70207d36bff3d96a763a2730b9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __ASURA_MESH2D_DATA_H__
#define __ASURA_MESH2D_DATA_H__

#include <asura-utils/scripting/portable.hpp>
#include <asura-utils/math/vector2.hpp>
#include <asura-utils/io/decoded_data.h>

#include <vector>

#include "../graphics/color.h"
#include "../graphics/gpu_buffer.h"

namespace AsuraEngine
{
	namespace Mesh
	{

		///
		/// Mesh2DĶݣindexʹáAsura 2D mesh֧4UVһϡ
		///
		struct Vertex
		{
			AEMath::Vector2f  position;    ///< 
			AEMath::Vector2f  tangent;     ///< 
			AEMath::Vector2f  normal;      ///< 
			AEGraphics::Color color;       ///< ɫ
			AEMath::Vector2f  texCoord[4]; ///< UVs
		};

		///
		/// meshĶݺ
		///
		class Mesh2DData 
			: AEIO::DecodedData
			, AEScripting::Portable<Mesh2DData>
		{
		public: 

			void Decode(AEIO::DataBuffer& buffer) override;
			
		private: 

			///
			/// meshж㡣
			///
			std::vector<Vertex*> mVertices;

			///
			/// ebo
			///
			std::vector<float> mIndices; 

		};

	}
}

#endif