本文整理汇总了C++中scene::INodePtr::getRenderSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ INodePtr::getRenderSystem方法的具体用法?C++ INodePtr::getRenderSystem怎么用?C++ INodePtr::getRenderSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scene::INodePtr
的用法示例。
在下文中一共展示了INodePtr::getRenderSystem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void BrushByPlaneClipper::visit(const scene::INodePtr& node) const
{
// Don't clip invisible nodes
if (!node->visible())
{
return;
}
// Try to cast the instance onto a brush
Brush* brush = Node_getBrush(node);
// Return if not brush
if (brush == NULL)
{
return;
}
Plane3 plane(_p0, _p1, _p2);
if (!plane.isValid())
{
return;
}
// greebo: Analyse the brush to find out which shader is the most used one
getMostUsedTexturing(*brush);
BrushSplitType split = Brush_classifyPlane(*brush, _split == eFront ? -plane : plane);
if (split.counts[ePlaneBack] && split.counts[ePlaneFront])
{
// the plane intersects this brush
if (_split == eFrontAndBack)
{
scene::INodePtr fragmentNode = GlobalBrushCreator().createBrush();
// greebo: For copying the texture scale the new node needs a valid rendersystem
fragmentNode->setRenderSystem(node->getRenderSystem());
assert(fragmentNode != NULL);
Brush* fragment = Node_getBrush(fragmentNode);
assert(fragment != NULL);
fragment->copy(*brush);
// Put the fragment in the same layer as the brush it was clipped from
scene::assignNodeToLayers(fragmentNode, node->getLayers());
FacePtr newFace = fragment->addPlane(_p0, _p1, _p2, _mostUsedShader, _mostUsedProjection);
if (newFace != NULL && _split != eFront)
{
newFace->flipWinding();
}
fragment->removeEmptyFaces();
ASSERT_MESSAGE(!fragment->empty(), "brush left with no faces after split");
// Mark this brush for insertion
_insertList.insert(InsertMap::value_type(fragmentNode, node->getParent()));
}
FacePtr newFace = brush->addPlane(_p0, _p1, _p2, _mostUsedShader, _mostUsedProjection);
if (newFace != NULL && _split == eFront) {
newFace->flipWinding();
}
brush->removeEmptyFaces();
ASSERT_MESSAGE(!brush->empty(), "brush left with no faces after split");
}
// the plane does not intersect this brush
else if (_split != eFrontAndBack && split.counts[ePlaneBack] != 0)
{
// the brush is "behind" the plane
_deleteList.insert(node);
}
}