view Renderer/Test/title.cc @ 656:d0b8860c17f8

remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
author hiroki@henri.cr.ie.u-ryukyu.ac.jp
date Wed, 25 Nov 2009 21:56:14 +0900
parents b21a013051a2
children
line wrap: on
line source

#include "SceneGraphRoot.h"
#include "vacuum.h"

extern int redcube;

void
title_collision(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree)
{
    SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
  Pad *pad = sgroot->getController();
  
  if(pad->start.isPush()) {
    
    SceneGraphPtr vacuum;
    SceneGraphPtr back = sgroot->createSceneGraph(); 

    vacuum = sgroot->createSceneGraph("BIGCUBE");
    vacuum->xyz[0] = w/2;
    vacuum->xyz[1] = h*0.8;
    vacuum->set_move_collision(vacuum_move, vacuum_coll);
    
    back->addChild(vacuum);
    
    add_cubecollision_object(redcube,vacuum,w,h, sgroot);
    
    sgroot->setSceneData(back);
      
  }
}