summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/mesh/mesh2d_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/modules/asura-core/mesh/mesh2d_data.h')
-rw-r--r--source/modules/asura-core/mesh/mesh2d_data.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/source/modules/asura-core/mesh/mesh2d_data.h b/source/modules/asura-core/mesh/mesh2d_data.h
index e69de29..ad4b6c8 100644
--- a/source/modules/asura-core/mesh/mesh2d_data.h
+++ b/source/modules/asura-core/mesh/mesh2d_data.h
@@ -0,0 +1,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֧��4��UV������һ�������ϡ�
+ ///
+ 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 \ No newline at end of file