Changeset 4647 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Jun 17, 2005, 12:12:11 AM (19 years ago)
- Location:
- orxonox/trunk/src/subprojects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc
r4646 r4647 69 69 depth = 2; 70 70 71 moduleHelp(); 72 } 73 74 75 void Framework::moduleEventHandler(SDL_Event* event) 76 { 77 switch (event->type) 78 { 79 case SDL_KEYDOWN: 80 switch (event->key.keysym.sym) 81 { 82 case SDLK_a: 83 drawMode |= DRAW_ALL; 84 break; 85 case SDLK_0: 86 { 87 printf("Setting tree depth = 0\n"); 88 depth = 0; 89 int temp = drawMode & DRAW_ALL; 90 drawMode ^= temp; 91 drawMode |= DRAW_SINGLE; 92 break; 93 } 94 case SDLK_1: 95 { 96 printf("Setting tree depth = 1\n"); 97 depth = 1; 98 int temp = drawMode & DRAW_ALL; 99 drawMode ^= temp; 100 drawMode |= DRAW_SINGLE; 101 break; 102 } 103 case SDLK_2: 104 { 105 printf("Setting tree depth = 2\n"); 106 depth = 2; 107 int temp = drawMode & DRAW_ALL; 108 drawMode ^= temp; 109 drawMode |= DRAW_SINGLE; 110 break; 111 } 112 case SDLK_3: 113 { 114 printf("Setting tree depth = 3\n"); 115 depth = 3; 116 int temp = drawMode & DRAW_ALL; 117 drawMode ^= temp; 118 drawMode |= DRAW_SINGLE; 119 break; 120 } 121 case SDLK_4: 122 { 123 printf("Setting tree depth = 4\n"); 124 depth = 4; 125 int temp = drawMode & DRAW_ALL; 126 drawMode ^= temp; 127 drawMode |= DRAW_SINGLE; 128 break; 129 } 130 case SDLK_5: 131 { 132 printf("Setting tree depth = 5\n"); 133 depth = 5; 134 int temp = drawMode & DRAW_ALL; 135 drawMode ^= temp; 136 drawMode |= DRAW_SINGLE; 137 break; 138 } 139 case SDLK_6: 140 { 141 printf("Setting tree depth = 6\n"); 142 depth = 6; 143 int temp = drawMode & DRAW_ALL; 144 drawMode ^= temp; 145 drawMode |= DRAW_SINGLE; 146 break; 147 } 148 case SDLK_s: 149 if(drawMode & DRAW_SEPARATING_PLANE) 150 { 151 int temp = drawMode & DRAW_SEPARATING_PLANE; 152 drawMode ^= temp; 153 printf("Removing Separation Plane\n"); 154 } 155 else 156 { 157 drawMode |= DRAW_SEPARATING_PLANE; 158 printf("Drawing Separation Plane\n"); 159 } 160 161 break; 162 case SDLK_p: 163 if(drawMode & DRAW_BV_POLYGON) 164 { 165 int temp = drawMode & DRAW_BV_POLYGON; 166 drawMode ^= temp; 167 printf("Removing OBB Polygons\n"); 168 } 169 else 170 { 171 drawMode |= DRAW_BV_POLYGON; 172 printf("Drawing OBB Polygons\n"); 173 } 174 break; 175 176 } 177 } 178 } 179 180 181 void Framework::moduleTick(float dt) 182 { 183 } 184 185 186 void Framework::moduleDraw() const 187 { 188 CDEngine::getInstance()->drawBV(depth, drawMode); 189 190 LightManager::getInstance()->draw(); 191 192 //model->draw(); 193 } 194 195 196 void Framework::moduleHelp(void) const 197 { 71 198 printf("\n\n==========================="); 72 199 printf("Collision Detection Modler:\n"); … … 82 209 printf(" -| Tree Depth 5\t\t 5\n"); 83 210 printf("===========================\n\n"); 84 } 85 86 87 void Framework::moduleEventHandler(SDL_Event* event) 88 { 89 switch (event->type) 90 { 91 case SDL_KEYDOWN: 92 switch (event->key.keysym.sym) 93 { 94 case SDLK_a: 95 drawMode |= DRAW_ALL; 96 break; 97 case SDLK_0: 98 { 99 printf("Setting tree depth = 0\n"); 100 depth = 0; 101 int temp = drawMode & DRAW_ALL; 102 drawMode ^= temp; 103 drawMode |= DRAW_SINGLE; 104 break; 105 } 106 case SDLK_1: 107 { 108 printf("Setting tree depth = 1\n"); 109 depth = 1; 110 int temp = drawMode & DRAW_ALL; 111 drawMode ^= temp; 112 drawMode |= DRAW_SINGLE; 113 break; 114 } 115 case SDLK_2: 116 { 117 printf("Setting tree depth = 2\n"); 118 depth = 2; 119 int temp = drawMode & DRAW_ALL; 120 drawMode ^= temp; 121 drawMode |= DRAW_SINGLE; 122 break; 123 } 124 case SDLK_3: 125 { 126 printf("Setting tree depth = 3\n"); 127 depth = 3; 128 int temp = drawMode & DRAW_ALL; 129 drawMode ^= temp; 130 drawMode |= DRAW_SINGLE; 131 break; 132 } 133 case SDLK_4: 134 { 135 printf("Setting tree depth = 4\n"); 136 depth = 4; 137 int temp = drawMode & DRAW_ALL; 138 drawMode ^= temp; 139 drawMode |= DRAW_SINGLE; 140 break; 141 } 142 case SDLK_5: 143 { 144 printf("Setting tree depth = 5\n"); 145 depth = 5; 146 int temp = drawMode & DRAW_ALL; 147 drawMode ^= temp; 148 drawMode |= DRAW_SINGLE; 149 break; 150 } 151 case SDLK_6: 152 { 153 printf("Setting tree depth = 6\n"); 154 depth = 6; 155 int temp = drawMode & DRAW_ALL; 156 drawMode ^= temp; 157 drawMode |= DRAW_SINGLE; 158 break; 159 } 160 case SDLK_s: 161 if(drawMode & DRAW_SEPARATING_PLANE) 162 { 163 int temp = drawMode & DRAW_SEPARATING_PLANE; 164 drawMode ^= temp; 165 printf("Removing Separation Plane\n"); 166 } 167 else 168 { 169 drawMode |= DRAW_SEPARATING_PLANE; 170 printf("Drawing Separation Plane\n"); 171 } 172 173 break; 174 case SDLK_p: 175 if(drawMode & DRAW_BV_POLYGON) 176 { 177 int temp = drawMode & DRAW_BV_POLYGON; 178 drawMode ^= temp; 179 printf("Removing OBB Polygons\n"); 180 } 181 else 182 { 183 drawMode |= DRAW_BV_POLYGON; 184 printf("Drawing OBB Polygons\n"); 185 } 186 break; 187 188 } 189 } 190 } 191 192 193 void Framework::moduleTick(float dt) 194 { 195 } 196 197 198 void Framework::moduleDraw() const 199 { 200 CDEngine::getInstance()->drawBV(depth, drawMode); 201 202 LightManager::getInstance()->draw(); 203 204 //model->draw(); 205 } 206 207 208 void Framework::moduleHelp(void) const 209 { 210 PRINT(0)("\n"); 211 PRINT(0)("i - print debug information of Collision-detection\n"); 212 PRINT(0)("\n"); 211 213 212 } 214 213 -
orxonox/trunk/src/subprojects/framework.cc
r4636 r4647 184 184 this->printHelp(); 185 185 break; 186 case SDLK_ l:186 case SDLK_c: 187 187 for (int i = 0; i < 3; i++) 188 188 { … … 193 193 } 194 194 break; 195 case SDLK_ 1:195 case SDLK_x: 196 196 for (int i = 0; i < 3; i++) 197 197 { … … 283 283 PRINT(0)("z - zoom out\n"); 284 284 PRINT(0)("r - reset camera position\n"); 285 PRINT(0)(" 1- background color darker\n");286 PRINT(0)(" 2- background color brighter\n");285 PRINT(0)("x - background color darker\n"); 286 PRINT(0)("c - background color brighter\n"); 287 287 288 288
Note: See TracChangeset
for help on using the changeset viewer.