本文整理汇总了C++中TLeafList::front方法的典型用法代码示例。如果您正苦于以下问题:C++ TLeafList::front方法的具体用法?C++ TLeafList::front怎么用?C++ TLeafList::front使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLeafList
的用法示例。
在下文中一共展示了TLeafList::front方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectCamera
void SoccerInput::SelectCamera(int idx)
{
// get list of registered SoccerMonitor objects
TLeafList soccerMonitorList;
mMonitorClient->ListChildrenSupportingClass<SoccerMonitor>(soccerMonitorList);
if (soccerMonitorList.empty())
{
GetLog()->Error()
<< "ERROR: (SoccerInput) Unable to get SoccerMonitor\n";
return;
}
boost::shared_ptr<SoccerMonitor> soccerMonitor =
shared_static_cast<SoccerMonitor>(soccerMonitorList.front());
salt::Vector2f fieldSize = soccerMonitor->GetFieldSize();
switch (idx)
{
case 0:
{
salt::Vector3f pos(-fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(90);
mFPS->SetVAngleDeg(35);
}
break;
case 1:
{
salt::Vector3f pos(-fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(50);
mFPS->SetVAngleDeg(30);
}
break;
case 2:
{
salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(salt::gRadToDeg(-0.625));
mFPS->SetVAngleDeg(40);
}
break;
case 3:
{
salt::Vector3f pos(0, -fieldSize.y()*1.1, fieldSize.x()*0.6);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(0);
mFPS->SetVAngleDeg(45);
}
break;
case 4:
{
salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(salt::gRadToDeg(0.625));
mFPS->SetVAngleDeg(40);
}
break;
case 5:
{
salt::Vector3f pos(fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(-50);
mFPS->SetVAngleDeg(30);
}
break;
case 6:
{
salt::Vector3f pos(fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(-90);
mFPS->SetVAngleDeg(35);
}
break;
}
}
示例2: NextCamera
void RenderServer::NextCamera()
{
TLeafList cameras;
mActiveScene->GetChildrenOfClass("Camera", cameras, true);
for (TLeafList::iterator iter = cameras.begin(); iter != cameras.end(); ++iter)
if (*iter == mCamera)
{
++iter;
mCamera = iter != cameras.end() ? static_pointer_cast<Camera>(*iter) : static_pointer_cast<Camera>(cameras.front());
break;
}
}
示例3: ProcessInput
void SoccerInput::ProcessInput(const Input& input)
{
// get list of registered SoccerMonitor objects
TLeafList soccerMonitorList;
mMonitorClient->ListChildrenSupportingClass<SoccerMonitor>(soccerMonitorList);
if (soccerMonitorList.empty())
{
GetLog()->Error()
<< "ERROR: (SoccerInput) Unable to get SoccerMonitor\n";
return;
}
shared_ptr<SoccerMonitor> soccerMonitor =
shared_static_cast<SoccerMonitor>(soccerMonitorList.front());
switch (input.mId)
{
default:
return;
case CmdKickOff:
if (input.GetKeyPress())
{
SendCommand("(kickOff Left)");
}
break;
case CmdKickOffRight:
if (input.GetKeyPress())
{
SendCommand("(kickOff Right)");
}
break;
case CmdMoveAgent:
if (input.GetKeyPress())
{
//SendCommand("(agent (team Left)(unum 1)(pos -2.0 1.0 3.5))");
}
break;
case CmdDropBall:
if (input.GetKeyPress())
{
SendCommand("(dropBall)");
}
break;
case CmdShootBall:
if (input.GetKeyPress())
{
//SendCommand("(ball (vel -4.0 0.0 2.0))");
}
break;
case CmdMoveBall:
if (input.GetKeyPress())
{
//SendCommand("(ball (pos -42.0 0.0 0.3))");
}
break;
case CmdCameraLeftGoal:
if (input.GetKeyPress())
{
salt::Vector2f fieldSize = soccerMonitor->GetFieldSize();
salt::Vector3f pos(-fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(90);
mFPS->SetVAngleDeg(35);
}
break;
case CmdCameraLeftCorner:
if (input.GetKeyPress())
{
salt::Vector2f fieldSize = soccerMonitor->GetFieldSize();
salt::Vector3f pos(-fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(50);
mFPS->SetVAngleDeg(30);
}
break;
case CmdCameraMiddleLeft:
if (input.GetKeyPress())
{
salt::Vector2f fieldSize = soccerMonitor->GetFieldSize();
salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(salt::gRadToDeg(-0.625));
mFPS->SetVAngleDeg(40);
}
break;
case CmdCameraMiddleRight:
if (input.GetKeyPress())
{
salt::Vector2f fieldSize = soccerMonitor->GetFieldSize();
salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4);
mCameraBody->SetPosition(pos);
mFPS->SetHAngleDeg(salt::gRadToDeg(0.625));
mFPS->SetVAngleDeg(40);
}
break;
case CmdCameraMiddle:
if (input.GetKeyPress())
//.........这里部分代码省略.........