summaryrefslogtreecommitdiffstats
path: root/Cubehole.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-12-10 21:24:40 +0100
committerMatthias Schiffer <matthias@gamezock.de>2009-12-10 21:24:40 +0100
commite744ab213aeaccfe1aea6050907019aad9cf1911 (patch)
treee9d741a393e2178c5b90f48df0d0e3975f564e63 /Cubehole.h
parent823e55c9c49cf97531b66e6b15c41d9f9003bc32 (diff)
parentd439daec66c28f85debc2479e95eadb5fc3c00a2 (diff)
downloadc3d-e744ab213aeaccfe1aea6050907019aad9cf1911.tar
c3d-e744ab213aeaccfe1aea6050907019aad9cf1911.zip
Merge branch 'master' of git://git.gamezock.de/c3d
Conflicts: Cubehole.cpp Cubehole.h DisplayClass.cpp Trapezocube.cpp
Diffstat (limited to 'Cubehole.h')
-rw-r--r--Cubehole.h71
1 files changed, 47 insertions, 24 deletions
diff --git a/Cubehole.h b/Cubehole.h
index 9da2026..c8e8736 100644
--- a/Cubehole.h
+++ b/Cubehole.h
@@ -1,6 +1,7 @@
#ifndef _CUBEHOLE_H_
#define _CUBEHOLE_H_
+#include "Trapezocube.h"
#include "Triangle.h"
#include <list>
@@ -9,43 +10,65 @@ class Cubehole
{
public:
Cubehole(): width(0), height(0), depth(0), x(0), y(0), z(0), innerwidth(0), innerdepth(0) {}
- Cubehole(float width, float height, float depth): x(0), y(0), z(0), innerwidth(0), innerdepth(0){
- setSize(width, height, depth);
- }
- Cubehole(float width, float height, float depth, float x, float y, float z): innerwidth(0), innerdepth(0) {
- setSize(width, height, depth);
- setPos(x, y, z);
- }
- Cubehole(float width, float height, float depth, float x, float y, float z, float innerwidth, float innerdepth) {
- setSize(width, height, depth);
- setPos(x, y, z);
- setInnerSize(innerwidth, innerdepth);
+
+ Cubehole(float width0, float height0, float depth0, float x0, float y0, float z0,
+ 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 setInnerSize(float iw, float id)
- {
+
+ float getInnerWidth() {return innerwidth;}
+ float getInnerDepth() {return innerdepth;}
+
+ void setSize(float w, float h, float d, float iw, float id){
+ width = w;
+ height = h;
+ depth = d;
innerwidth = iw;
innerdepth = id;
+ front.setSize(width, innerwidth, height, (depth-innerdepth)/2);
+ right.setSize(width, innerdepth, height, (width-innerwidth)/2);
+ 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);
}
- void setSize(float w, float h, float d);
- void setPos(float x, float y, float z);
- std::list<Triangle> getTriangles(/*const Matrix &modelview*/);
+
+ 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();
private:
float x, y, z, width, height, depth, innerwidth, innerdepth;
+ vmml::vec4f colorfront, colorleft, colorback, colorright;
+ Trapezocube front, right, back, left;
};