本文整理汇总了C++中CNode::getAbsPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CNode::getAbsPosition方法的具体用法?C++ CNode::getAbsPosition怎么用?C++ CNode::getAbsPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNode
的用法示例。
在下文中一共展示了CNode::getAbsPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refresh
void CRenderList::refresh()
{
m_draw.clear();
m_drawAlpha.clear();
m_drawStatic.clear();
m_drawTransparency.clear();
u32 size = (u32)m_list.size();
m_drawAlpha.reserve(size);
m_drawStatic.reserve(size);
m_drawTransparency.reserve(size);
for (std::vector<SNodeList>::iterator iter = m_list.begin(); iter < m_list.end(); ++iter)
{
CNode* node = (*iter)._node;
switch (node->getNodeType())
{
case ENodeType::eShape:
case ENodeType::eMesh:
case ENodeType::eBillboard:
case ENodeType::eParticleSystem:
{
f32 priority = 0.0f;
CMesh* mesh = static_cast<CMesh*>(node);
const MaterialPtr& material = mesh->getMaterial();
if (material->getTransparency() < 1.0f)
{
if (m_camera)
{
priority = (node->getAbsPosition() - m_camera->getAbsPosition()).length();
}
else
{
priority = node->getAbsPosition().z;
}
node->setPriority(priority);
if (checkDistance(node, priority))
{
m_drawTransparency.push_back((*iter));
}
}
else if (mesh->getRenderTechique()->getRenderPass((*iter)._passIndex)->getRenderState()->isBlend())
{
if (m_camera)
{
priority = (node->getAbsPosition() - m_camera->getAbsPosition()).length();
}
else
{
priority = node->getAbsPosition().z;
}
node->setPriority(priority);
if (checkDistance(node, priority))
{
m_drawAlpha.push_back((*iter));
}
}
else
{
if (checkDistance(node, priority))
{
m_drawStatic.push_back((*iter));
}
}
}
break;
case ENodeType::eCamera:
{
/*node->setPriority(k_maxPriority);
if (static_cast<CCamera*>(node)->isActive())
{
m_update.push_back(node);
}*/
}
break;
case ENodeType::eSkyBox:
{
node->setPriority(k_maxPriority);
m_drawStatic.push_back((*iter));
}
break;
case ENodeType::eLight:
case ENodeType::eFog:
{
node->setPriority(-k_maxPriority);
}
break;
case ENodeType::eText:
{
node->setPriority(0.0f);
CText* text = static_cast<CText*>(node);
const MaterialPtr& material = text->getMaterial();
//.........这里部分代码省略.........