mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-27 03:53:24 +00:00
42 lines
799 B
C++
42 lines
799 B
C++
#ifndef MESH_H
|
|
#define MESH_H
|
|
|
|
#include"vector.h"
|
|
#include<vector>
|
|
#include<string>
|
|
#include"material.h"
|
|
#include<scene.h>
|
|
|
|
|
|
namespace vb01{
|
|
class Node;
|
|
|
|
class Mesh{
|
|
protected:
|
|
struct Vertex{
|
|
Vector3 pos,norm;
|
|
Vector2 texCoords;
|
|
};
|
|
void construct();
|
|
Vertex *vertices;
|
|
unsigned int *indices,VAO,VBO,EBO;
|
|
int numTris;
|
|
Node *node=nullptr;
|
|
public:
|
|
Mesh(std::string);
|
|
Mesh();
|
|
~Mesh();
|
|
virtual void update();
|
|
void setMaterial(Material *mat){this->material=mat;}
|
|
inline void setNode(Node *node){this->node=node;}
|
|
inline Node* getNode(){return node;}
|
|
inline Material* getMaterial(){return material;}
|
|
private:
|
|
Material *material=nullptr;
|
|
void processNode(aiNode*,const aiScene*);
|
|
void processMesh(aiMesh*, const aiScene*);
|
|
};
|
|
}
|
|
|
|
#endif
|