Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 16, 2005, 11:43:28 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: collision-gui implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4640 r4646  
    2727#include "md2Model.h"
    2828
     29#include "graphics_engine.h"
    2930
    3031
     
    3637void Framework::moduleInit(int argc, char** argv)
    3738{
     39  GraphicsEngine::getInstance()->setWindowName("Collision Cluster", "collision");
     40
    3841  CDEngine::getInstance();
    39   CDEngine::getInstance()->debug();
    40 
    41   //model = new MD2Model("models/tris.md2", "models/tris.pcx");
    42   //model->tick(0.1f);
     42  //CDEngine::getInstance()->debug();
     43
     44  model = new MD2Model("models/tris.md2", "models/tris.pcx");
     45  model->tick(0.1f);
    4346
    4447//   int const length = 6;
     
    5356//   }
    5457
    55   //CDEngine::getInstance()->debugSpawnTree(3, model->data->pVertices, model->data->numVertices);
     58  CDEngine::getInstance()->debugSpawnTree(9, model->data->pVertices, model->data->numVertices);
    5659
    5760
     
    210213}
    211214
    212 /*
     215int boxPolygons(GtkWidget* nonInterest, void* widget)
     216{
     217  if(drawMode & DRAW_BV_POLYGON)
     218  {
     219    int temp = drawMode & DRAW_BV_POLYGON;
     220    drawMode ^= temp;
     221    printf("Removing OBB Polygons\n");
     222  }
     223  else
     224  {
     225    drawMode |= DRAW_BV_POLYGON;
     226    printf("Drawing OBB Polygons\n");
     227  }
     228}
     229
     230int seperatingPlanes(GtkWidget* nonInterest, void* widget)
     231{
     232  if(drawMode & DRAW_SEPARATING_PLANE)
     233  {
     234    int temp = drawMode & DRAW_SEPARATING_PLANE;
     235    drawMode ^= temp;
     236    printf("Removing Separation Plane\n");
     237  }
     238  else
     239  {
     240    drawMode |= DRAW_SEPARATING_PLANE;
     241    printf("Drawing Separation Plane\n");
     242  }
     243}
     244
     245int treeDepth(GtkWidget* nonInterest, void* widget)
     246{
     247  Option* option = (Option*) widget;
     248  const char* name = option->getTitle();
     249  char* value = option->save();
     250
     251  depth = atoi(value);
     252  printf("Setting tree depth = %i\n", depth);
     253  int temp = drawMode & DRAW_ALL;
     254  drawMode ^= temp;
     255  drawMode |= DRAW_SINGLE;
     256
     257  delete value;
     258}
     259
     260
    213261void Framework::moduleInitGui(int argc, char** argv)
    214262{
     
    219267  guiMainWindow = new Window("Collision_detection");
    220268  {
    221     //all the Widgets you need
     269    Box* windowBox = new Box('v');
     270    {
     271      CheckButton* BoxPolygons = new CheckButton("BoxPolygons");
     272      BoxPolygons->connectSignal("clicked", (void*)BoxPolygons, boxPolygons);
     273      windowBox->fill(BoxPolygons);
     274
     275
     276      CheckButton* SeperatingPlanes = new CheckButton("SeperatingPlanes");
     277      SeperatingPlanes->connectSignal("clicked", (void*)SeperatingPlanes, seperatingPlanes);
     278      windowBox->fill(SeperatingPlanes);
     279
     280      Slider* TreeDepth = new Slider("TreeDepth", 0, 5);
     281      TreeDepth->connectSignal("value_changed", (void*)TreeDepth, treeDepth);
     282      windowBox->fill(TreeDepth);
     283    }
     284    guiMainWindow->fill(windowBox);
    222285  }
    223286  Window::mainWindow->showall();
    224287  Window::mainWindow->setSize(300, 500);
    225288}
    226 */
Note: See TracChangeset for help on using the changeset viewer.