summaryrefslogtreecommitdiffstats
path: root/Cubehole.h
diff options
context:
space:
mode:
Diffstat (limited to 'Cubehole.h')
-rw-r--r--Cubehole.h43
1 files changed, 24 insertions, 19 deletions
diff --git a/Cubehole.h b/Cubehole.h
index 83ef382..c8e8736 100644
--- a/Cubehole.h
+++ b/Cubehole.h
@@ -3,35 +3,37 @@
#include "Trapezocube.h"
#include "Triangle.h"
-#include "Matrix.h"
#include <list>
class Cubehole
{
public:
- Cubehole(): width(0), height(0), depth(0), x(0), y(0), z(0), innerwidth(0), innerdepth(0),
- colorfront(0), colorback(0), colorleft(0), colorright(0) {
- }
+ Cubehole(): width(0), height(0), depth(0), x(0), y(0), z(0), innerwidth(0), innerdepth(0) {}
+
Cubehole(float width0, float height0, float depth0, float x0, float y0, float z0,
- float innerwidth0, float innerdepth0,
- Color colorfront0, Color colorright0, Color colorback0, Color colorleft0) {
- setSize(width0, height0, depth0, innerwidth0, innerdepth0);
- setPos(x0, y0, z0);
- setColor(colorfront0, colorright0, colorback0, colorleft0);
- front.setRotate(0);
- right.setRotate(90);
- back.setRotate(180);
- left.setRotate(270);
- }
+ float innerwidth0, float innerdepth0,
+ const vmml::vec4f &colorfront0, const vmml::vec4f &colorright0,
+ const vmml::vec4f &colorback0, const vmml::vec4f &colorleft0) {
+ setSize(width0, height0, depth0, innerwidth0, innerdepth0);
+ setPos(x0, y0, z0);
+ setColor(colorfront0, colorright0, colorback0, colorleft0);
+ front.setRotate(0);
+ right.setRotate(90);
+ back.setRotate(180);
+ left.setRotate(270);
+ }
+
float getHeight();
float getWidth();
float getDepth();
float getPosX();
float getPosY();
float getPosZ();
+
float getInnerWidth() {return innerwidth;}
float getInnerDepth() {return innerdepth;}
+
void setSize(float w, float h, float d, float iw, float id){
width = w;
height = h;
@@ -43,26 +45,29 @@ class Cubehole
back.setSize(width, innerwidth, height, (depth-innerdepth)/2);
left.setSize(width, innerdepth, height, (width-innerwidth)/2);
}
+
void setPos(float x0, float y0, float z0) {
x = x0;
y = y0;
z = z0;
front.setPos(x, y, depth-(depth-innerdepth)/2);
right.setPos(x, y, width-(width-innerwidth)/2);
- back.setPos(x, y, depth-(depth-innerdepth)/2);
- left.setPos(x, y, width-(width-innerwidth)/2);
+ back.setPos(x, y, depth-(depth-innerdepth)/2);
+ left.setPos(x, y, width-(width-innerwidth)/2);
}
- void setColor(Color cf, Color cr, Color cb, Color cl){
+
+ void setColor(const vmml::vec4f &cf, const vmml::vec4f &cr, const vmml::vec4f &cb, const vmml::vec4f &cl) {
front.setColor(cf);
right.setColor(cr);
back.setColor(cb);
left.setColor(cl);
}
- std::list<Triangle> getTriangles(/*const Matrix &modelview*/);
+
+ std::list<Triangle> getTriangles();
private:
float x, y, z, width, height, depth, innerwidth, innerdepth;
- Color colorfront, colorleft, colorback, colorright;
+ vmml::vec4f colorfront, colorleft, colorback, colorright;
Trapezocube front, right, back, left;
};