[74] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * |
---|
| 4 | * |
---|
| 5 | * License notice: |
---|
| 6 | * |
---|
| 7 | * This program is free software: you can redistribute it and/or modify |
---|
| 8 | * it under the terms of the GNU General Public License as published by |
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or |
---|
| 10 | * (at your option) any later version. |
---|
| 11 | * |
---|
| 12 | * This program is distributed in the hope that it will be useful, |
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | * GNU General Public License for more details. |
---|
| 16 | * |
---|
| 17 | * You should have received a copy of the GNU General Public License |
---|
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
| 19 | * |
---|
| 20 | * |
---|
| 21 | * Author: |
---|
| 22 | * Benjamin Knecht <beni_at_orxonox.net>, (C) 2007 |
---|
| 23 | * Co-authors: |
---|
| 24 | * ... |
---|
| 25 | * |
---|
| 26 | */ |
---|
| 27 | |
---|
[142] | 28 | /** |
---|
| 29 | @file orxonox.cc |
---|
| 30 | @brief Orxonox Main File |
---|
| 31 | */ |
---|
| 32 | |
---|
[137] | 33 | #include <Ogre.h> |
---|
| 34 | #include <OIS/OIS.h> |
---|
| 35 | #include <CEGUI/CEGUI.h> |
---|
| 36 | #include <OgreCEGUIRenderer.h> |
---|
[426] | 37 | #include <OgreMath.h> |
---|
[74] | 38 | |
---|
[164] | 39 | #include <string> |
---|
| 40 | #include <iostream> |
---|
| 41 | |
---|
| 42 | #include "xml/xmlParser.h" |
---|
| 43 | #include "loader/LevelLoader.h" |
---|
[212] | 44 | #include "Flocking.h" |
---|
[426] | 45 | #include "AIClass.h" |
---|
[164] | 46 | |
---|
[151] | 47 | // some tests to see if enet works without includsion |
---|
| 48 | //#include <enet/enet.h> |
---|
| 49 | //#include <enet/protocol.h> |
---|
[142] | 50 | |
---|
[137] | 51 | #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE |
---|
| 52 | #include <CoreFoundation/CoreFoundation.h> |
---|
[74] | 53 | |
---|
[137] | 54 | // This function will locate the path to our application on OS X, |
---|
| 55 | // unlike windows you can not rely on the curent working directory |
---|
| 56 | // for locating your configuration files and resources. |
---|
| 57 | std::string macBundlePath() |
---|
[74] | 58 | { |
---|
[137] | 59 | char path[1024]; |
---|
| 60 | CFBundleRef mainBundle = CFBundleGetMainBundle(); |
---|
| 61 | assert(mainBundle); |
---|
| 62 | |
---|
| 63 | CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle); |
---|
| 64 | assert(mainBundleURL); |
---|
| 65 | |
---|
| 66 | CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle); |
---|
| 67 | assert(cfStringRef); |
---|
| 68 | |
---|
| 69 | CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII); |
---|
| 70 | |
---|
| 71 | CFRelease(mainBundleURL); |
---|
| 72 | CFRelease(cfStringRef); |
---|
| 73 | |
---|
| 74 | return std::string(path); |
---|
| 75 | } |
---|
| 76 | #endif |
---|
| 77 | |
---|
| 78 | using namespace Ogre; |
---|
| 79 | |
---|
[212] | 80 | //my-stuff |
---|
| 81 | //globale definition eines Arrays welches alle nodes enthält |
---|
[426] | 82 | Vector3 ElementLocationArray[9]; |
---|
| 83 | Vector3 ElementSpeedArray[9]; |
---|
| 84 | Vector3 ElementAccelerationArray[9]; |
---|
[212] | 85 | |
---|
[426] | 86 | Element arrayOfElements[9]; |
---|
[212] | 87 | |
---|
[426] | 88 | // float time = 0; |
---|
[212] | 89 | |
---|
[426] | 90 | |
---|
[137] | 91 | class OrxExitListener : public FrameListener |
---|
| 92 | { |
---|
[74] | 93 | public: |
---|
[212] | 94 | OrxExitListener(OIS::Keyboard *keyboard, Root* root) |
---|
[137] | 95 | : mKeyboard(keyboard) |
---|
[74] | 96 | { |
---|
[212] | 97 | root_ = root; |
---|
[74] | 98 | } |
---|
| 99 | |
---|
[137] | 100 | bool frameStarted(const FrameEvent& evt) |
---|
[74] | 101 | { |
---|
[212] | 102 | moving(evt); |
---|
[137] | 103 | mKeyboard->capture(); |
---|
| 104 | return !mKeyboard->isKeyDown(OIS::KC_ESCAPE); |
---|
| 105 | } |
---|
[212] | 106 | |
---|
| 107 | //code the movments of the nodes here |
---|
| 108 | void moving(const FrameEvent& evt) { |
---|
| 109 | SceneManager *mgr = root_->getSceneManager("Default SceneManager"); |
---|
[325] | 110 | |
---|
| 111 | arrayOfElements[0].update(arrayOfElements, evt); |
---|
| 112 | arrayOfElements[1].update(arrayOfElements, evt); |
---|
| 113 | arrayOfElements[2].update(arrayOfElements, evt); |
---|
[426] | 114 | arrayOfElements[3].update(arrayOfElements, evt); |
---|
| 115 | arrayOfElements[4].update(arrayOfElements, evt); |
---|
| 116 | arrayOfElements[5].update(arrayOfElements, evt); |
---|
| 117 | arrayOfElements[6].update(arrayOfElements, evt); |
---|
| 118 | arrayOfElements[7].update(arrayOfElements, evt); |
---|
| 119 | arrayOfElements[8].update(arrayOfElements, evt); |
---|
[325] | 120 | |
---|
[426] | 121 | /* arrayOfElements[0].update(arrayOfElements, evt); |
---|
| 122 | arrayOfElements[1].update(arrayOfElements, evt); |
---|
| 123 | arrayOfElements[2].update(arrayOfElements, evt); |
---|
| 124 | arrayOfElements[3].update(arrayOfElements, evt); |
---|
| 125 | arrayOfElements[4].update(arrayOfElements, evt); */ |
---|
| 126 | |
---|
| 127 | |
---|
| 128 | for(int i=0; i<9; i++) { |
---|
| 129 | |
---|
| 130 | arrayOfElements[i].speed = 0.995*arrayOfElements[i].speed + arrayOfElements[i].acceleration*evt.timeSinceLastFrame; |
---|
| 131 | |
---|
| 132 | arrayOfElements[i].location = arrayOfElements[i].location + arrayOfElements[i].speed*evt.timeSinceLastFrame; |
---|
| 133 | |
---|
| 134 | arrayOfElements[i].acceleration = (0,0,0); |
---|
| 135 | } |
---|
| 136 | |
---|
[325] | 137 | mgr->getSceneNode("HeadNode1")->setPosition(arrayOfElements[0].location); |
---|
| 138 | mgr->getSceneNode("HeadNode2")->setPosition(arrayOfElements[1].location); |
---|
| 139 | mgr->getSceneNode("HeadNode3")->setPosition(arrayOfElements[2].location); |
---|
[426] | 140 | mgr->getSceneNode("HeadNode4")->setPosition(arrayOfElements[3].location); |
---|
| 141 | mgr->getSceneNode("HeadNode5")->setPosition(arrayOfElements[4].location); |
---|
| 142 | mgr->getSceneNode("HeadNode6")->setPosition(arrayOfElements[5].location); |
---|
| 143 | mgr->getSceneNode("HeadNode7")->setPosition(arrayOfElements[6].location); |
---|
| 144 | mgr->getSceneNode("HeadNode8")->setPosition(arrayOfElements[7].location); |
---|
| 145 | mgr->getSceneNode("HeadNode9")->setPosition(arrayOfElements[8].location); |
---|
[325] | 146 | |
---|
| 147 | |
---|
[426] | 148 | /* |
---|
[325] | 149 | |
---|
[426] | 150 | mgr->getSceneNode("HeadNode9")->setPosition(Vector3(200*cos(10*time),0,0)); |
---|
| 151 | time = time + evt.timeSinceLastFrame; |
---|
| 152 | |
---|
| 153 | */ |
---|
| 154 | |
---|
| 155 | |
---|
| 156 | |
---|
[325] | 157 | // mgr->getSceneNode("HeadNode1")->yaw((Radian)10*evt.timeSinceLastFrame); |
---|
[212] | 158 | } |
---|
[135] | 159 | |
---|
[74] | 160 | private: |
---|
[137] | 161 | OIS::Keyboard *mKeyboard; |
---|
[212] | 162 | Root* root_; |
---|
[74] | 163 | }; |
---|
| 164 | |
---|
[137] | 165 | class OrxApplication |
---|
[74] | 166 | { |
---|
| 167 | public: |
---|
[137] | 168 | void go() |
---|
[74] | 169 | { |
---|
[137] | 170 | createRoot(); |
---|
| 171 | defineResources(); |
---|
| 172 | setupRenderSystem(); |
---|
| 173 | createRenderWindow(); |
---|
| 174 | initializeResourceGroups(); |
---|
[164] | 175 | createScene(); |
---|
[137] | 176 | setupScene(); |
---|
| 177 | setupInputSystem(); |
---|
| 178 | setupCEGUI(); |
---|
| 179 | createFrameListener(); |
---|
| 180 | startRenderLoop(); |
---|
[74] | 181 | } |
---|
| 182 | |
---|
[137] | 183 | ~OrxApplication() |
---|
[74] | 184 | { |
---|
[137] | 185 | mInputManager->destroyInputObject(mKeyboard); |
---|
| 186 | OIS::InputManager::destroyInputSystem(mInputManager); |
---|
| 187 | |
---|
[148] | 188 | // delete mRenderer; |
---|
| 189 | // delete mSystem; |
---|
[137] | 190 | |
---|
| 191 | delete mListener; |
---|
| 192 | delete mRoot; |
---|
[74] | 193 | } |
---|
[137] | 194 | |
---|
| 195 | private: |
---|
| 196 | Root *mRoot; |
---|
| 197 | OIS::Keyboard *mKeyboard; |
---|
| 198 | OIS::Mouse *mMouse; |
---|
| 199 | OIS::InputManager *mInputManager; |
---|
| 200 | CEGUI::OgreCEGUIRenderer *mRenderer; |
---|
| 201 | CEGUI::System *mSystem; |
---|
| 202 | OrxExitListener *mListener; |
---|
| 203 | |
---|
| 204 | void createRoot() |
---|
[74] | 205 | { |
---|
[137] | 206 | #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE |
---|
| 207 | mRoot = new Root(macBundlePath() + "/Contents/Resources/plugins.cfg"); |
---|
| 208 | #else |
---|
| 209 | mRoot = new Root(); |
---|
| 210 | #endif |
---|
[74] | 211 | } |
---|
| 212 | |
---|
[137] | 213 | void defineResources() |
---|
[74] | 214 | { |
---|
[137] | 215 | String secName, typeName, archName; |
---|
| 216 | ConfigFile cf; |
---|
| 217 | #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE |
---|
| 218 | cf.load(macBundlePath() + "/Contents/Resources/resources.cfg"); |
---|
| 219 | #else |
---|
| 220 | cf.load("resources.cfg"); |
---|
| 221 | #endif |
---|
[74] | 222 | |
---|
[137] | 223 | ConfigFile::SectionIterator seci = cf.getSectionIterator(); |
---|
| 224 | while (seci.hasMoreElements()) |
---|
| 225 | { |
---|
| 226 | secName = seci.peekNextKey(); |
---|
| 227 | ConfigFile::SettingsMultiMap *settings = seci.getNext(); |
---|
| 228 | ConfigFile::SettingsMultiMap::iterator i; |
---|
| 229 | for (i = settings->begin(); i != settings->end(); ++i) |
---|
| 230 | { |
---|
| 231 | typeName = i->first; |
---|
| 232 | archName = i->second; |
---|
| 233 | #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE |
---|
| 234 | ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName); |
---|
| 235 | #else |
---|
| 236 | ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName); |
---|
| 237 | #endif |
---|
| 238 | } |
---|
| 239 | } |
---|
| 240 | } |
---|
[74] | 241 | |
---|
[137] | 242 | void setupRenderSystem() |
---|
| 243 | { |
---|
| 244 | if (!mRoot->restoreConfig() && !mRoot->showConfigDialog()) |
---|
| 245 | throw Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()"); |
---|
| 246 | } |
---|
[74] | 247 | |
---|
[137] | 248 | void createRenderWindow() |
---|
| 249 | { |
---|
| 250 | mRoot->initialise(true, "Ogre Render Window"); |
---|
| 251 | } |
---|
[74] | 252 | |
---|
[137] | 253 | void initializeResourceGroups() |
---|
| 254 | { |
---|
| 255 | TextureManager::getSingleton().setDefaultNumMipmaps(5); |
---|
| 256 | ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); |
---|
| 257 | } |
---|
[74] | 258 | |
---|
[164] | 259 | void createScene(void) |
---|
| 260 | { |
---|
| 261 | |
---|
| 262 | string levelFile = "sp_level_moonstation.oxw"; |
---|
| 263 | loader::LevelLoader* loader = new loader::LevelLoader(levelFile); |
---|
| 264 | } |
---|
| 265 | |
---|
[137] | 266 | void setupScene() |
---|
| 267 | { |
---|
| 268 | SceneManager *mgr = mRoot->createSceneManager(ST_GENERIC, "Default SceneManager"); |
---|
| 269 | Camera *cam = mgr->createCamera("Camera"); |
---|
[233] | 270 | cam->setPosition(Vector3(0,0,1000)); |
---|
[212] | 271 | cam->lookAt(Vector3(0,0,0)); |
---|
[137] | 272 | Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam); |
---|
[212] | 273 | example(); //my stuff |
---|
[137] | 274 | } |
---|
[74] | 275 | |
---|
[137] | 276 | void setupInputSystem() |
---|
| 277 | { |
---|
| 278 | size_t windowHnd = 0; |
---|
| 279 | std::ostringstream windowHndStr; |
---|
| 280 | OIS::ParamList pl; |
---|
| 281 | RenderWindow *win = mRoot->getAutoCreatedWindow(); |
---|
[74] | 282 | |
---|
[137] | 283 | win->getCustomAttribute("WINDOW", &windowHnd); |
---|
| 284 | windowHndStr << windowHnd; |
---|
| 285 | pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); |
---|
| 286 | mInputManager = OIS::InputManager::createInputSystem(pl); |
---|
[74] | 287 | |
---|
[137] | 288 | try |
---|
| 289 | { |
---|
| 290 | mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false)); |
---|
| 291 | mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, false)); |
---|
| 292 | } |
---|
| 293 | catch (const OIS::Exception &e) |
---|
| 294 | { |
---|
| 295 | throw new Exception(42, e.eText, "OrxApplication::setupInputSystem"); |
---|
| 296 | } |
---|
[74] | 297 | } |
---|
| 298 | |
---|
[137] | 299 | void setupCEGUI() |
---|
[74] | 300 | { |
---|
[137] | 301 | SceneManager *mgr = mRoot->getSceneManager("Default SceneManager"); |
---|
| 302 | RenderWindow *win = mRoot->getAutoCreatedWindow(); |
---|
| 303 | |
---|
| 304 | // CEGUI setup |
---|
| 305 | // mRenderer = new CEGUI::OgreCEGUIRenderer(win, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mgr); |
---|
| 306 | // mSystem = new CEGUI::System(mRenderer); |
---|
| 307 | |
---|
| 308 | // Other CEGUI setup here. |
---|
[74] | 309 | } |
---|
[137] | 310 | |
---|
| 311 | void createFrameListener() |
---|
| 312 | { |
---|
[212] | 313 | mListener = new OrxExitListener(mKeyboard, mRoot); |
---|
[137] | 314 | mRoot->addFrameListener(mListener); |
---|
| 315 | } |
---|
| 316 | |
---|
| 317 | void startRenderLoop() |
---|
| 318 | { |
---|
| 319 | mRoot->startRendering(); |
---|
| 320 | } |
---|
[212] | 321 | |
---|
| 322 | //declaration of the 3 Ogreheads |
---|
[233] | 323 | //muss leider global sein..... |
---|
| 324 | //Element* arrayOfElements[2]; |
---|
| 325 | |
---|
[212] | 326 | void example() { |
---|
| 327 | SceneManager *mgr = mRoot->getSceneManager("Default SceneManager"); |
---|
| 328 | mgr->setAmbientLight(ColourValue(1.0,1.0,1.0)); |
---|
| 329 | Entity* ent1 = mgr->createEntity("Head1", "ogrehead.mesh"); |
---|
| 330 | Entity* ent2 = mgr->createEntity("Head2", "ogrehead.mesh"); |
---|
| 331 | Entity* ent3 = mgr->createEntity("Head3", "ogrehead.mesh"); |
---|
[426] | 332 | Entity* ent4 = mgr->createEntity("Head4", "ogrehead.mesh"); |
---|
| 333 | Entity* ent5 = mgr->createEntity("Head5", "ogrehead.mesh"); |
---|
| 334 | Entity* ent6 = mgr->createEntity("Head6", "ogrehead.mesh"); |
---|
| 335 | Entity* ent7 = mgr->createEntity("Head7", "ogrehead.mesh"); |
---|
| 336 | Entity* ent8 = mgr->createEntity("Head8", "ogrehead.mesh"); |
---|
| 337 | Entity* ent9 = mgr->createEntity("Head9", "ogrehead.mesh"); |
---|
| 338 | SceneNode *node1 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode1", Vector3(100,300,100)); |
---|
| 339 | SceneNode *node2 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode2", Vector3(300,0,200)); |
---|
| 340 | SceneNode *node3 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode3", Vector3(-300,0,-100)); |
---|
| 341 | SceneNode *node4 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode4", Vector3(-100,-300,150)); |
---|
| 342 | SceneNode *node5 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode5", Vector3(150,150,-100)); |
---|
| 343 | SceneNode *node6 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode6", Vector3(150,-150,-100)); |
---|
| 344 | SceneNode *node7 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode7", Vector3(-150,-150,0)); |
---|
| 345 | SceneNode *node8 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode8", Vector3(-150,150,0)); |
---|
| 346 | SceneNode *node9 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode9", Vector3(0,0,0)); |
---|
| 347 | |
---|
| 348 | // follwing camera |
---|
| 349 | |
---|
| 350 | // Camera *cam = mgr->getCamera("Camera"); |
---|
| 351 | // node1->attachObject(cam); |
---|
| 352 | |
---|
| 353 | |
---|
| 354 | |
---|
| 355 | |
---|
[212] | 356 | node1->attachObject(ent1); |
---|
| 357 | node2->attachObject(ent2); |
---|
| 358 | node3->attachObject(ent3); |
---|
[426] | 359 | node4->attachObject(ent4); |
---|
| 360 | node5->attachObject(ent5); |
---|
| 361 | node6->attachObject(ent6); |
---|
| 362 | node7->attachObject(ent7); |
---|
| 363 | node8->attachObject(ent8); |
---|
| 364 | node9->attachObject(ent9); |
---|
[212] | 365 | ElementLocationArray[0] = node1->getPosition(); |
---|
| 366 | ElementLocationArray[1] = node2->getPosition(); |
---|
| 367 | ElementLocationArray[2] = node3->getPosition(); |
---|
[426] | 368 | ElementLocationArray[3] = node4->getPosition(); |
---|
| 369 | ElementLocationArray[4] = node5->getPosition(); |
---|
| 370 | ElementLocationArray[5] = node6->getPosition(); |
---|
| 371 | ElementLocationArray[6] = node7->getPosition(); |
---|
| 372 | ElementLocationArray[7] = node8->getPosition(); |
---|
| 373 | ElementLocationArray[8] = node9->getPosition(); |
---|
| 374 | /* |
---|
| 375 | ElementLocationArray[5] = node6->getPosition(); |
---|
| 376 | ElementLocationArray[6] = node7->getPosition();*/ |
---|
[212] | 377 | ElementSpeedArray[0] = (0,0,0); |
---|
| 378 | ElementSpeedArray[1] = (0,0,0); |
---|
| 379 | ElementSpeedArray[2] = (0,0,0); |
---|
[426] | 380 | ElementSpeedArray[3] = (0,0,0); |
---|
| 381 | ElementSpeedArray[4] = (0,0,0); |
---|
| 382 | ElementSpeedArray[5] = (0,0,0); |
---|
| 383 | ElementSpeedArray[6] = (0,0,0); |
---|
| 384 | ElementSpeedArray[7] = (0,0,0); |
---|
| 385 | ElementSpeedArray[8] = (0,0,0); |
---|
| 386 | /* |
---|
| 387 | ElementSpeedArray[5] = (0,0,0); |
---|
| 388 | ElementSpeedArray[6] = (0,0,0); */ |
---|
[212] | 389 | ElementAccelerationArray[0] = (0,0,0); |
---|
| 390 | ElementAccelerationArray[1] = (0,0,0); |
---|
| 391 | ElementAccelerationArray[2] = (0,0,0); |
---|
[426] | 392 | ElementAccelerationArray[3] = (0,0,0); |
---|
| 393 | ElementAccelerationArray[4] = (0,0,0); |
---|
| 394 | ElementAccelerationArray[5] = (0,0,0); |
---|
| 395 | ElementAccelerationArray[6] = (0,0,0); |
---|
| 396 | ElementAccelerationArray[7] = (0,0,0); |
---|
| 397 | ElementAccelerationArray[8] = (0,0,0); |
---|
| 398 | /* |
---|
| 399 | ElementAccelerationArray[5] = (0,0,0); |
---|
| 400 | ElementAccelerationArray[6] = (0,0,0); */ |
---|
| 401 | arrayOfElements[0].setValues( ElementLocationArray[0], ElementSpeedArray[0], ElementAccelerationArray[0], true); |
---|
| 402 | arrayOfElements[1].setValues( ElementLocationArray[1], ElementSpeedArray[1], ElementAccelerationArray[1], true); |
---|
| 403 | arrayOfElements[2].setValues( ElementLocationArray[2], ElementSpeedArray[2], ElementAccelerationArray[2], true); |
---|
| 404 | arrayOfElements[3].setValues( ElementLocationArray[3], ElementSpeedArray[3], ElementAccelerationArray[3], true); |
---|
| 405 | arrayOfElements[4].setValues( ElementLocationArray[4], ElementSpeedArray[4], ElementAccelerationArray[4], true); |
---|
| 406 | arrayOfElements[5].setValues( ElementLocationArray[5], ElementSpeedArray[5], ElementAccelerationArray[5], true); |
---|
| 407 | arrayOfElements[6].setValues( ElementLocationArray[6], ElementSpeedArray[6], ElementAccelerationArray[6], true); |
---|
| 408 | arrayOfElements[7].setValues( ElementLocationArray[7], ElementSpeedArray[7], ElementAccelerationArray[7], true); |
---|
| 409 | arrayOfElements[8].setValues( ElementLocationArray[8], ElementSpeedArray[8], ElementAccelerationArray[8], false); |
---|
| 410 | /* |
---|
| 411 | arrayOfElements[5].setValues( ElementLocationArray[5], ElementSpeedArray[5], ElementAccelerationArray[5], false); |
---|
| 412 | arrayOfElements[6].setValues( ElementLocationArray[6], ElementSpeedArray[6], ElementAccelerationArray[6], false);*/ |
---|
[233] | 413 | |
---|
| 414 | |
---|
| 415 | |
---|
| 416 | |
---|
| 417 | /* for (int i=0; i<3; i++) { |
---|
| 418 | Element* arrayOfElements[i] = new Element( ElementLocationArray[i], ElementSpeedArray[i], ElementAccelerationArray[i] ); |
---|
| 419 | } */ |
---|
| 420 | /* for (int i=0; i<3; i++) { |
---|
| 421 | arrayOfElements[i]->update(arrayOfElements); |
---|
| 422 | } */ |
---|
[426] | 423 | |
---|
| 424 | //testing AIPilot -> function steer |
---|
| 425 | // AIPilot temp; |
---|
| 426 | // Vector3 foo = temp.steer(Vector3(0,0,1)); |
---|
| 427 | |
---|
| 428 | |
---|
[212] | 429 | } |
---|
[74] | 430 | }; |
---|
| 431 | |
---|
[212] | 432 | |
---|
| 433 | |
---|
[137] | 434 | #if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32 |
---|
[74] | 435 | #define WIN32_LEAN_AND_MEAN |
---|
| 436 | #include "windows.h" |
---|
| 437 | |
---|
[137] | 438 | INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT) |
---|
[74] | 439 | #else |
---|
[137] | 440 | int main(int argc, char **argv) |
---|
[74] | 441 | #endif |
---|
| 442 | { |
---|
[137] | 443 | try |
---|
| 444 | { |
---|
| 445 | OrxApplication orxonox; |
---|
[74] | 446 | orxonox.go(); |
---|
[137] | 447 | } |
---|
| 448 | catch(Exception& e) |
---|
| 449 | { |
---|
| 450 | #if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32 |
---|
| 451 | MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL); |
---|
[74] | 452 | #else |
---|
| 453 | fprintf(stderr, "An exception has occurred: %s\n", |
---|
| 454 | e.getFullDescription().c_str()); |
---|
| 455 | #endif |
---|
| 456 | } |
---|
| 457 | |
---|
| 458 | return 0; |
---|
| 459 | } |
---|
[137] | 460 | |
---|