xref: /haiku/src/apps/glteapot/GLObject.h (revision b2537f99cdffc40818b65879120ecae67b29d7d9)
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 #ifndef GL_OBJECT_H
6 #define GL_OBJECT_H
7 
8 #include "ObjectView.h"
9 #include "util.h"
10 
11 struct point {
12 	float x,y,z;
13 	float nx,ny,nz;
14 	float tu,tv;
15 };
16 
17 struct tri {
18 	int p1,p2,p3;
19 };
20 
21 struct quadStrip {
22 	int numpts;
23 	int *pts;
24 };
25 
26 
27 class GLObject {
28 	public:
29 						GLObject(ObjectView *ov);
30 		virtual			~GLObject();
31 
32 		virtual void	Draw(bool forID, float IDcolor[]);
33 		virtual bool	SpinIt();
34 		virtual void	MenuInvoked(BPoint point);
35 		virtual void	DoDrawing(bool forID) {};
36 
37 		float 			rotX,rotY,spinX,spinY,lastRotX,lastRotY;
38 		float			x,y,z;
39 		int				color;
40 		int				solidity;
41 		bool			changed;
42 		ObjectView *	objView;
43 };
44 
45 class TriangleObject : public GLObject {
46 	public:
47 							TriangleObject(ObjectView *ov, char *filename);
48 		virtual				~TriangleObject();
49 
50 		virtual void		DoDrawing(bool forID);
51 
52 		BufferArray<point>		points;
53 		BufferArray<tri>		triangles;
54 		BufferArray<quadStrip>	qs;
55 };
56 
57 #endif // GL_OBJECT_H
58