- Timestamp:
- Nov 14, 2007, 5:10:12 PM (17 years ago)
- Location:
- code/branches/AI
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI/bin/resources.cfg
r135 r212 8 8 FileSystem=../Media 9 9 FileSystem=../Media/fonts 10 #FileSystem=../Media/materials/programs11 #FileSystem=../Media/materials/scripts12 #FileSystem=../Media/materials/textures13 #FileSystem=../Media/models10 FileSystem=../Media/materials/programs 11 FileSystem=../Media/materials/scripts 12 FileSystem=../Media/materials/textures 13 FileSystem=../Media/models 14 14 #FileSystem=../Media/overlays 15 15 #FileSystem=../Media/particle 16 16 FileSystem=../Media/gui 17 17 #FileSystem=../Media/DeferredShadingMedia 18 #Zip=../Media/packs/cubemap.zip18 Zip=../Media/packs/cubemap.zip 19 19 #Zip=../Media/packs/cubemapsJS.zip 20 20 #Zip=../Media/packs/dragon.zip -
code/branches/AI/src/CMakeLists.txt
r164 r212 4 4 5 5 SET(SRC_FILES orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc) 6 SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h )6 SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h Flocking.h) 7 7 8 8 #Creates an executable -
code/branches/AI/src/orxonox.cc
r164 r212 41 41 #include "xml/xmlParser.h" 42 42 #include "loader/LevelLoader.h" 43 43 #include "Flocking.h" 44 44 45 45 // some tests to see if enet works without includsion … … 76 76 using namespace Ogre; 77 77 78 //my-stuff 79 //globale definition eines Arrays welches alle nodes enthält 80 Vector3 ElementLocationArray[2]; 81 Vector3 ElementSpeedArray[2]; 82 Vector3 ElementAccelerationArray[2]; 83 84 85 78 86 class OrxExitListener : public FrameListener 79 87 { 80 88 public: 81 OrxExitListener(OIS::Keyboard *keyboard )89 OrxExitListener(OIS::Keyboard *keyboard, Root* root) 82 90 : mKeyboard(keyboard) 83 91 { 92 root_ = root; 84 93 } 85 94 86 95 bool frameStarted(const FrameEvent& evt) 87 96 { 97 moving(evt); 88 98 mKeyboard->capture(); 89 99 return !mKeyboard->isKeyDown(OIS::KC_ESCAPE); 90 100 } 101 102 //code the movments of the nodes here 103 void moving(const FrameEvent& evt) { 104 SceneManager *mgr = root_->getSceneManager("Default SceneManager"); 105 mgr->getSceneNode("HeadNode1")->yaw((Radian)10*evt.timeSinceLastFrame); 106 } 91 107 92 108 private: 93 109 OIS::Keyboard *mKeyboard; 110 Root* root_; 94 111 }; 95 112 … … 199 216 SceneManager *mgr = mRoot->createSceneManager(ST_GENERIC, "Default SceneManager"); 200 217 Camera *cam = mgr->createCamera("Camera"); 218 cam->setPosition(Vector3(0,0,500)); 219 cam->lookAt(Vector3(0,0,0)); 201 220 Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam); 221 example(); //my stuff 202 222 } 203 223 … … 239 259 void createFrameListener() 240 260 { 241 mListener = new OrxExitListener(mKeyboard );261 mListener = new OrxExitListener(mKeyboard, mRoot); 242 262 mRoot->addFrameListener(mListener); 243 263 } … … 247 267 mRoot->startRendering(); 248 268 } 269 270 //declaration of the 3 Ogreheads 271 void example() { 272 SceneManager *mgr = mRoot->getSceneManager("Default SceneManager"); 273 mgr->setAmbientLight(ColourValue(1.0,1.0,1.0)); 274 Entity* ent1 = mgr->createEntity("Head1", "ogrehead.mesh"); 275 Entity* ent2 = mgr->createEntity("Head2", "ogrehead.mesh"); 276 Entity* ent3 = mgr->createEntity("Head3", "ogrehead.mesh"); 277 SceneNode *node1 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode1", Vector3(0,0,0)); 278 SceneNode *node2 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode2", Vector3(100,0,0)); 279 SceneNode *node3 = mgr->getRootSceneNode()->createChildSceneNode("HeadNode3", Vector3(-100,0,0)); 280 node1->attachObject(ent1); 281 node2->attachObject(ent2); 282 node3->attachObject(ent3); 283 ElementLocationArray[0] = node1->getPosition(); 284 ElementLocationArray[1] = node2->getPosition(); 285 ElementLocationArray[2] = node3->getPosition(); 286 ElementSpeedArray[0] = (0,0,0); 287 ElementSpeedArray[1] = (0,0,0); 288 ElementSpeedArray[2] = (0,0,0); 289 ElementAccelerationArray[0] = (0,0,0); 290 ElementAccelerationArray[1] = (0,0,0); 291 ElementAccelerationArray[2] = (0,0,0); 292 for (int i=0; i<3; i++) { 293 Element* arrayOfElements[i] = new element( ElementLocationArray[i], ElementSpeedArray[i], ElementAccelerationArray[i] ); 294 } 295 } 249 296 }; 297 298 250 299 251 300 #if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
Note: See TracChangeset
for help on using the changeset viewer.