Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Test/test_render/task/update_sgp.cc @ 468:bd5b93d39597
test_nogl on Mac OS X worked.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 02 Oct 2009 16:40:43 +0900 |
parents | 44c0bce54dcf |
children |
rev | line source |
---|---|
109 | 1 #include <stdio.h> |
2 #include <string.h> | |
3 #include <unistd.h> | |
4 #include <math.h> | |
5 #include "scene_graph_pack.h" | |
6 #include "sys.h" | |
404 | 7 #include "update_sgp.h" |
109 | 8 |
9 SchedDefineTask(Update_SGP); | |
10 | |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
463
diff
changeset
|
11 static int |
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
463
diff
changeset
|
12 run(SchedTask *s,void *rbuf, void *wbuf) |
109 | 13 { |
14 SceneGraphNodePtr node; | |
468
bd5b93d39597
test_nogl on Mac OS X worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
15 SceneGraphPack *sgp = (SceneGraphPack*)s->get_input(rbuf, 0); |
bd5b93d39597
test_nogl on Mac OS X worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
16 SceneGraphPack *_sgp = (SceneGraphPack*)s->get_output(wbuf, 0); |
238 | 17 //int screen_width = get_param(0); |
18 //int screen_height = get_param(1); | |
109 | 19 |
321 | 20 // 本当はここでやるもんじゃないんだが。。。 |
109 | 21 for (int i = 0; i < sgp->info.size && i < 3; i++) { |
22 node = &sgp->node[i]; | |
23 | |
24 do { | |
25 if (node->pn != -1) { | |
26 get_matrix(node->translation, | |
27 node->angle, node->obj_pos, | |
28 sgp->node[node->pn].translation); | |
29 } else { | |
30 get_matrix(node->translation, | |
31 node->angle, node->obj_pos, | |
32 NULL); | |
33 } | |
34 | |
35 node = node->next; | |
36 } while (node); | |
37 } | |
38 | |
39 memcpy(_sgp, sgp, sizeof(SceneGraphPack)); | |
40 | |
41 return 0; | |
42 } |