本文整理汇总了C++中NodeData::fromConfigMap方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeData::fromConfigMap方法的具体用法?C++ NodeData::fromConfigMap怎么用?C++ NodeData::fromConfigMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeData
的用法示例。
在下文中一共展示了NodeData::fromConfigMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: itemAdded
void EnvirePhysics::itemAdded(const TypedItemAddedEvent<PhysicsConfigMapItem>& e)
{
#ifdef DEBUG
LOG_DEBUG(("[EnvirePhysics::ItemAdded] PhysicsConfigMapItem item received in frame *** " + e.frame + "***").c_str());
#endif
PhysicsConfigMapItem::Ptr pItem = e.item;
try
{
//try to convert the item into a node Data
NodeData * node = new NodeData;
std::shared_ptr<NodeData> nodePtr(node);
if(node->fromConfigMap(&pItem->getData(), ""))
{
Transform fromOrigin;
if(originId.compare(e.frame) == 0)
{
//this special case happens when the graph only contains one frame
//and items are added to that frame. In that case aksing the graph
//for the transformation would cause an exception
fromOrigin.setTransform(TransformWithCovariance::Identity());
}
else
{
fromOrigin = control->graph->getTransform(originId, e.frame);
}
node->pos = fromOrigin.transform.translation;
node->rot = fromOrigin.transform.orientation;
if (instantiateNode(nodePtr, e.frame))
{
#ifdef DEBUG
LOG_DEBUG(("[EnvirePhysics::ItemAdded] PhysicsConfigMapItem - Instantiated and stored the nodeInterface in frame ***" + e.frame + "***").c_str());
#endif
}
}
}
catch(const UnknownTransformException& ex)
{
cerr << ex.what() << endl;
}
}