annotate TaskManager/Test/test_render/scene_graph_pack.h @ 123:e9e12e2088bd draft

delete scene_graph->child (instead use "children")
author gongo@charles.cr.ie.u-ryukyu.ac.jp
date Tue, 25 Nov 2008 10:32:23 +0900
parents 028ffc9c0375
children 91c74dbc32e4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #ifndef INCLUDED_SCENE_GRAPH_PACK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_SCENE_GRAPH_PACK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #define MAX_NODE 16
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 #define MAX_POLYGON 36
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 typedef struct SceneGraphNode {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 int size; // この Node で使ってるポリゴンの数、でいいのかな
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 float vertex[MAX_POLYGON*3];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 float texture[MAX_POLYGON*2];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 float obj_pos[4];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 float angle[4];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 float translation[16];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 long *tex_addr, tex_width, tex_height;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 int id;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 int move, interaction;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 int pn; // parent number?
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 SceneGraphNode *next;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 int pad[3];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 void init(void) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 size = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 next = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 }SceneGraphNode, *SceneGraphNodePtr;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 typedef struct SceneGraphInfo {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28 int size;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29 int pad[2];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
30 }SceneGraphInfo;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32 typedef struct SceneGraphPack {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 SceneGraphInfo info;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 SceneGraphNode node[MAX_NODE];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 SceneGraphPack *next;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37 void init(void){
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 next = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 info.size = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 for (int i = 0; i < MAX_NODE; i++) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 node[i].size = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 } SceneGraphPack, *SceneGraphPackPtr;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 #endif