283
|
1 #ifndef INCLUDED_POLYGON
|
|
2 #define INCLUDED_POLYGON
|
|
3
|
|
4 #ifndef INCLUDED_VIEWER
|
|
5 # include "viewer.h"
|
|
6 #endif
|
|
7
|
|
8 #include <libxml/parser.h>
|
|
9
|
|
10 #ifndef INCLUDED_POLYGON_PACK
|
|
11 # include "polygon_pack.h"
|
|
12 #endif
|
|
13
|
|
14 #ifndef INCLUDED_SPAN_PACK
|
|
15 # include "SpanPack.h"
|
|
16 #endif
|
|
17
|
|
18 #ifndef INCLUDED_TEXTURE
|
|
19 # include "texture.h"
|
|
20 #endif
|
|
21
|
|
22 class Polygon {
|
|
23 public:
|
|
24 long long size;
|
|
25 const char *name;
|
|
26 const char *parent_name;
|
|
27
|
|
28 //float *data; //"vertex" and "normal" and "texture"
|
|
29 float *coord_xyz; // vertex coordinate array
|
|
30 float *coord_tex; // texture coordinate array
|
|
31 float *normal; // normal vector array
|
|
32 float xyz[4]; // position
|
|
33 float angle[4]; // angle
|
|
34 float c_xyz[4]; // center of rotation
|
|
35 float matrix[16];
|
|
36 float *anim;
|
|
37 int texture_id; //texture id number
|
|
38 struct texture_list texture_info;
|
|
39
|
|
40 static SDL_Surface* texture_image; // pointer of this surface's texture
|
|
41
|
|
42 Polygon(void);
|
|
43
|
|
44 void parameter_change(char *name, float x, float y, float z, float ax, float ay, float az);
|
|
45 //void load_texture(char *image_name);
|
|
46 //void draw(float *stack);
|
|
47 //void draw(SceneGraphPack *sgp);
|
|
48 //void draw(PolygonPack *pp);
|
|
49 //void draw(SpanPack *sp);
|
|
50 Uint32 get_rgb(int tx, int ty);
|
|
51
|
|
52 public:
|
|
53 void position_init(void);
|
|
54
|
|
55 void tree_draw();
|
|
56 void pickup_coordinate(char *cont);
|
|
57 void pickup_normal(char *cont);
|
|
58 void pickup_model(char *cont);
|
|
59 void pickup_texture(char *cont);
|
|
60 };
|
|
61
|
|
62 #endif
|