Exemplo n.º 1
0
void DumpVisitor::ApplyStaticGeometry(StaticGeometry &g)
{
	if (g.GetNodeMask() & NODE_TRANSPARENT)
		m_stats.transGeomCount++;
	else
		m_stats.opaqueGeomCount++;

	for (unsigned int i = 0; i < g.GetNumMeshes(); i++)
		m_stats.triangles += g.GetMeshAt(i).indexBuffer->GetSize() / 3;

	ApplyNode(static_cast<Node&>(g));
}
Exemplo n.º 2
0
void DumpVisitor::ApplyLOD(LOD &l)
{
	ApplyNode(l);

	m_level++;
	for (unsigned int i = 0; i < l.GetNumChildren(); i++) {
		l.GetChildAt(i)->Accept(*this);
		m_lodStats.push_back(m_stats);
		memset(&m_stats, 0, sizeof(LodStatistics));
	}
	m_level--;
}
Exemplo n.º 3
0
void* CPyramidAllocator::CreateObject()
{
	bool bFull;
	uint8 nBit;
	uint32 pIndex[7];
	void* pNode[7];
	uint32 nIdx, nMod;

	m_oMutex.Enter();

	if(!ApplyNode(pIndex, pNode))
	{
		m_oMutex.Leave();
		return NULL;
	}

	CLeafNode* pLeaf = (CLeafNode*)pNode[6];

	nIdx = pIndex[6]/8;
	nMod = pIndex[6]%8;
	nBit = 1;
	if(nMod)
		nBit <<= nMod;
	pLeaf->nMask.pFlag[nIdx] |= nBit;
	bFull = (pLeaf->nMask.nFlag == 0xFFFFFFFF);
	void* pObject = pLeaf->pObjects + pIndex[6] * m_nInstanceSize;
	for(uint32 j=0; bFull && j<6; ++j)
	{
		uint32 k = 5 - j;
		CBranchNode* pBranch = (CBranchNode*)pNode[k];
		if(!pBranch)
			break;
		nIdx = pIndex[k]/8;
		nMod = pIndex[k]%8;
		nBit = 1;
		if(nMod)
			nBit <<= nMod;
		pBranch->nMask.pFlag[nIdx] |= nBit;
		bFull = (pBranch->nMask.nFlag == 0xFFFFFFFF);
	}

	++m_nSize;
	m_oMutex.Leave();

	return pObject;
}
Exemplo n.º 4
0
void NodeVisitor::ApplyCollisionGeometry(CollisionGeometry &g)
{
	ApplyNode(static_cast<Node&>(g));
}
Exemplo n.º 5
0
void NodeVisitor::ApplyThruster(Thruster &t)
{
	ApplyNode(static_cast<Node&>(t));
}
Exemplo n.º 6
0
void NodeVisitor::ApplyBillboard(Billboard &b)
{
	ApplyNode(static_cast<Node&>(b));
}
Exemplo n.º 7
0
void NodeVisitor::ApplyLabel(Label3D &l)
{
	ApplyNode(static_cast<Node&>(l));
}
Exemplo n.º 8
0
void NodeVisitor::ApplyStaticGeometry(StaticGeometry &g)
{
	ApplyNode(static_cast<Node&>(g));
}
Exemplo n.º 9
0
void NodeVisitor::ApplyGroup(Group &g)
{
	ApplyNode(static_cast<Node&>(g));
}
Exemplo n.º 10
0
	virtual void ApplyMatrixTransform(MatrixTransform &mt) {
		ApplyNode(mt);
	}
Exemplo n.º 11
0
	virtual void ApplyLOD(LOD &lod) {
		ApplyNode(lod);
	}