summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/mesh/mesh2d_data.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-05-02 21:42:09 +0800
committerchai <chaifix@163.com>2019-05-02 21:42:09 +0800
commit59a0e32991b5b714b6bdba504b6fbacdcd4b907a (patch)
tree763d10da51491ea88416e159651e97c9193673d8 /source/modules/asura-core/mesh/mesh2d_data.h
parent866e00474be3bfe0e7dac73b720af0b9ebf7109a (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/mesh/mesh2d_data.h')
-rw-r--r--source/modules/asura-core/mesh/mesh2d_data.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/source/modules/asura-core/mesh/mesh2d_data.h b/source/modules/asura-core/mesh/mesh2d_data.h
index 78b2427..8cb9723 100644
--- a/source/modules/asura-core/mesh/mesh2d_data.h
+++ b/source/modules/asura-core/mesh/mesh2d_data.h
@@ -1,12 +1,15 @@
#ifndef __ASURA_MESH2D_DATA_H__
#define __ASURA_MESH2D_DATA_H__
+// cpp
+#include <vector>
+
+// asura modules
#include <asura-utils/scripting/portable.hpp>
#include <asura-utils/math/vector2.hpp>
#include <asura-utils/io/decoded_data.h>
-#include <vector>
-
+// module
#include "../graphics/color.h"
#include "../graphics/gpu_buffer.h"
@@ -21,8 +24,6 @@ namespace AsuraEngine
struct Vertex
{
AEMath::Vector2f position; ///<
- AEMath::Vector2f tangent; ///<
- AEMath::Vector2f normal; ///<
AEGraphics::Color color; ///< ɫ
AEMath::Vector2f texCoord[4]; ///< UVs
};
@@ -36,11 +37,26 @@ namespace AsuraEngine
{
public:
+ enum Mesh2DComponent
+ {
+ MESH2D_COMPONENT_POSITION,
+ MESH2D_COMPONENT_COLOR,
+ MESH2D_COMPONENT_TEXCOORD0,
+ MESH2D_COMPONENT_TEXCOORD1,
+ MESH2D_COMPONENT_TEXCOORD2,
+ MESH2D_COMPONENT_TEXCOORD3,
+ };
+
void Decode(AEIO::DataBuffer& buffer) override;
private:
LUAX_DECL_FACTORY(Mesh2DData);
+
+ LUAX_DECL_ENUM(Mesh2DComponent, 1);
+
+ LUAX_DECL_METHOD(_GetVertices);
+ LUAX_DECL_METHOD(_GetVertex);
///
/// meshж㡣
@@ -52,6 +68,8 @@ namespace AsuraEngine
///
std::vector<float> mIndices;
+ int mComponents;
+
};
}