annotate TaskManager/Test/test_render/task/update_sgp.cpp @ 238:443c7ae1c7a7 draft

warning clean
author admin@mcbk.cr.ie.u-ryukyu.ac.jp
date Fri, 29 May 2009 13:43:52 +0900
parents f35504025f73
children abf96b4caee5
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 #include <stdio.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include <string.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include <unistd.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #include <math.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 #include "scene_graph_pack.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6 #include "sys.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 #include "update_sgp.hpp"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 SchedDefineTask(Update_SGP);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 int
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 Update_SGP::run(void *rbuf, void *wbuf)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 SceneGraphNodePtr node;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 SceneGraphPack *sgp = (SceneGraphPack*)get_input(rbuf, 0);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 SceneGraphPack *_sgp = (SceneGraphPack*)get_output(wbuf, 0);
238
443c7ae1c7a7 warning clean
admin@mcbk.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
17 //int screen_width = get_param(0);
443c7ae1c7a7 warning clean
admin@mcbk.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
18 //int screen_height = get_param(1);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 // 本当はここでやるもんじゃないんだが。。。
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 for (int i = 0; i < sgp->info.size && i < 3; i++) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 node = &sgp->node[i];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 do {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 if (node->pn != -1) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26 get_matrix(node->translation,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 node->angle, node->obj_pos,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28 sgp->node[node->pn].translation);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29 } else {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
30 get_matrix(node->translation,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31 node->angle, node->obj_pos,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32 NULL);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 node = node->next;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36 } while (node);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 memcpy(_sgp, sgp, sizeof(SceneGraphPack));
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 return 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 }