Files
BlitzNext/Runtime/blitz3d/meshloader.hpp
T

39 lines
788 B
C++
Raw Normal View History

2014-01-31 08:23:00 +13:00
#ifndef MESHLOADER_H
#define MESHLOADER_H
2019-01-18 15:55:06 +01:00
#include "model.hpp"
#include "surface.hpp"
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
class MeshLoader {
public:
enum { HINT_COLLAPSE = 1, HINT_ANIMONLY = 2 };
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
virtual MeshModel* load(const string& f, const Transform& conv, int hint) = 0;
2014-01-31 08:23:00 +13:00
//clear
static void beginMesh();
//add a vertex
2019-01-18 17:04:17 +01:00
static void addVertex(const Surface::Vertex& v);
2014-01-31 08:23:00 +13:00
//add a triangle
2019-01-18 17:04:17 +01:00
static void addTriangle(const int verts[3], const Brush& b);
2014-01-31 08:23:00 +13:00
//also add a triangle
2019-01-18 17:04:17 +01:00
static void addTriangle(int v0, int v1, int v2, const Brush& b);
2014-01-31 08:23:00 +13:00
//add a bone
2019-01-18 17:04:17 +01:00
static void addBone(int vert, float weight, int bone);
2014-01-31 08:23:00 +13:00
//reference a vertex
2019-01-18 17:04:17 +01:00
static Surface::Vertex& refVertex(int vert);
2014-01-31 08:23:00 +13:00
//number of verts
static int numVertices();
//finally, update the mesh...
2019-01-18 17:04:17 +01:00
static void endMesh(MeshModel* mesh);
2014-01-31 08:23:00 +13:00
};
#endif