MCPcopy Create free account
hub / github.com/cinder/Cinder / drawCardinalTex

Method drawCardinalTex

samples/Compass/src/CompassApp.cpp:105–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void 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
131void CompassApp::drawFps()
132{

Callers

nothing calls this directly

Calls 6

pushModelViewFunction · 0.85
popModelViewFunction · 0.85
translateFunction · 0.50
rotateFunction · 0.50
drawFunction · 0.50
getOrientationMethod · 0.45

Tested by

no test coverage detected