本文整理汇总了C++中AbstractKart::getControls方法的典型用法代码示例。如果您正苦于以下问题:C++ AbstractKart::getControls方法的具体用法?C++ AbstractKart::getControls怎么用?C++ AbstractKart::getControls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractKart
的用法示例。
在下文中一共展示了AbstractKart::getControls方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateReplayAndGetDT
/** Sets the kart position and controls to the recorded history value.
* \param dt Time step size.
*/
float History::updateReplayAndGetDT()
{
m_current++;
World *world = World::getWorld();
if(m_current>=(int)m_all_deltas.size())
{
Log::info("History", "Replay finished");
m_current = 0;
// This is useful to use a reproducable rewind problem:
// replay it with history, for debugging only
#undef DO_REWIND_AT_END_OF_HISTORY
#ifdef DO_REWIND_AT_END_OF_HISTORY
RewindManager::get()->rewindTo(5.0f);
exit(-1);
#else
// Note that for physics replay all physics parameters
// need to be reset, e.g. velocity, ...
world->reset();
#endif
}
unsigned int num_karts = world->getNumKarts();
for(unsigned k=0; k<num_karts; k++)
{
AbstractKart *kart = world->getKart(k);
unsigned int index=m_current*num_karts+k;
if(m_replay_mode==HISTORY_POSITION)
{
kart->setXYZ(m_all_xyz[index]);
kart->setRotation(m_all_rotations[index]);
}
else
{
kart->getControls().set(m_all_controls[index]);
}
}
return m_all_deltas[m_current];
} // updateReplayAndGetDT