libsegl/model/old/model.h

67 lines
1.0 KiB
C
Raw Normal View History

2008-04-11 16:43:46 +02:00
#ifndef __MODEL_H
#define __MODEL_H
#include <iostream>
#include <vector>
#include "../punkt2d.h"
#include "../punkt3d.h"
#include "../gltexture.h"
#include "../glcolor.h"
2008-04-11 16:43:46 +02:00
// #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();
};
2008-04-11 16:43:46 +02:00
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;
2008-04-11 16:43:46 +02:00
public:
ModelObject();
std::string getName();
2008-04-11 16:43:46 +02:00
void render();
void clear();
};
class Model {
private:
std::vector<ModelObject> objects;
std::vector<Material> materials;
2008-04-11 16:43:46 +02:00
public:
Model();
void addObject(ModelObject c);
void addMaterial(Material m);
2008-04-11 16:43:46 +02:00
void clear();
void render();
Material findMaterial(std::string name);
2008-04-11 16:43:46 +02:00
};
#endif