本文整理汇总了C++中Real::getYaw方法的典型用法代码示例。如果您正苦于以下问题:C++ Real::getYaw方法的具体用法?C++ Real::getYaw怎么用?C++ Real::getYaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Real
的用法示例。
在下文中一共展示了Real::getYaw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: frameRenderingQueued
// Update input, info
//---------------------------------------------------------------------------------------------------------------
bool App::frameRenderingQueued(const FrameEvent& evt)
{
if (!BaseApp::frameRenderingQueued(evt))
return false;
// pos on minimap *
if (ndPos)
{ Real w = scn->sc->td.fTerWorldSize;
Real x = (0.5 - mCamera->getPosition().z / w);
Real y = (0.5 + mCamera->getPosition().x / w);
ndPos->setPosition(xm1+(xm2-xm1)*x, ym1+(ym2-ym1)*y, 0);
//--------------------------------
float angrot = mCamera->getOrientation().getYaw().valueDegrees();
float psx = 0.9f * pSet->size_minimap, psy = psx*asp; // *par len
const static float d2r = PI_d/180.f;
static float px[4],py[4];
for (int i=0; i<4; i++)
{
float ia = 135.f + float(i)*90.f;
float p = -(angrot + ia) * d2r;
px[i] = psx*cosf(p); py[i] =-psy*sinf(p);
}
if (mpos) { mpos->beginUpdate(0);
mpos->position(px[0],py[0], 0); mpos->textureCoord(0, 1); mpos->position(px[1],py[1], 0); mpos->textureCoord(1, 1);
mpos->position(px[3],py[3], 0); mpos->textureCoord(0, 0); mpos->position(px[2],py[2], 0); mpos->textureCoord(1, 0);
mpos->end(); }
}
// status overlay
if (fStFade > 0.f)
{ fStFade -= evt.timeSinceLastFrame;
//Real a = std::min(1.0f, fStFade*0.9f);
//ColourValue cv(0.0,0.5,a, a );
//ovStat->setColour(cv); ovSt->setColour(cv);
if (fStFade <= 0.f)
{ ovSt->hide(); ovSt->setMaterialName(""); }
}
#define isKey(a) mInputWrapper->isKeyDown(SDL_SCANCODE_##a)
const Real q = (shift ? 0.05 : ctrl ? 4.0 :1.0) * 20 * evt.timeSinceLastFrame;
// key,mb info ==================
if (pSet->inputBar)
{
// TODO: This is definitely not bullet-proof.
const int Kmax = SDL_SCANCODE_SLEEP; // last key
static float tkey[Kmax+1] = {0.f,}; // key delay time
int i;
static bool first=true;
if (first)
{ first=false;
for (i=Kmax; i > 0; --i) tkey[i] = 0.f;
}
String ss = "";
// pressed
for (i=Kmax; i > 0; --i)
if (mInputWrapper->isKeyDown(SDL_Scancode(i)))
tkey[i] = 0.2f; // min time to display
// modif
const static int
lc = SDL_SCANCODE_LCTRL, rc = SDL_SCANCODE_RCTRL,
la = SDL_SCANCODE_LALT, ra = SDL_SCANCODE_RALT,
ls = SDL_SCANCODE_LSHIFT, rs = SDL_SCANCODE_RSHIFT;
if (tkey[lc] > 0.f || tkey[rc] > 0.f) ss += "Ctrl ";
if (tkey[la] > 0.f || tkey[ra] > 0.f) ss += "Alt ";
if (tkey[ls] > 0.f || tkey[rs] > 0.f) ss += "Shift ";
// mouse buttons
if (mbLeft) ss += "LMB ";
if (mbRight) ss += "RMB ";
if (mbMiddle) ss += "MMB ";
// all
for (i=Kmax; i > 0; --i)
{
if (tkey[i] > 0.f)
{ tkey[i] -= evt.timeSinceLastFrame; //dec time
if (i!=lc && i!=la && i!=ls && i!=rc && i!=ra && i!=rs)
{
String s = String(SDL_GetKeyName(SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(i))));
ss += s + " ";
}
} }
// mouse wheel
static int mzd = 0;
if (mz > 0) mzd = 30;
if (mz < 0) mzd = -30;
if (mzd > 0) { ss += "Wheel up"; --mzd; }
if (mzd < 0) { ss += "Wheel dn"; ++mzd; }
//ovInfo->setCaption(ss);
ovDbg->setCaption(ss);
}
//.........这里部分代码省略.........