本文整理汇总了C++中Missile::Firing方法的典型用法代码示例。如果您正苦于以下问题:C++ Missile::Firing方法的具体用法?C++ Missile::Firing怎么用?C++ Missile::Firing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Missile
的用法示例。
在下文中一共展示了Missile::Firing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void SceneGalaxy::Update(double dt)
{
camera.XWingCamera(dt, 100);
fps = 1.f / dt;
if (Application::IsKeyPressed('5'))
{
light[0].type = Light::LIGHT_SPOT;
glUniform1i(m_parameters[U_LIGHT0_TYPE], light[0].type);
}
else if (Application::IsKeyPressed('6'))
{
light[0].type = Light::LIGHT_POINT;
glUniform1i(m_parameters[U_LIGHT0_TYPE], light[0].type);
}
else if (Application::IsKeyPressed('7'))
{
light[0].type = Light::LIGHT_DIRECTIONAL;
glUniform1i(m_parameters[U_LIGHT0_TYPE], light[0].type);
}
if (Application::IsKeyPressed('1')) //enable back face culling
glEnable(GL_CULL_FACE);
if (Application::IsKeyPressed('2')) //disable back face culling
glDisable(GL_CULL_FACE);
if (Application::IsKeyPressed('3'))
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); //default fill mode
if (Application::IsKeyPressed('4'))
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); //wireframe mode
if (Application::IsKeyPressed('I'))
light[0].position.z -= (float)(LSPEED * dt);
if (Application::IsKeyPressed('K'))
light[0].position.z += (float)(LSPEED * dt);
if (Application::IsKeyPressed('J'))
light[0].position.x -= (float)(LSPEED * dt);
if (Application::IsKeyPressed('L'))
light[0].position.x += (float)(LSPEED * dt);
if (Application::IsKeyPressed('O'))
light[0].position.y -= (float)(LSPEED * dt);
if (Application::IsKeyPressed('P'))
light[0].position.y += (float)(LSPEED * dt);
if (Application::IsKeyPressed('X'))
enableLight = true;
if (Application::IsKeyPressed('Z'))
enableLight = false;
//
missile.update(dt);
delaymissile += dt * 2;
if (delaymissile >= 0.1f)
{
delaymissile = 0;
shootMissile = true;
}
else
{
shootMissile = false;
}
if (Application::IsKeyPressed(VK_LBUTTON))
{
if (shootMissile == true)
{
missile.Firing();
}
}
MovingAsteroid(dt);
CutScene(dt);
camPosX = camera.position.x;
camPosY = camera.position.y;
camPosz = camera.position.z;
}