Mercurial > hg > Game > Cerium
view TaskManager/Test/simple_pack/task/update_sgp.cpp @ 69:c9b973f0673e
*** empty log message ***
author | chiaki |
---|---|
date | Sun, 17 Feb 2008 23:07:52 +0900 |
parents | 0c8ae614d421 |
children | 768452fab95e |
line wrap: on
line source
#include <iostream> #include <math.h> #include "scene_graph_pack.h" #include "sys.h" using namespace std; int update_sgp(SceneGraphPack *sgp, SceneGraphPack *_sgp) { SceneGraphNodePtr node; float y_angle; for (int i = 0; i < sgp->info.size; i++) { //(*my_func[node->move])(node); //(*my_func[node->interaction])(node, sgp); node = &sgp->node[i]; // 本当は、ここは上の my_func で行う y_angle = node->angle[1]; y_angle += 1.0f; if (y_angle > 360.0f) y_angle = 0.0f; node->angle[1] = y_angle; //node->obj_pos[0] += 0.5f; //node->obj_pos[1] += 0.5f; //node->obj_pos[2] += 0.5f; 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); } } // まあこれは多分駄目なんだけど。 // in/out と update は分ける必要ある? // それはユーザ側で in/out になるように書かせるもの? memcpy(_sgp, sgp, sizeof(SceneGraphPack)); return sizeof(SceneGraphPack); }