Mercurial > hg > Members > kono > Cerium
comparison Renderer/Engine/task/update_sgp.cc @ 507:735f76483bb2
Reorganization..
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 12 Oct 2009 09:39:35 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
506:1d4a8a86f26b | 507:735f76483bb2 |
---|---|
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" | |
7 #include "update_sgp.h" | |
8 | |
9 SchedDefineTask(Update_SGP); | |
10 | |
11 static int | |
12 run(SchedTask *s,void *rbuf, void *wbuf) | |
13 { | |
14 SceneGraphNodePtr node; | |
15 SceneGraphPack *sgp = (SceneGraphPack*)s->get_input(rbuf, 0); | |
16 SceneGraphPack *_sgp = (SceneGraphPack*)s->get_output(wbuf, 0); | |
17 //int screen_width = get_param(0); | |
18 //int screen_height = get_param(1); | |
19 | |
20 // 本当はここでやるもんじゃないんだが。。。 | |
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 } |