diff TaskManager/Test/simple_render/task/update_sgp.cpp @ 109:028ffc9c0375 draft

Cerium cvs version
author gongo@gendarme.local
date Wed, 12 Nov 2008 17:39:33 +0900
parents 663bc2a213f5
children 768452fab95e
line wrap: on
line diff
--- a/TaskManager/Test/simple_render/task/update_sgp.cpp	Wed Nov 12 17:29:35 2008 +0900
+++ b/TaskManager/Test/simple_render/task/update_sgp.cpp	Wed Nov 12 17:39:33 2008 +0900
@@ -1,5 +1,8 @@
+#include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #include <math.h>
+#include "viewer.h"
 #include "scene_graph_pack.h"
 #include "sys.h"
 using namespace std;
@@ -12,6 +15,10 @@
     SceneGraphNodePtr node;
     float y_angle;
 
+    // 本当はここでやるもんじゃないんだが。。。
+    static float dest_x = 0.3f;
+    static float dest_y = 0.5f;
+
     __debug("[%s]\n", __FUNCTION__);
 
     for (int i = 0; i < sgp->info.size; i++) {
@@ -29,6 +36,19 @@
 	//node->obj_pos[1] += 0.5f;
 	//node->obj_pos[2] += 0.5f;
 
+	//node->obj_pos[0] += dest_x;
+	node->obj_pos[0] = 360.0f;
+	if ((int)node->obj_pos[0] > Viewer::width ||
+	    (int)node->obj_pos[0] < 0) {
+	    dest_x = -dest_x;
+	}
+
+	node->obj_pos[1] += dest_y;
+	if ((int)node->obj_pos[1] > Viewer::height ||
+	    (int)node->obj_pos[1] < 0) {
+	    dest_y = -dest_y;
+	}
+
 	if (node->pn != -1) {
 	    get_matrix(node->translation,
 		       node->angle, node->obj_pos,