Fix T40257: Frustum culling not working properly

Adding a hack so that KX_GameObjects' culling status is updated based on
mesh slots.
This commit is contained in:
Mitchell Stokes
2014-07-01 12:39:17 -07:00
parent cc1372546a
commit 978dba4616
2 changed files with 23 additions and 2 deletions

View File

@@ -928,6 +928,27 @@ KX_GameObject::SetVisible(
}
}
bool KX_GameObject::GetCulled()
{
// If we're set to not cull, double-check with
// the mesh slots first. This is kind of nasty, but
// it allows us to get proper culling information.
if (!m_bCulled)
{
SG_QList::iterator<RAS_MeshSlot> mit(m_meshSlots);
for (mit.begin(); !mit.end(); ++mit)
{
if ((*mit)->m_bCulled)
{
m_bCulled = true;
break;
}
}
}
return m_bCulled;
}
static void setOccluder_recursive(SG_Node* node, bool v)
{
NodeList& children = node->GetSGChildren();

View File

@@ -852,10 +852,10 @@ public:
/**
* Was this object culled?
*/
inline bool
bool
GetCulled(
void
) { return m_bCulled; }
);
/**
* Set culled flag of this object