Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc @ 4630

Last change on this file since 4630 was 4630, checked in by patrick, 19 years ago

orxonox/trunk: the memory requirements are lowered, some strucural changes in the bv generation

File size: 2.3 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14
15   this file extends the framework file, so it renders what i want.
16*/
17
18#include "framework.h"
19
20#include "fields.h"
21#include "stdlibincl.h"
22#include "light.h"
23
24#include "cd_engine.h"
25
26#include "md2Model.h"
27
28MD2Model* model;
29
30void Framework::moduleInit(int argc, char** argv)
31{
32  CDEngine::getInstance();
33  //CDEngine::getInstance()->debug();
34
35  model = new MD2Model("models/tris.md2", "models/tris.pcx");
36  model->tick(0.1f);
37
38//   int const length = 6;
39//   sVec3D* vertList = new sVec3D[length];
40//   sVec3D data[length]  = {{5.0, 0.0, 0.0},{2.0, 0.0, 5.0},{14.0, 0.0, 0.0}, {5.0, 0.0, 1.0}, {12.0, 0.0, 8.0}, {3.0, 5.0, 4.9}};
41//
42//   for(int i = 0; i < length; ++i)
43//   {
44//     vertList[i][0] = data[i][0];
45//     vertList[i][1] = data[i][1];
46//     vertList[i][2] = data[i][2];
47//   }
48
49  CDEngine::getInstance()->debugSpawnTree(1, model->data->pVertices, model->data->numVertices);
50
51
52  LightManager* lightMan = LightManager::getInstance();
53  lightMan->setAmbientColor(.1,.1,.1);
54  lightMan->addLight();
55  lightMan->addLight();
56  lightMan->setPosition(10, 20, 100);
57}
58
59
60void Framework::moduleEventHandler(SDL_Event* event)
61{
62  switch (event->type)
63  {
64    case SDL_KEYDOWN:
65      switch (event->key.keysym.sym)
66      {
67        case SDLK_i:
68          break;
69        case SDLK_1:
70          printf("alsjdf;lajsfd;lajsdf\n");
71          break;
72      }
73  }
74}
75
76
77void Framework::moduleTick(float dt)
78{
79}
80
81
82void Framework::moduleDraw() const
83{
84  CDEngine::getInstance()->drawBV(1);
85
86  LightManager::getInstance()->draw();
87
88  //model->draw();
89}
90
91
92void Framework::moduleHelp(void) const
93{
94  PRINT(0)("\n");
95  PRINT(0)("i - print debug information of Collision-detection\n");
96  PRINT(0)("\n");
97}
98
99
100void Framework::moduleInitGui(int argc, char** argv)
101{
102  Window* guiMainWindow = NULL;
103
104  initGUI(0, NULL);
105
106  guiMainWindow = new Window("Collision_detection");
107  {
108    //all the Widgets you need
109  }
110  Window::mainWindow->showall();
111  Window::mainWindow->setSize(300, 500);
112}
Note: See TracBrowser for help on using the repository browser.