本文整理汇总了C++中IntersectAction::addNode方法的典型用法代码示例。如果您正苦于以下问题:C++ IntersectAction::addNode方法的具体用法?C++ IntersectAction::addNode怎么用?C++ IntersectAction::addNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntersectAction
的用法示例。
在下文中一共展示了IntersectAction::addNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersect
Action::ResultE DistanceLOD::intersect(Action *action)
{
IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
#ifndef OSG_2_PREP
const DynamicVolume &vol = ia->getActNode()->getVolume();
#else
const BoxVolume &vol = ia->getActNode()->getVolume();
#endif
UInt32 numLevels = action->getNNodes();
// early out: no children or lod set missed, cannot hit anything
if (numLevels == 0 ||
vol.isValid() && !vol.intersect(ia->getLine()))
{
return Action::Skip;
}
const MFReal32 &range = (*getMFRange());
UInt32 numRanges = range.size();
UInt32 index = 0;
if (numRanges > 0)
{
if (numRanges >= numLevels)
numRanges = numLevels - 1;
if (numRanges == 0)
{
index = 0;
}
else if (_lastDist >= range[numRanges - 1])
{
index = numRanges;
}
else
{
for (index = 0; index < numRanges; ++index)
{
if (_lastDist < range[index])
break;
}
}
}
const NodePtr nodePtr = action->getNode(index);
ia->addNode(nodePtr);
return Action::Continue;
}
示例2: intersect
ActionBase::ResultE Switch::intersect(Action *action)
{
ActionBase::ResultE returnValue = ActionBase::Continue;
IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
if((getChoice() >= 0 ) &&
(UInt32(getChoice()) < ia->getNNodes()) )
{
ia->useNodeList( );
ia->addNode (ia->getNode(getChoice()));
}
else if(getChoice() == ALL)
{
returnValue = ActionBase::Continue;
}
else
{
returnValue = ActionBase::Skip;
}
return returnValue;
}