67 lines
1.0 KiB
C++
67 lines
1.0 KiB
C++
#ifndef __MODEL_H
|
|
#define __MODEL_H
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include "../punkt2d.h"
|
|
#include "../punkt3d.h"
|
|
#include "../gltexture.h"
|
|
#include "../glcolor.h"
|
|
// #include "load3ds.h"
|
|
|
|
|
|
class Material {
|
|
friend class Load3ds;
|
|
friend class ModelObject;
|
|
private:
|
|
std::string name;
|
|
|
|
GLColor ambient;
|
|
GLColor diffuse;
|
|
GLColor specular;
|
|
float percent;
|
|
public:
|
|
Material();
|
|
|
|
void clear();
|
|
std::string getName();
|
|
};
|
|
|
|
|
|
class ModelObject {
|
|
friend class Load3ds;
|
|
private:
|
|
std::vector<Punkt3D> normal;
|
|
std::vector<Punkt3D> vertex;
|
|
std::vector<Punkt2D> mapcoord;
|
|
std::vector<Punkt3D> polygon;
|
|
void calcNormales();
|
|
std::string name;
|
|
|
|
Material mat;
|
|
public:
|
|
ModelObject();
|
|
|
|
std::string getName();
|
|
void render();
|
|
void clear();
|
|
|
|
};
|
|
|
|
class Model {
|
|
private:
|
|
std::vector<ModelObject> objects;
|
|
std::vector<Material> materials;
|
|
|
|
public:
|
|
Model();
|
|
void addObject(ModelObject c);
|
|
void addMaterial(Material m);
|
|
void clear();
|
|
void render();
|
|
|
|
Material findMaterial(std::string name);
|
|
};
|
|
|
|
#endif
|