xref: /haiku/src/apps/glteapot/GLObject.h (revision 24159a0c7d6d6dcba9f2a0c1a7c08d2c8167f21b)
1 /*
2 	Copyright 1999, Be Incorporated.   All Rights Reserved.
3 	This file may be used under the terms of the Be Sample Code License.
4 */
5 
6 #include "ObjectView.h"
7 
8 struct point {
9 	float x,y,z;
10 	float nx,ny,nz;
11 	float tu,tv;
12 };
13 
14 struct tri {
15 	int p1,p2,p3;
16 };
17 
18 struct quadStrip {
19 	int numpts;
20 	int *pts;
21 };
22 
23 #include "util.h"
24 
25 class GLObject {
26 public:
27 float 				rotX,rotY,spinX,spinY,lastRotX,lastRotY;
28 float				x,y,z;
29 int					color;
30 int					solidity;
31 bool				changed;
32 ObjectView *		objView;
33 
34 					GLObject(ObjectView *ov);
35 virtual				~GLObject();
36 
37 virtual void		Draw(bool forID, float IDcolor[]);
38 virtual bool		SpinIt();
39 virtual void		MenuInvoked(BPoint point);
40 
41 virtual void		DoDrawing(bool forID) {};
42 };
43 
44 class TriangleObject : public GLObject {
45 public:
46 BufferArray<point>		points;
47 BufferArray<tri>		triangles;
48 BufferArray<quadStrip>	qs;
49 
50 					TriangleObject(ObjectView *ov, char *filename);
51 virtual				~TriangleObject();
52 
53 virtual void		DoDrawing(bool forID);
54 };
55