Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

virtual void OglGui::Carousel3D::DisplayFunc (  )  [inline, virtual]

Reimplemented from OglGui::Window.

Definition at line 214 of file Carousel3D.h.

References HandleRotateTo(), mCenterRotY, mCenterX, mCenterY, mCenterZ, mFlowDragStartTime, mFlowing, mFlowSpeed, mFlowStartRotY, mFriction, mOglViews, OglGui::OglWindow::mOglWnd, mRadius, mShowCarousel, mTitles, mTxtFontBase, RotateToNearest(), and OglGui::OglWindow::UpdateScene().

00215         {
00216         if (!mShowCarousel)
00217             return;
00218 
00219         OGC myOGC;
00220         OGCSave(&myOGC);
00221 
00222                 view3DSys.View3DCameraTransform(mOglWnd);
00223 
00224         int nrOfViews = mOglViews.size();
00225 
00226         mRadius  = (nrOfViews*mOglViews[0]->w) / OGL_PI_2;
00227         mCenterZ = -mRadius - 1.5;
00228                 glTranslatef(mCenterX, mCenterY, mCenterZ);
00229                 glRotatef(mCenterRotY, 0.0f, 1.0f, 0.0f);       // Rotate Y
00230 
00231                 for (int i=0; i<nrOfViews; i++)
00232                 {
00233                         glPushMatrix();
00234                         glRotatef( i * 360.f/nrOfViews, 0.0f, 1.0f, 0.0f );
00235             glTranslatef(0, 0, mRadius);
00236                     view3DSys.DrawView(mOglViews[i]);
00237                         glColor3f( 1.0f, 1.0f, 0.0f );
00238                         oglSys.Printf3D(mTxtFontBase, -0.5, 0.5, 0.1, 0.08, 0.08, 0.01,
00239                             "%s", mTitles[i].c_str());
00240                         glPopMatrix();
00241                 }
00242         OGCRestore( &myOGC );
00243         glLoadName(0);
00244 
00245         HandleRotateTo();
00246 
00247 //SetAlwaysDraw(mFlowing || mIsRotatingTo);
00248         if (!mFlowing)
00249             return;
00250 
00251         //float   t    = (clock() - mFlowDragStartTime)/1000.f;
00252         float   t    = (OglClock() - mFlowDragStartTime);
00253         float   endT = fabs(mFlowSpeed / mFriction);
00254         if (t >= endT)
00255         {
00256             t = endT;
00257             mFlowing = false;
00258             //SetAlwaysDraw(mFlowing = false);
00259             UpdateScene();
00260             RotateToNearest();
00261         }
00262         float d = mFlowSpeed*t + (0.5 * (mFlowSpeed>0?1:-1)*mFriction * (t*t));
00263         mCenterRotY = mFlowStartRotY + d;
00264         }

Here is the call graph for this function:


Generated on Thu Jan 13 09:26:12 2011 for ImpalaSrc by  doxygen 1.5.1