diff TaskManager/Test/test_render/vacuum.cpp @ 378:bdeb7a73285b draft

test_nogl not working
author kazz@kazzone.cr.ie.u-ryukyu.ac.jp
date Fri, 31 Jul 2009 19:10:53 +0900
parents 4fb99cd5d13f
children ce86b0186a4a
line wrap: on
line diff
--- a/TaskManager/Test/test_render/vacuum.cpp	Fri Jul 31 18:22:46 2009 +0900
+++ b/TaskManager/Test/test_render/vacuum.cpp	Fri Jul 31 19:10:53 2009 +0900
@@ -5,16 +5,7 @@
 #define ENCOUNT 55
 using namespace std;
 
-<<<<<<< local
-static void cube_move_left(SceneGraphPtr node, int screen_w, int screen_h);
-static void cube_move_right(SceneGraphPtr node, int screen_w, int screen_h);
-static void cube_move_idle(SceneGraphPtr node, int screen_w, int screen_h);
-static void cube_collision(SceneGraphPtr node, int screen_w, int screen_h,
-                           SceneGraphPtr tree);
-static void cube_split(SceneGraphPtr root);
-=======
 static float vacuum_speed = 10.0f;
->>>>>>> other
 
 
 /*オブジェクト毎にファイルを分けてみた
@@ -28,58 +19,12 @@
 no_move_idle(SceneGraphPtr node, int screen_w, int screen_h)
 {
 
-<<<<<<< local
-    if (node->xyz[0] < 0) {
-        node->set_move_collision(cube_move_right, cube_collision);
-    }
-
-    if (node->xyz[1] < 0 || node->xyz[1] > screen_h) {
-        node->stack_xyz[1] = -node->stack_xyz[1];
-    }
-
-    //node->angle[0] += 2.0f;
-    //node->angle[1] += 2.0f * node->stack_xyz[1];
-    //node->angle[2] += 2.0f * node->stack_xyz[2];
-
-    if (++node->frame > 60) {
-        cube_split(node);
-    }
-=======
->>>>>>> other
 }
 
 void
 no_collision_idle(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree)
 {
-<<<<<<< local
-    node->xyz[0] += node->stack_xyz[0];
-#if 0
-    node->xyz[1] -= node->stack_xyz[0] * node->stack_xyz[1];
-    node->xyz[2] -= node->stack_xyz[0] * node->stack_xyz[2];
-#else
-    node->xyz[1] += node->stack_xyz[1];
-#endif
 
-    if (node->xyz[0] > screen_w) {
-        node->set_move_collision(cube_move_left, cube_collision);
-    }
-=======
->>>>>>> other
-
-<<<<<<< local
-    if (node->xyz[1] < 0 || node->xyz[1] > screen_h) {
-        node->stack_xyz[1] = -node->stack_xyz[1];
-    }
-
-    //node->angle[0] += 2.0f;
-    //node->angle[1] += 2.0f * node->stack_xyz[1];
-    //node->angle[2] += 2.0f * node->stack_xyz[2];
-
-    if (++node->frame > 60) {
-        cube_split(node);
-    }
-=======
->>>>>>> other
 }
 
 void
@@ -88,10 +33,6 @@
 {
     Pad *pad = sgroot->getController();
 
-<<<<<<< local
-    if (pad->circle.isPush()) {
-        cube_split(node);
-=======
     if(node->frame%ENCOUNT == ENCOUNT-1) {
       if(random()%2) {
       add_cubecollision_object(REDCUBE,node,screen_w,screen_h);
@@ -99,7 +40,6 @@
       else {
       add_cubecollision_object(ENEMY,node,screen_w,screen_h);
       }
->>>>>>> other
     }
 
     if (pad->cross.isHold()) {
@@ -116,14 +56,8 @@
 
 }
 
-<<<<<<< local
-static void
-cube_collision(SceneGraphPtr node, int screen_w, int screen_h,
-               SceneGraphPtr tree)
-=======
 void
 lock_attack(SceneGraphPtr node,SceneGraphIteratorPtr it)
->>>>>>> other
 {
 
   SceneGraphPtr enemy;
@@ -159,79 +93,20 @@
 
 }
 
-<<<<<<< local
-static void
-vacuum_coll(SceneGraphPtr node, int screen_w, int screen_h,
-            SceneGraphPtr tree)
-{
-    SceneGraphIteratorPtr it = sgroot->getIterator();
-    SceneGraphPtr bigm;
-    Pad *pad = sgroot->getController();
-    float dx, dy, r;
-    float q = 0;
-=======
 void
 lockon_collision(SceneGraphPtr node,int w,int h,SceneGraphPtr tree) {
->>>>>>> other
 
-<<<<<<< local
-    if (pad->cross.isRelease()) {
-        return;
-    }
-=======
   Pad *pad = sgroot->getController();
   SceneGraphPtr lockon_enemy = node->parent;
->>>>>>> other
 
   /* node->angle[0] = -lockon_enemy->angle[0];
   node->angle[1] = -lockon_enemy->angle[1];
   node->angle[2] = -lockon_enemy->angle[2];*/
 
