view TaskManager/Test/test_render/Application/gaplant.cc @ 529:3527ba243767 draft

modify applications not using SGid but SGname.
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Thu, 22 Oct 2009 16:47:49 +0900
parents 413667c70a1d
children
line wrap: on
line source

#include "SceneGraphRoot.h"
#include "gaplant_action.h"
#include "back_action.h"

SceneGraphPtr
create_gaplant() {
    SceneGraphPtr base;
    SceneGraphPtr p;

    base = sgroot->createSceneGraph();

p = sgroot->createSceneGraph("arm_L_D"          ), base->addChild(p);
p = sgroot->createSceneGraph("foot_L_B"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_L_E"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_L_C"         ), base->addChild(p);
p = sgroot->createSceneGraph("shield_L_C"       ), base->addChild(p);
p = sgroot->createSceneGraph("arm_L_G"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_L_E"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_R_F"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_R_A"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_R_E"          ), base->addChild(p);
p = sgroot->createSceneGraph("shoulder_R_C"     ), base->addChild(p);
p = sgroot->createSceneGraph("shoulder_R_B"     ), base->addChild(p);
p = sgroot->createSceneGraph("chest_L_A"        ), base->addChild(p);
p = sgroot->createSceneGraph("shoulder_R_A"     ), base->addChild(p);
p = sgroot->createSceneGraph("head_E"           ), base->addChild(p);
p = sgroot->createSceneGraph("shield_L_E"       ), base->addChild(p);
p = sgroot->createSceneGraph("shield_L_D"       ), base->addChild(p);
p = sgroot->createSceneGraph("shield_R_D"       ), base->addChild(p);
p = sgroot->createSceneGraph("shield_L_A"       ), base->addChild(p);
p = sgroot->createSceneGraph("arm_R_C"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_R_B"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_L_C"          ), base->addChild(p);
p = sgroot->createSceneGraph("eye"              ), base->addChild(p);
p = sgroot->createSceneGraph("booster_B"        ), base->addChild(p);
p = sgroot->createSceneGraph("booster_A"        ), base->addChild(p);
p = sgroot->createSceneGraph("chest_R_A"        ), base->addChild(p);
p = sgroot->createSceneGraph("chest_center_A"   ), base->addChild(p);
p = sgroot->createSceneGraph("shoulder_L_A"     ), base->addChild(p);
p = sgroot->createSceneGraph("body_A"           ), base->addChild(p);
p = sgroot->createSceneGraph("body_B"           ), base->addChild(p);
p = sgroot->createSceneGraph("body_C"           ), base->addChild(p);
p = sgroot->createSceneGraph("chest_center_B"   ), base->addChild(p);
p = sgroot->createSceneGraph("chest_R_C"        ), base->addChild(p);
p = sgroot->createSceneGraph("chest_L_C"        ), base->addChild(p);
p = sgroot->createSceneGraph("chest_L_B"        ), base->addChild(p);
p = sgroot->createSceneGraph("chest_R_B"        ), base->addChild(p);
p = sgroot->createSceneGraph("west_D"           ), base->addChild(p);
p = sgroot->createSceneGraph("west_A"           ), base->addChild(p);
p = sgroot->createSceneGraph("west_B"           ), base->addChild(p);
p = sgroot->createSceneGraph("body_L_A"         ), base->addChild(p);
p = sgroot->createSceneGraph("body_R_A"         ), base->addChild(p);
p = sgroot->createSceneGraph("chest_center_C"   ), base->addChild(p);
p = sgroot->createSceneGraph("chest_B"          ), base->addChild(p);
p = sgroot->createSceneGraph("head_C"           ), base->addChild(p);
p = sgroot->createSceneGraph("head_F"           ), base->addChild(p);
p = sgroot->createSceneGraph("head_D"           ), base->addChild(p);
p = sgroot->createSceneGraph("head_R_B"         ), base->addChild(p);
p = sgroot->createSceneGraph("head_L_B"         ), base->addChild(p);
p = sgroot->createSceneGraph("head_L_A"         ), base->addChild(p);
p = sgroot->createSceneGraph("head_R_A"         ), base->addChild(p);
p = sgroot->createSceneGraph("head_B"           ), base->addChild(p);
p = sgroot->createSceneGraph("head_A"           ), base->addChild(p);
p = sgroot->createSceneGraph("shoulder_L_B"     ), base->addChild(p);
p = sgroot->createSceneGraph("shoulder_L_C"     ), base->addChild(p);
p = sgroot->createSceneGraph("arm_L_A"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_L_B"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_R_D"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_L_F"          ), base->addChild(p);
p = sgroot->createSceneGraph("arm_R_G"          ), base->addChild(p);
p = sgroot->createSceneGraph("shield_R_C"       ), base->addChild(p);
p = sgroot->createSceneGraph("shield_R_E"       ), base->addChild(p);
p = sgroot->createSceneGraph("shield_L_B"       ), base->addChild(p);
p = sgroot->createSceneGraph("shield_R_B"       ), base->addChild(p);
p = sgroot->createSceneGraph("shield_R_A"       ), base->addChild(p);
p = sgroot->createSceneGraph("west_C"           ), base->addChild(p);
p = sgroot->createSceneGraph("foot_L_D"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_R_D"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_L_F"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_R_F"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_R_C"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_R_E"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_R_A"         ), base->addChild(p);
p = sgroot->createSceneGraph("foot_R_B"         ), base->addChild(p);
p = sgroot->createSceneGraph("chest_A"          ), base->addChild(p);
p = sgroot->createSceneGraph("foot_L_A"         ), base->addChild(p);

    return base;
}

void
init_gaplant(TaskManager *manager, int w, int h)
{
    SceneGraphPtr back;
    SceneGraphPtr gaplant;
    sgroot->createFromXMLfile(manager, "xml_file/gap_plane_test.xml");
    sgroot->createFromXMLfile(manager, "xml_file/Ball.xml");
    int len = 0;

    back = sgroot->createSceneGraph();
    back->set_move_collision(back_move, back_coll);
    gaplant = create_gaplant();
    /*
    for (int i = arm_L_D; i <= foot_L_A; i++) {
	SceneGraphPtr p = sgroot->createSceneGraph(i);
	gaplant->addChild(p);
    }
    */
    gaplant->xyz[0] = 200;
    gaplant->angle[0] = -60;
    gaplant->angle[1] = 0;
    gaplant->angle[2] = 0;
    gaplant->set_move_collision(gaplant_move, gaplant_coll);
    back->addChild(gaplant);
    sgroot->setSceneData(back);        
}