00001 #include "SpherusSimulator.h" 00002 #include "Spherus.h" 00003 #include "Border.h" 00004 #include "Circle.h" 00005 #include "CappedRectangle.h" 00006 00007 SpherusSimulator::SpherusSimulator() { 00008 real width=6, height=4; 00009 //set the borders of the simulator space 00010 registerObject(new Border(0, height/2, 1, 0, "left border")); 00011 registerObject(new Border(width, height/2, -1, 0, "right border")); 00012 registerObject(new Border(width/2, 0, 0, 1, "bottom border")); 00013 registerObject(new Border(width/2, height, 0, -1, "upper border")); 00014 00016 float circles[6][3] = { 00017 {0.1f, 5.0f, 3.0f}, 00018 {0.2f, 0.4f, 0.6f}, 00019 {0.1f, 0.8f, 0.9f}, 00020 {0.2f, 1.7f, 2.8f}, 00021 {0.25f, 4.7f, 2.5f}, 00022 {0.1f, 3.5f, 1.0f} 00023 }; 00024 00025 //add the agent 00026 agent=new Spherus(2.5f, 1.5f); 00027 registerObject(agent); 00028 00029 00030 //add balls 00031 for (unsigned i = 0; i < 6; ++i) { 00032 Circle *circle = 00033 new Circle(circles[i][0], circles[i][1], circles[i][2]); 00034 registerObject(circle); 00035 } 00036 00037 registerObject(new CappedRectangle(0.3f, 0.1f, 3.0f, 2.2f, 10*degrees, "capsule 1")); 00038 } 00039 00040 SpherusSimulator::~SpherusSimulator(){ 00041 00042 } 00043
Thyrix homepage Users' guide
(C) Arxia 2004-2005