Changeset 160 for trunk/VUT/Ogre
- Timestamp:
- 07/08/05 01:53:01 (19 years ago)
- Location:
- trunk/VUT/Ogre
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgrePlatformOcclusionQuery.h
r87 r160 21 21 22 22 virtual bool GetQueryResult(unsigned int &queryResult, 23 23 const bool waitForResult) const; 24 24 virtual void BeginQuery(); 25 25 virtual void EndQuery(); -
trunk/VUT/Ogre/include/OgreSceneContentGenerator.h
r130 r160 7 7 8 8 namespace Ogre { 9 10 typedef std::vector<SceneNode *> SceneNodeList; 11 typedef std::vector<Entity *> EntityList; 9 12 10 13 /** Class which fills a scene with content in a random fashion. … … 20 23 */ 21 24 void GenerateScene(int numObjects, const String &objName); 25 22 26 /** Generates a new object in the scene using ray scene queries 23 27 and inserts it into thr scene hierarchy. … … 31 35 const Vector3 &rotation, const String &objName); 32 36 37 /** Minimum angle for the random orientation. 38 */ 33 39 void SetMinAngle(Vector3 minAngle); 40 41 /** Maximum angle for the random orientation. 42 */ 34 43 void SetMaxAngle(Vector3 maxAngle); 44 45 /** Minimum possible random position. 46 */ 35 47 void SetMinPos(Vector3 minPos); 48 /** Maximum possible random position. 49 */ 36 50 void SetMaxPos(Vector3 maxPos); 51 /** Scale factor applied to each generated object. 52 */ 37 53 void SetScale(Vector3 scale); 38 54 39 /** The number of created objects */ 55 /** The number of created objects. 56 */ 40 57 int GetObjectCount(); 41 58 42 /** Writes scene nodes to file */ 59 /** Writes scene nodes to file. 60 */ 43 61 bool WriteObjects(const std::string &filename); 44 62 45 /** Loads scene nodes from file */ 63 /** Loads scene nodes from file. 64 */ 46 65 bool LoadObjects(const std::string &filename); 66 47 67 /** Generates a scene object with the specified parameters 48 68 @param position the position of the scene object … … 53 73 SceneNode *GenerateSceneObject(const Vector3 &position, 54 74 const Quaternion &orientation, const String &objName); 75 76 /** Gets pointer to list of generated scene nodes. 77 */ 78 SceneNodeList *GetGeneratedSceneNodes(); 79 80 /** Gets pointer to list of entities. 81 */ 82 EntityList *GetGeneratedEntities(); 83 84 /** Removes generated object from scene graph. 85 */ 86 void RemoveGeneratedObjects(); 55 87 56 88 protected: … … 64 96 SceneManager *mSceneMgr; 65 97 66 std::vector<SceneNode *> mSceneObjects; 98 SceneNodeList mSceneNodes; 99 EntityList mEntities; 67 100 }; 68 101 -
trunk/VUT/Ogre/resources/VisibilityDemo.overlay
r159 r160 12 12 } 13 13 14 Example/Visibility/ DemoOverlay14 Example/Visibility/CullStatsOverlay 15 15 { 16 16 zorder 500 … … 40 40 { 41 41 left 5 42 top 543 42 width 180 44 43 caption [SPACE] Algorithm … … 47 46 { 48 47 left 210 49 top 550 48 width 120 51 49 height 30 … … 56 54 { 57 55 left 5 58 top 2059 56 width 120 60 57 height 30 … … 64 61 { 65 62 left 210 66 top 2067 63 width 120 68 64 height 30 … … 72 68 { 73 69 left 5 74 top 3575 70 width 120 76 71 height 30 … … 80 75 { 81 76 left 210 82 top 3583 77 width 120 84 78 height 30 … … 88 82 { 89 83 left 5 90 top 5091 84 width 120 92 85 height 30 … … 96 89 { 97 90 left 210 98 top 5099 91 width 120 100 92 height 30 … … 104 96 { 105 97 left 5 106 top 65107 98 width 120 108 99 height 30 … … 113 104 { 114 105 left 210 115 top 65 116 width 120 117 height 30 118 caption : 119 } 106 width 120 107 height 30 108 caption : 109 } 110 element TextArea(Example/Visibility/CurrentObjectType): Example/Visibility/Templates/BasicText 111 { 112 left 5 113 width 120 114 height 30 115 caption [F7] Object type 116 } 117 element TextArea(Example/Visibility/CurrentObjectTypeInfo): Example/Visibility/Templates/BasicText 118 { 119 left 210 120 width 90 121 font_name TrebuchetMSBold 122 caption : 123 } 120 124 } 121 125 … … 128 132 top 5 129 133 width 320 130 height 1 50134 height 135 131 135 material Core/StatsBlockCenter 132 136 border_size 1 1 1 1 … … 144 148 { 145 149 left 5 146 top 5147 150 width 180 148 151 height 30 … … 152 155 { 153 156 left 180 154 top 5155 157 width 90 156 158 height 30 … … 160 162 { 161 163 left 5 162 top 20163 164 width 180 164 165 height 30 … … 168 169 { 169 170 left 180 170 top 20171 171 width 90 172 172 height 30 … … 176 176 { 177 177 left 5 178 top 35179 178 width 180 180 179 height 30 … … 184 183 { 185 184 left 180 186 top 35187 185 width 90 188 186 height 30 … … 192 190 { 193 191 left 5 194 top 50195 192 width 180 196 193 height 30 … … 200 197 { 201 198 left 180 202 top 50203 199 width 90 204 200 height 30 … … 208 204 { 209 205 left 5 210 top 65211 206 width 180 212 207 height 30 … … 216 211 { 217 212 left 180 218 top 65 219 width 90 220 height 30 221 caption : 222 } 223 element TextArea(Example/Visibility/Objects): Example/Visibility/Templates/BasicText 224 { 225 left 5 226 top 80 213 width 90 214 height 30 215 caption : 216 } 217 element TextArea(Example/Visibility/ObjectsCount): Example/Visibility/Templates/BasicText 218 { 219 left 5 227 220 width 180 228 221 height 30 229 222 caption Number of objects 230 223 } 231 element TextArea(Example/Visibility/ObjectsInfo): Example/Visibility/Templates/BasicText 232 { 233 left 180 234 top 80 224 element TextArea(Example/Visibility/ObjectsCountInfo): Example/Visibility/Templates/BasicText 225 { 226 left 180 235 227 width 90 236 228 height 30 … … 240 232 { 241 233 left 5 242 top 95243 234 width 180 244 235 height 30 … … 248 239 { 249 240 left 180 250 top 95251 241 width 90 252 242 font_name TrebuchetMSBold 253 243 caption : 254 } 255 element TextArea(Example/Visibility/DelayedQueriesIssued): Example/Visibility/Templates/BasicText 256 { 257 left 5 258 top 110 259 width 180 260 height 30 261 caption Avg. queries issued 262 } 263 element TextArea(Example/Visibility/DelayedQueriesIssuedInfo): Example/Visibility/Templates/BasicText 264 { 265 left 180 266 top 110 267 width 90 268 font_name TrebuchetMSBold 269 caption : 270 } 271 element TextArea(Example/Visibility/DelayedTraversedNodes): Example/Visibility/Templates/BasicText 272 { 273 left 5 274 top 125 275 width 180 276 height 30 277 caption Avg. traversed Nodes 278 } 279 element TextArea(Example/Visibility/DelayedTraversedNodesInfo): Example/Visibility/Templates/BasicText 280 { 281 left 180 282 top 125 283 width 90 284 font_name TrebuchetMSBold 285 caption : 286 } 244 } 245 287 246 } 288 247 } … … 334 293 font_name TrebuchetMSBold 335 294 char_height 19 336 caption Additional Options295 caption Help: Additional Options 337 296 colour_top 1 1 0.7 338 297 colour_bottom 1 1 0.7 339 298 } 340 299 341 element TextArea(Example/Visibility/Help/ShowHelpInfo): Example/Visibility/Templates/BasicText 342 { 343 left 5 344 top 30 300 element TextArea(Example/Visibility/Help/ShowHelp): Example/Visibility/Templates/BasicText 301 { 302 left 5 345 303 width 180 346 304 height 30 347 305 caption [F1] Show / Hide this screen 348 306 } 349 element TextArea(Example/Visibility/Help/StatsInfo): Example/Visibility/Templates/BasicText 350 { 351 left 5 352 top 45 307 element TextArea(Example/Visibility/Help/Stats): Example/Visibility/Templates/BasicText 308 { 309 left 5 353 310 width 180 354 311 height 30 355 312 caption [F2] Show / Hide stats 356 313 } 357 element TextArea(Example/Visibility/Help/AppStateInfo): Example/Visibility/Templates/BasicText 358 { 359 left 5 360 top 75 314 element TextArea(Example/Visibility/Help/AppState): Example/Visibility/Templates/BasicText 315 { 316 left 5 361 317 width 180 362 318 height 30 363 319 caption [F3] Toggle between interactive / recorded walkthrough 364 320 } 365 element TextArea(Example/Visibility/Help/RecordedInfo): Example/Visibility/Templates/BasicText 366 { 367 left 5 368 top 60 321 element TextArea(Example/Visibility/Help/Recorded): Example/Visibility/Templates/BasicText 322 { 323 left 5 369 324 width 180 370 325 height 30 371 326 caption [F4] Start / End frame recording 372 327 } 373 element TextArea(Example/Visibility/Help/ScreenshotsInfo): Example/Visibility/Templates/BasicText 374 { 375 left 5 376 top 105 328 element TextArea(Example/Visibility/Help/Screenshots): Example/Visibility/Templates/BasicText 329 { 330 left 5 377 331 width 180 378 332 height 30 379 333 caption [F11] Screenshot 380 334 } 381 element TextArea(Example/Visibility/Help/WriteOut Info): Example/Visibility/Templates/BasicText382 { 383 left 5 384 top 120385 width 180386 height 30387 caption [F12] Write screen objects to file388 }335 element TextArea(Example/Visibility/Help/WriteOut): Example/Visibility/Templates/BasicText 336 { 337 left 5 338 width 180 339 height 30 340 caption [F12] Write scene entities to file 341 } 342 389 343 //-- visualization 390 element TextArea(Example/Visibility/Help/VizInfo): Example/Visibility/Templates/BasicText 391 { 392 left 5 393 top 150 344 element TextArea(Example/Visibility/Help/VizSection): Example/Visibility/Templates/BasicText 345 { 346 left 5 347 width 180 348 height 30 349 caption ****** Visualization ****** 350 } 351 element TextArea(Example/Visibility/Help/Viz): Example/Visibility/Templates/BasicText 352 { 353 left 5 394 354 width 180 395 355 height 30 396 356 caption [1] Show / hide visualization 397 357 } 398 element TextArea(Example/Visibility/Help/NextVizModeInfo): Example/Visibility/Templates/BasicText 399 { 400 left 5 401 top 165 358 element TextArea(Example/Visibility/Help/NextVizMode): Example/Visibility/Templates/BasicText 359 { 360 left 5 402 361 width 175 403 362 height 30 404 363 caption [2] Toggle visualization mode 405 364 } 406 element TextArea(Example/Visibility/Help/ZoomVizInfo): Example/Visibility/Templates/BasicText 407 { 408 left 5 409 top 180 365 element TextArea(Example/Visibility/Help/ZoomViz): Example/Visibility/Templates/BasicText 366 { 367 left 5 410 368 width 190 411 369 height 30 412 370 caption [3][4] Zoom in / out of visualization 413 371 } 414 element TextArea(Example/Visibility/Help/SceneDetailInfo): Example/Visibility/Templates/BasicText 415 { 416 left 5 417 top 210 372 element TextArea(Example/Visibility/Help/SceneDetail): Example/Visibility/Templates/BasicText 373 { 374 left 5 418 375 width 180 419 376 height 30 420 377 caption [R] Toggle between solid / wireframe / point based rendering 421 378 } 422 element TextArea(Example/Visibility/Help/DisplayCameraDetailsInfo): Example/Visibility/Templates/BasicText 423 { 424 left 5 425 top 225 379 element TextArea(Example/Visibility/Help/DisplayCameraDetails): Example/Visibility/Templates/BasicText 380 { 381 left 5 426 382 width 180 427 383 height 30 428 384 caption [P] Show / hide camera details 429 385 } 430 element TextArea(Example/Visibility/Help/DisplayOctreeInfo): Example/Visibility/Templates/BasicText 431 { 432 left 5 433 top 240 386 element TextArea(Example/Visibility/Help/DisplayOctree): Example/Visibility/Templates/BasicText 387 { 388 left 5 434 389 width 180 435 390 height 30 436 391 caption [T] Show / hide octree 437 392 } 438 element TextArea(Example/Visibility/Help/UseShadowsInfo): Example/Visibility/Templates/BasicText 439 { 440 left 5 441 top 255 393 element TextArea(Example/Visibility/Help/UseShadows): Example/Visibility/Templates/BasicText 394 { 395 left 5 442 396 width 180 443 397 height 30 444 398 caption [S] Show / hide shadows 445 399 } 446 element TextArea(Example/Visibility/Help/FilterInfo): Example/Visibility/Templates/BasicText 447 { 448 left 5 449 top 270 400 element TextArea(Example/Visibility/Help/Filter): Example/Visibility/Templates/BasicText 401 { 402 left 5 450 403 width 180 451 404 height 30 452 405 caption [F] toggle filtering method (trilinear, anisotropic, bilinear) 453 406 } 454 element TextArea(Example/Visibility/Help/FromCameraQueryInfo): Example/Visibility/Templates/BasicText 455 { 456 left 5 457 top 285 407 element TextArea(Example/Visibility/Help/VisQuery): Example/Visibility/Templates/BasicText 408 { 409 left 5 410 width 180 411 height 30 412 caption ****** Visibility Queries ****** 413 } 414 element TextArea(Example/Visibility/Help/FromCameraQuery): Example/Visibility/Templates/BasicText 415 { 416 left 5 458 417 width 180 459 418 height 30 460 419 caption [F5] From camera visible pixels (+ SHIFT: relative visibility) 461 420 } 462 element TextArea(Example/Visibility/Help/FromPointQueryInfo): Example/Visibility/Templates/BasicText 463 { 464 left 5 465 top 60 466 width 300 421 element TextArea(Example/Visibility/Help/FromPointQuery): Example/Visibility/Templates/BasicText 422 { 423 left 5 424 width 180 467 425 height 30 468 426 caption [F6] From camera visible pixels (+ SHIFT: relative visibility) 427 } 428 element TextArea(Example/Visibility/Help/QueryType): Example/Visibility/Templates/BasicText 429 { 430 left 5 431 width 180 432 height 30 433 caption [I] Change between occlusion query / item buffer visibility query 434 } 435 element TextArea(Example/Visibility/Help/QueryTarget): Example/Visibility/Templates/BasicText 436 { 437 left 5 438 width 180 439 height 30 440 caption [C] Mesh / Patch visibility (only item buffer) 441 } 442 element TextArea(Example/Visibility/Help/SceneObjects): Example/Visibility/Templates/BasicText 443 { 444 left 5 445 width 180 446 height 30 447 caption ******* Generation / Destruction of scene objects ****** 448 } 449 element TextArea(Example/Visibility/Help/GenerateObjects): Example/Visibility/Templates/BasicText 450 { 451 left 5 452 width 180 453 height 30 454 caption [F8] Generate 500 objects 455 } 456 element TextArea(Example/Visibility/Help/RemoveObjects): Example/Visibility/Templates/BasicText 457 { 458 left 5 459 width 180 460 height 30 461 caption [DEL] Remove generated objects 462 } 463 element TextArea(Example/Visibility/Help/DropObject): Example/Visibility/Templates/BasicText 464 { 465 left 5 466 width 180 467 height 30 468 caption [MOUSE LEFT] Drop object on terrain 469 469 } 470 470 } … … 524 524 { 525 525 left 5 526 top 30527 526 width 90 528 527 height 30 … … 534 533 { 535 534 left 180 536 top 30537 535 width 90 538 536 height 30 … … 543 541 { 544 542 left 5 545 top 45546 543 width 90 547 544 height 30 … … 551 548 { 552 549 left 180 553 top 45554 550 width 90 555 551 height 30 … … 560 556 { 561 557 left 5 562 top 60563 558 width 90 564 559 height 30 … … 568 563 { 569 564 left 180 570 top 60571 565 width 90 572 566 height 30 … … 578 572 { 579 573 left 5 580 top 75581 574 width 90 582 575 height 30 583 576 caption Visible patches 584 577 } 585 element TextArea(Example/Visibility/Query/VisiblePatchInfo): Example/Visibility/Templates/BasicText 586 { 587 left 180 588 top 75 578 element TextArea(Example/Visibility/Query/VisiblePatchesInfo): Example/Visibility/Templates/BasicText 579 { 580 left 180 589 581 width 90 590 582 height 30 … … 595 587 { 596 588 left 5 597 top 90598 589 width 90 599 590 height 30 … … 604 595 { 605 596 left 180 606 top 90607 597 width 90 608 598 height 30 … … 613 603 { 614 604 left 5 615 top 105616 605 width 90 617 606 height 30 … … 622 611 { 623 612 left 180 624 top 105625 613 width 90 626 614 height 30 … … 630 618 { 631 619 left 5 632 top 120633 620 width 90 634 621 height 30 … … 639 626 { 640 627 left 180 641 top 120642 628 width 90 643 629 height 30 -
trunk/VUT/Ogre/src/OgreSceneContentGenerator.cpp
r159 r160 12 12 namespace Ogre { 13 13 14 /******************************************************* /15 /* SceneContentGenerator implementation */16 /******************************************************* /14 /*************************************************************/ 15 /* SceneContentGenerator implementation */ 16 /*************************************************************/ 17 17 18 18 //----------------------------------------------------------------------- … … 23 23 mMinAngle(Vector3(0.0f, 0.0f, 0.0f)), 24 24 mMaxAngle(Vector3(360, 360, 360)), 25 mScale(0.1, 0.1, 0.1) 26 //, mObjectCount(0) 25 mScale(0.1, 0.1, 0.1)//, mObjectCount(0) 27 26 { 28 27 } … … 36 35 Vector3 translationRatio; 37 36 38 int old_count = GetObjectCount();37 int new_size = GetObjectCount() + numObjects; 39 38 int failed_attempts = 0; // counter used to avoid invinite loop 40 39 41 40 //-- create random values between zero and one 42 while ((GetObjectCount() < numObjects + old_count) &&41 while ((GetObjectCount() < new_size) && 43 42 (failed_attempts < MAX_FAILED_ATTEMPTS)) 44 43 { … … 70 69 Entity *ent = mSceneMgr->createEntity(name, objName + ".mesh"); 71 70 72 SceneNode * currentObject= mSceneMgr->getRootSceneNode()->71 SceneNode *node = mSceneMgr->getRootSceneNode()-> 73 72 createChildSceneNode(String(name) + "Node", position); 74 73 75 74 //ent->setCastShadows(false); 76 currentObject->attachObject(ent); 77 currentObject->setScale(mScale); 78 currentObject->setOrientation(orientation); 79 80 //-- store pointer to object 81 mSceneObjects.push_back(currentObject); 82 83 return currentObject; 75 node->attachObject(ent); 76 node->setScale(mScale); 77 node->setOrientation(orientation); 78 79 // store pointer to node and object 80 mSceneNodes.push_back(node); 81 mEntities.push_back(ent); 82 83 return node; 84 84 } 85 85 //----------------------------------------------------------------------- … … 116 116 int SceneContentGenerator::GetObjectCount() 117 117 { 118 return (int)mScene Objects.size();118 return (int)mSceneNodes.size(); 119 119 } 120 120 //----------------------------------------------------------------------- … … 129 129 std::vector<SceneNode *>::const_iterator it, it_end; 130 130 131 it_end = mScene Objects.end();131 it_end = mSceneNodes.end(); 132 132 133 133 if(!ofstr.is_open()) … … 136 136 char str[100]; 137 137 138 for(it = mScene Objects.begin(); it < it_end; ++it)138 for(it = mSceneNodes.begin(); it < it_end; ++it) 139 139 { 140 140 SceneNode *node = (*it); … … 164 164 return false; 165 165 166 //mScene Objects.clear(); // reset list of objects166 //mSceneNodes.clear(); // reset list of objects 167 167 168 168 while (!ifstr.eof()) … … 173 173 &orientation.w, &orientation.x, &orientation.y, &orientation.z, 174 174 &mScale.x, &mScale.y, &mScale.z); 175 176 /*Vector3 rot(orientation.getYaw().valueDegrees(),177 orientation.getPitch().valueDegrees(),178 orientation.getRoll().valueDegrees());*/179 175 180 176 GenerateSceneObject(position, orientation, objName); … … 187 183 return true; 188 184 } 189 185 //----------------------------------------------------------------------- 186 SceneNodeList *SceneContentGenerator::GetGeneratedSceneNodes() 187 { 188 return &mSceneNodes; 189 } 190 //----------------------------------------------------------------------- 191 EntityList *SceneContentGenerator::GetGeneratedEntities() 192 { 193 return &mEntities; 194 } 195 //----------------------------------------------------------------------- 196 void SceneContentGenerator::RemoveGeneratedObjects() 197 { 198 //-- destroy scene nodes and detach entities 199 while (!mSceneNodes.empty()) 200 { 201 SceneNode *node = mSceneNodes.back(); 202 mSceneNodes.pop_back(); 203 204 //node->detachAllObjects(); 205 mSceneMgr->destroySceneNode(node->getName()); 206 } 207 //-- remove and destroy entities 208 while (!mEntities.empty()) 209 { 210 Entity *ent = mEntities.back(); 211 mEntities.pop_back(); 212 213 mSceneMgr->removeEntity(ent); 214 } 215 } 190 216 } // namespace Ogre -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r159 r160 40 40 //mShowBoundingBoxes = true; 41 41 //mShowBoxes = true; 42 //mShowBoxes = true;43 42 44 43 // TODO: set maxdepth to reasonable value
Note: See TracChangeset
for help on using the changeset viewer.