Mercurial > hg > Members > kono > Cerium
diff Renderer/test_render/task/update_sgp.cpp @ 283:55ea4465b1a2
fix test_render
author | e065746@localhost.localdomain |
---|---|
date | Fri, 05 Jun 2009 16:49:12 +0900 |
parents | |
children | 58fd16298954 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/test_render/task/update_sgp.cpp Fri Jun 05 16:49:12 2009 +0900 @@ -0,0 +1,42 @@ +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <math.h> +#include "scene_graph_pack.h" +#include "sys.h" +#include "update_sgp.hpp" + +SchedDefineTask(Update_SGP); + +int +Update_SGP::run(void *rbuf, void *wbuf) +{ + SceneGraphNodePtr node; + SceneGraphPack *sgp = (SceneGraphPack*)get_input(rbuf, 0); + SceneGraphPack *_sgp = (SceneGraphPack*)get_output(wbuf, 0); + //int screen_width = get_param(0); + //int screen_height = get_param(1); + + // 本当はここでやるもんじゃないんだが。。。 + for (int i = 0; i < sgp->info.size && i < 3; i++) { + node = &sgp->node[i]; + + do { + if (node->pn != -1) { + get_matrix(node->translation, + node->angle, node->obj_pos, + sgp->node[node->pn].translation); + } else { + get_matrix(node->translation, + node->angle, node->obj_pos, + NULL); + } + + node = node->next; + } while (node); + } + + memcpy(_sgp, sgp, sizeof(SceneGraphPack)); + + return 0; +}