Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
the only difference that when create node bounding

The only difference that when create node bounding box

nMinPolyCount,
nMinAreaCount ) {};

protected:
// Protected virtual Functions for This Class

Because this code has already been thoroughly discussed, we will move quickly and only stop to examine the changes from the function that it overrides.

bool CQuadTreeYV::BuildTree( CQuadTreeNode * pNode,
PolygonList PolyList,
DetailAreaList AreaList,
const D3DXVECTOR3 & BoundsMin,
const D3DXVECTOR3 & BoundsMax )
{
D3DXVECTOR3 Normal;
PolygonList::iterator PolyIterator;
DetailAreaList::iterator AreaIterator;
CPolygon * CurrentPoly, * FrontSplit, * BackSplit; PolygonList ChildList[4];
DetailAreaList ChildAreaList[4];
CCollision::CLASSIFYTYPE Location[2];
D3DXPLANE Planes[2];
unsigned long i;
bool bStopCode;

bStopCode = (AreaList.size() == 0 && PolyList.size() == 0) || (AreaList.size() <= m_nMinAreaCount &&
PolyList.size() <= m_nMinPolyCount) ||
D3DXVec3Length( &vecLeafSize ) <= m_fMinLeafSize;

The first section code stored the passed bounding box in the passed node and calculated the 2D size of the node (vecLeafSize). Although this is a YV quad-tree we still do not want the y extents of the node to play any part in whether or not we subdivide. Unlike the oct-tree where we intend to subdivide space vertically, the YV quad-tree does not have leaves stacked on top of each other. So a leaf must still contain the entire vertical range of geometry that exists in the XZ space. The only difference is that when we do create a node/leaf bounding box, we will calculate the extents of the actual geometry that made it into that node. After we have calculated the leaf size, we compute the bStopCode boolean. This code is all unchanged.

// Also add a reference to the leaf's list pLeaf->AddPolygon( CurrentPoly );

} // Next Polygon

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Kevin Downs

PageId: DOC9C0F7A8