本文整理汇总了C++中TrackObject::onWorldReady方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackObject::onWorldReady方法的具体用法?C++ TrackObject::onWorldReady怎么用?C++ TrackObject::onWorldReady使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackObject
的用法示例。
在下文中一共展示了TrackObject::onWorldReady方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
/** Initialises all track objects.
*/
void TrackObjectManager::init()
{
int moveable_objects = 0;
bool warned = false;
for (unsigned i = 0; i < m_all_objects.m_contents_vector.size(); i++)
{
TrackObject* curr = m_all_objects.m_contents_vector[i];
curr->onWorldReady();
if (moveable_objects > stk_config->m_max_moveable_objects)
{
if (!warned)
{
Log::warn("TrackObjectManager",
"Too many moveable objects (>%d) in networking.",
stk_config->m_max_moveable_objects);
warned = true;
}
curr->setInitiallyVisible(false);
curr->setEnabled(false);
continue;
}
// onWorldReady will hide some track objects using scripting
if (NetworkConfig::get()->isNetworking() &&
curr->isEnabled() && curr->getPhysicalObject() &&
curr->getPhysicalObject()->isDynamic())
{
curr->getPhysicalObject()->getBody()
->setActivationState(DISABLE_DEACTIVATION);
curr->getPhysicalObject()->addForRewind();
moveable_objects++;
}
}
} // init