From 4ea4bbfcb03091cb987dc151d41980ec16f3d18d Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 8 Apr 2019 22:31:12 +0800 Subject: *misc --- source/modules/asura-core/mesh/mesh2d_data.h | 58 ++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'source/modules/asura-core/mesh/mesh2d_data.h') 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 +#include +#include + +#include + +#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 + { + public: + + void Decode(AEIO::DataBuffer& buffer) override; + + private: + + /// + /// mesh的所有顶点。 + /// + std::vector mVertices; + + /// + /// 索引,用来构建ebo。 + /// + std::vector mIndices; + + }; + + } +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0