Initial commit.

This commit is contained in:
Mike Bostock 2012-12-14 09:47:48 -08:00
commit 44b5f2392f
98 changed files with 11750 additions and 0 deletions

47
material.h Normal file
View file

@ -0,0 +1,47 @@
// -*- C++ -*-
#ifndef MBOSTOCK_MATERIAL_H
#define MBOSTOCK_MATERIAL_H
namespace mbostock {
class Texture;
class Material {
public:
Material();
void setAmbient(float r, float g, float b, float a);
void setDiffuse(float r, float g, float b, float a);
void setSpecular(float r, float g, float b, float a);
void setEmission(float r, float g, float b, float a);
void setShininess(float s);
void setTexture(const char* path);
void setSlipAngle(float angle);
inline float slip() const { return slip_; }
void bind() const;
private:
float ambient_[4];
float diffuse_[4];
float specular_[4];
float emission_[4];
float shininess_;
const Texture* texture_;
float slip_;
};
class Materials {
public:
static const Material& blank();
private:
Materials();
};
}
#endif