本文整理汇总了C++中CVar::SetFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ CVar::SetFloat方法的具体用法?C++ CVar::SetFloat怎么用?C++ CVar::SetFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVar
的用法示例。
在下文中一共展示了CVar::SetFloat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitialize
bool RabidEngine::OnInitialize(int argc, char** argv)
{
LOG_START("rabid_log.html");
g_fileSystem = (IFileSystem*)new FileSystem();
g_fileSystem->AddPath();
g_defMgr = new DefMgr();
g_cvarSystem = new CVarSystem();
g_cvarSystem->Initialize();
CVar::RegisterStaticCVars();
g_console = new Console();
g_console->SetScreenDimensions(GetWidth(), GetHeight());
g_commandSystem = new CommandSystem();
g_commandSystem->Initialize();
g_common = new Common();
g_renderer = CreateRenderer("GL");
g_renderer->SetViewport(0,0, GetWidth(), GetHeight());
g_common->Print("\x009### Rabid Hardware Radiosity Engine");
g_common->Print("\x009### Based on the Catharsis Game Engine");
g_common->Print("\x009### Christopher Olsen");
g_common->Print("\x005### \x007SPACE\x005 distributes light ###");
g_common->Print("\x005### \x007TAB\x005 switches light view modes ###");
g_common->Print("\x005### \x007""B\x005 toggles the brightest surface ###");
LoadMap("test.map");
cl_camrotx.SetFloat(0.0);
cl_camroty.SetFloat(0.0);
cl_camrotz.SetFloat(0.0);
logo = g_materialSystem->GetMaterial("logo");
return true;
}
示例2: OnMouseMove
bool RabidEngine::OnMouseMove(int dx, int dy)
{
if(!g_console->Active())
{
{
cl_camroty.SetFloat(cl_camroty.GetFloat() - dx);
cl_camrotx.SetFloat(cl_camrotx.GetFloat() - dy);
while(cl_camroty.GetFloat() > 360.0f)
cl_camroty.SetFloat(cl_camroty.GetFloat() - 360.0f);
while(cl_camroty.GetFloat() < 0.0f)
cl_camroty.SetFloat(cl_camroty.GetFloat() + 360.0f);
if(cl_camrotx.GetFloat() > 90)
cl_camrotx.SetFloat(90.0);
if(cl_camrotx.GetFloat() < -90)
cl_camrotx.SetFloat(-90.0);
}
return true;
}
return false;
}
示例3: OnIdle
void RabidEngine::OnIdle()
{
g_timer.Update();
const float dt = g_timer.GetTimeChange();
g_console->Update(dt);
Transformation view;
view.Rotate().FromEulerXYZ(cl_camrotx.GetFloat(),
cl_camroty.GetFloat(),
cl_camrotz.GetFloat());
// move
const Vector3f forward = -view.Rotate().GetColumn(2);
const Vector3f right = view.Rotate().GetColumn(0);
const float vel = 50.0 * dt;
if(keyState[B_FORWARD])
{
cl_camx.SetFloat(cl_camx.GetFloat() + forward.x * vel);
cl_camy.SetFloat(cl_camy.GetFloat() + forward.y * vel);
cl_camz.SetFloat(cl_camz.GetFloat() + forward.z * vel);
}
if(keyState[B_BACKWARD])
{
cl_camx.SetFloat(cl_camx.GetFloat() + -forward.x * vel);
cl_camy.SetFloat(cl_camy.GetFloat() + -forward.y * vel);
cl_camz.SetFloat(cl_camz.GetFloat() + -forward.z * vel);
}
if(keyState[B_RIGHT])
{
cl_camx.SetFloat(cl_camx.GetFloat() + right.x * vel);
cl_camy.SetFloat(cl_camy.GetFloat() + right.y * vel);
cl_camz.SetFloat(cl_camz.GetFloat() + right.z * vel);
}
if(keyState[B_LEFT])
{
cl_camx.SetFloat(cl_camx.GetFloat() + -right.x * vel);
cl_camy.SetFloat(cl_camy.GetFloat() + -right.y * vel);
cl_camz.SetFloat(cl_camz.GetFloat() + -right.z * vel);
}
if(keyState[B_RENDER])
{
done.Set("0");
keyState[B_RENDER] = 0;
}
if(keyState[B_LIGHT_MODE])
{
if(r_resid.GetBool())
r_resid.Set("0");
else
r_resid.Set("1");
keyState[B_LIGHT_MODE] = 0;
}
if(keyState[B_TOGGLE_BRIGHTEST])
{
if(r_showbrightest.GetBool())
r_showbrightest.Set("0");
else
r_showbrightest.Set("1");
keyState[B_TOGGLE_BRIGHTEST] = 0;
}
static int pass;
static int surf = -1;
static int brightest;
static int patches;
if(done.GetBool())
{
}
else
{
if(pass == 0)
{
// clear accumulation buffers
for(unsigned int i = 0; i < surfaces.Size(); i++)
{
// if(surfaces[i]->GetType() != S_LIGHT)
// surfaces[i]->ClearAccum();
}
}
if(surf >= (int)surfaces.Size())
{
surf = -2;
pass++;
done.Set("1");
}
else if(surf == -1)
{
// Find Brightest Surface
//.........这里部分代码省略.........