1
0
Fork 0
blockofighter/src/legoblocks.h

84 lines
1.4 KiB
C
Raw Permalink Normal View History

2014-02-16 14:32:28 +00:00
#ifndef __LEGOBLOCKS_H_INCLUDED__
#define __LEGOBLOCKS_H_INCLUDED__
//#include "mesh.h"
#include "object.h"
#include "material.h"
#include "mesh.h"
#define BLOCKHEIGHT 0.4
2015-06-03 12:29:34 +00:00
class BasicBlock : public MeshObject {
2014-02-16 14:32:28 +00:00
private:
2015-06-03 12:29:34 +00:00
int width, height, depth;
2014-02-16 14:32:28 +00:00
public:
2015-06-03 12:29:34 +00:00
BasicBlock(int width, int height, int depth);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
void setColor(float red, float green, float blue);
2014-02-16 14:32:28 +00:00
};
2015-06-03 12:29:34 +00:00
class BasicBlockAppearance : public Appearance {
2014-02-16 14:32:28 +00:00
private:
2015-06-03 12:29:34 +00:00
int width, height, depth;
int gllist;
2014-02-16 14:32:28 +00:00
protected:
2015-06-03 12:29:34 +00:00
bool usematerial;
2014-02-16 14:32:28 +00:00
public:
2015-06-03 12:29:34 +00:00
float displacement[3];
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
BasicBlockAppearance(int width, int height, int depth);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
virtual void prepare(void);
virtual void draw(void);
2014-02-16 14:32:28 +00:00
};
void drawDetailRectangle(float width, float height);
extern int knobgllist;
extern int knobdetail;
void initKnob(void);
void createKnob(int knobsegments = -1);
2015-06-03 12:29:34 +00:00
class HeadAppearance : public Appearance {
2014-02-16 14:32:28 +00:00
private:
2015-06-03 12:29:34 +00:00
int gllist;
2014-02-16 14:32:28 +00:00
public:
2015-06-03 12:29:34 +00:00
HeadAppearance(void);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
void prepare(void);
void draw(void);
2014-02-16 14:32:28 +00:00
};
#define FLOWER_RED 1
#define FLOWER_YELLOW 2
#define FLOWER_WHITE 3
2015-06-03 12:29:34 +00:00
class FlowerAppearance : public Appearance {
2014-02-16 14:32:28 +00:00
private:
2015-06-03 12:29:34 +00:00
int gllist;
int color1, color2, color3;
2014-02-16 14:32:28 +00:00
public:
2015-06-03 12:29:34 +00:00
FlowerAppearance(int color1, int color2, int color3);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
void prepare(void);
void draw(void);
2014-02-16 14:32:28 +00:00
};
2015-06-03 12:29:34 +00:00
class LampAppearance : public Appearance {
2014-02-16 14:32:28 +00:00
private:
2015-06-03 12:29:34 +00:00
int gllist;
2014-02-16 14:32:28 +00:00
public:
2015-06-03 12:29:34 +00:00
LampAppearance(void);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
void prepare(void);
void draw(void);
2014-02-16 14:32:28 +00:00
};
#endif