-<<<<<<< local
-    for (; it->hasNext(MCUBE);) {
-        it->next(MCUBE);
-        SceneGraphPtr mcube = it->get();
-=======
   if(pad->circle.isRelease()) {
     lockon_enemy->remove();
   }
->>>>>>> other
 
-<<<<<<< local
-        dx = node->xyz[0] - mcube->xyz[0];
-        dy = node->xyz[1] - mcube->xyz[1];
-
-        r = sqrt(dx*dx + dy*dy);
-
-        if (r >= 1) q = 300/r;
-
-        if (r < 50.0f) {
-            mcube->remove();
-            continue;
-        }
-
-        if (dx == 0) {
-            if(mcube->xyz[1] > node->xyz[1]) {
-                mcube->xyz[1] -= q;
-            } else if(mcube->xyz[1] < node->xyz[1]) {
-                mcube->xyz[1] += q;
-            }
-        } else {
-            if(mcube->xyz[0] > node->xyz[0]) {
-                mcube->xyz[0] -= q*cos(atan(dy/dx));
-                mcube->xyz[1] -= q*sin(atan(dy/dx));
-                mcube->stack_xyz[0] = -q*cos(atan(dy/dx));
-                mcube->stack_xyz[1] = -q*sin(atan(dy/dx));
-            } else if(mcube->xyz[0] < mcube->xyz[0]) {
-                mcube->xyz[0] += q*cos(atan(dy/dx));
-                mcube->xyz[1] += q*sin(atan(dy/dx));
-                mcube->stack_xyz[0] = -q*cos(atan(dy/dx));
-                mcube->stack_xyz[1] = -q*sin(atan(dy/dx));
-            }
-        }
-    }
-=======
->>>>>>> other
 }
 
 
@@ -240,44 +115,25 @@
 {
     Pad *pad = sgroot->getController();
 
-<<<<<<< local
-    if (pad->right.isHold()) {
-        node->xyz[0] += vacuum_speed;
-    } else if (pad->left.isHold()) {
-        node->xyz[0] -= vacuum_speed;
-=======
     if (pad->right.isHold() && w > node->xyz[0]) {
       node->xyz[0] += vacuum_speed;
       node->angle[0] += 2;
     } else if (pad->left.isHold() && 0 < node->xyz[0]) {
       node->xyz[0] -= vacuum_speed;
       node->angle[0] -= 2;
->>>>>>> other
     }
 
-<<<<<<< local
-    if (pad->up.isHold()) {
-        node->xyz[1] -= vacuum_speed;
-    } else if (pad->down.isHold()) {
-        node->xyz[1] += vacuum_speed;
-=======
     if (pad->up.isHold() && 0 < node->xyz[1]) {
       node->xyz[1] -= vacuum_speed;
       node->angle[1] -= 2;
     } else if (pad->down.isHold() && h > node->xyz[1]) {
       node->xyz[1] += vacuum_speed;
       node->angle[1] += 2;
->>>>>>> other
     }
 
     if (pad->start.isPush()) {
-<<<<<<< local
-        node->xyz[0] = w/2;
-        node->xyz[1] = h*0.8;
-=======
       node->xyz[0] = w/2;
       node->xyz[1] = h*0.8;
->>>>>>> other
     }
 }