Browse Source

Quaderupdate

INterface fuer extra boundingbox
seba 12 years ago
parent
commit
c65e215a5a
5 changed files with 35 additions and 2 deletions
  1. 1
    1
      Makefile
  2. 5
    0
      model/model.cpp
  3. 2
    0
      model/model.h
  4. 1
    0
      model/modelloader.h
  5. 26
    1
      quader.cpp

+ 1
- 1
Makefile View File

@@ -1,6 +1,6 @@
1 1
 CC = g++
2 2
 AR = ar
3
-OBJECTS = punkt3d.o punkt2d.o emath.o emath_opengl.o glcolor.o gldrawhelper.o glfontengine.o glrect.o gltexture.o matrix.o quaternion.o rotationsmatrix.o glsdlscreen.o sdlfuncs.o fpsmanager.o glcamera.o catmullromspline.o extstring.o
3
+OBJECTS = punkt3d.o punkt2d.o emath.o emath_opengl.o glcolor.o gldrawhelper.o glfontengine.o glrect.o gltexture.o matrix.o quaternion.o rotationsmatrix.o glsdlscreen.o sdlfuncs.o fpsmanager.o glcamera.o catmullromspline.o extstring.o quader.o
4 4
 OBJOPT = -Wall -c `sdl-config --cflags`
5 5
 SUBDIRS = glgui glmenu model
6 6
 SUBDIROBJECTS = glgui/*.o glmenu/*.o model/*.o

+ 5
- 0
model/model.cpp View File

@@ -151,3 +151,8 @@ void Model::render() {
151 151
 Model::~Model() {
152 152
 	unload();
153 153
 }
154
+
155
+const Punkt3D* Model::getMeshData(unsigned int *meshanz) {
156
+	*meshanz = meshdataanz;
157
+	return (const Punkt3D*)meshdata;
158
+}

+ 2
- 0
model/model.h View File

@@ -84,6 +84,8 @@ class Model {
84 84
 		
85 85
 		Quader getBoundingBox() { return boundingbox; }
86 86
 		float getBoundingRadius() { return boundingrad; }
87
+		
88
+		const Punkt3D* getMeshData(unsigned int *meshanz);
87 89
 };
88 90
 
89 91
 #endif

+ 1
- 0
model/modelloader.h View File

@@ -11,6 +11,7 @@ class Modelloader {
11 11
 		std::string filename;
12 12
 	public:
13 13
 		Modelloader(std::string _filename);
14
+		virtual ~Modelloader() { };
14 15
 		virtual bool load(Model *m)=0;
15 16
 };
16 17
 

+ 26
- 1
quader.cpp View File

@@ -6,5 +6,30 @@ void Quader::clean() {
6 6
 }
7 7
 
8 8
 void Quader::render() {
9
-	glB
9
+	glBegin(GL_LINES);
10
+		glVertexP3D(a);
11
+		glVertexP3D(b);
12
+		glVertexP3D(b);
13
+		glVertexP3D(c);	
14
+		glVertexP3D(c);
15
+		glVertexP3D(d);
16
+		glVertexP3D(d);
17
+		glVertexP3D(a);
18
+		glVertexP3D(e);
19
+		glVertexP3D(f);
20
+		glVertexP3D(f);
21
+		glVertexP3D(g);
22
+		glVertexP3D(g);
23
+		glVertexP3D(h);
24
+		glVertexP3D(h);
25
+		glVertexP3D(e);
26
+		glVertexP3D(a);
27
+		glVertexP3D(e);
28
+		glVertexP3D(b);
29
+		glVertexP3D(f);
30
+		glVertexP3D(c);
31
+		glVertexP3D(g);
32
+		glVertexP3D(d);
33
+		glVertexP3D(h);
34
+	glEnd();
10 35
 }

Loading…
Cancel
Save