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