| 103 | } |
| 104 | |
| 105 | void CompassApp::drawCardinalTex( char d, const vec3 &location, const vec3 &localRotation ) |
| 106 | { |
| 107 | const float kRectHalfWidth = kTargetSize / 2.0f; |
| 108 | Rectf destRect( kRectHalfWidth, kRectHalfWidth, -kRectHalfWidth, -kRectHalfWidth ); |
| 109 | ivec2 texPos = mCardinalPositions[d]; |
| 110 | Area srcArea( texPos.x, texPos.y, texPos.x + mCardinalSize.x, texPos.y + mCardinalSize.y); |
| 111 | |
| 112 | gl::pushModelView(); |
| 113 | |
| 114 | gl::translate( location ); |
| 115 | |
| 116 | #if 1 |
| 117 | gl::rotate( angleAxis( localRotation.x, vec3(1,0,0) ) ); |
| 118 | gl::rotate( angleAxis( localRotation.y, vec3(0,1,0) ) ); |
| 119 | gl::rotate( angleAxis( localRotation.z, vec3(0,0,1) ) ); |
| 120 | #else |
| 121 | // draw billboarded, flip to face eye point |
| 122 | gl::rotate( mCam.getOrientation() ); |
| 123 | gl::rotate( M_PI, vec3( 0, 1, 0 ) ); |
| 124 | #endif |
| 125 | |
| 126 | gl::draw( mCardinalTex, srcArea, destRect ); |
| 127 | |
| 128 | gl::popModelView(); |
| 129 | } |
| 130 | |
| 131 | void CompassApp::drawFps() |
| 132 | { |
nothing calls this directly
no test coverage detected