Changeset 2786 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
- Timestamp:
- 06/20/08 02:26:30 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2784 r2786 49 49 int assumedVisibleFrames = 10; 50 50 int maxBatchSize = 50; 51 bool useMultiQueries = true;52 51 53 52 const float keyForwardMotion = 1.0f; 54 53 const float keyRotation = 0.2f; 55 56 bool useRenderQueue = false;57 54 58 55 int winWidth = 1024; … … 84 81 85 82 bool useOptimization = false; 83 bool useTightBounds = true; 84 bool useRenderQueue = false; 85 bool useMultiQueries = true; 86 86 87 87 … … 95 95 void DisplayStats(); 96 96 void Output(int x, int y, const char *string); 97 void DrawHelpMessage(); 97 98 98 99 void begin2D(); 99 100 void end2D(); 100 101 void keyboard(unsigned char c, int x, int y); 101 void drawHelpMessage();102 102 void drawStatistics(); 103 103 void display(void); … … 233 233 234 234 235 void drawHelpMessage(void)235 void DrawHelpMessage(void) 236 236 { 237 237 const char *message[] = … … 257 257 "'9' - downward motion", 258 258 "", 259 "' G' - enables/disables optimization to take geometry as occluder",259 "'R' - use render queue", 260 260 "", 261 261 "'S' - shows/hides statistics", … … 269 269 270 270 271 int x = 40, y = 42;271 int x = 40, y = 60; 272 272 273 273 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); … … 286 286 if(message[i][0] == '\0') 287 287 { 288 y += 7;288 y += 15; 289 289 } 290 290 else 291 291 { 292 292 Output(x, y, message[i]); 293 y += 14;293 y += 20; 294 294 } 295 295 } … … 332 332 traverser->SetMaxBatchSize(maxBatchSize); 333 333 traverser->SetUseMultiQueries(useMultiQueries); 334 traverser->SetUseTightBounds(useTightBounds); 334 335 } 335 336 … … 546 547 traverser->SetUseRenderQueue(useRenderQueue); 547 548 } 549 case 'b': 550 case 'B': 551 { 552 useTightBounds = !useTightBounds; 553 traverser->SetUseTightBounds(useTightBounds); 554 } 548 555 default: 549 556 return; … … 718 725 // the 90 degree rotated view vector 719 726 // y zero so we don't move in the vertical 720 //Vector3 rVec(viewDir[0], 0, viewDir[2]);721 727 Vector3 rVec(viewDir[0], viewDir[1], 0); 722 728 723 //Matrix4x4 rot = RotationYMatrix(M_PI * 0.5f);724 729 Matrix4x4 rot = RotationZMatrix(M_PI * 0.5f); 725 730 rVec = rot * rVec; 726 731 727 732 pos -= rVec * (x - horizontalMotionBegin) * 0.1f; 728 //pos[1] += (verticalMotionBegin - y) * 0.1f;729 733 pos[2] += (verticalMotionBegin - y) * 0.1f; 730 734 … … 914 918 } 915 919 916 sprintf_s(msg2, "assumed visible frames: %4d, max batch size: %4d, using multiqueries: %d, using render queue: %d", assumedVisibleFrames, maxBatchSize, useMultiQueries, useRenderQueue); 920 sprintf_s(msg2, "assumed visible frames: %4d, max batch size: %4d, using render queue: %d", 921 assumedVisibleFrames, maxBatchSize, useRenderQueue); 917 922 918 923 string str; … … 935 940 if(showHelp) 936 941 { 937 drawHelpMessage();942 DrawHelpMessage(); 938 943 } 939 944 else … … 942 947 Output(850, 30, msg[renderMode]); 943 948 944 if (showStatistics)949 if (showStatistics) 945 950 { 946 951 Output(20, 30, msg2);
Note: See TracChangeset
for help on using the changeset viewer.