PDA

View Full Version : stupid question



blt8
04-27-2002, 10:59 PM
i was looking over the ROAM article on gamasutra.com and grabbed the source code. i came across this:

void Patch::ComputeVariance()
{
// Compute variance on each of the base triangles...

m_CurrentVariance = m_VarianceLeft;
RecursComputeVariance( 0, PATCH_SIZE, m_HeightMap[PATCH_SIZE * MAP_SIZE],
PATCH_SIZE, 0, m_HeightMap[PATCH_SIZE],
0, 0, m_HeightMap[0],
1);

m_CurrentVariance = m_VarianceRight;
RecursComputeVariance( PATCH_SIZE, 0, m_HeightMap[ PATCH_SIZE],
0, PATCH_SIZE, m_HeightMap[ PATCH_SIZE * MAP_SIZE],
PATCH_SIZE, PATCH_SIZE, m_HeightMap[(PATCH_SIZE * MAP_SIZE) + PATCH_SIZE],
1);

// Clear the dirty flag for this patch
m_VarianceDirty = 0;
}

the ROAM program creates a specified number of patches over the terrain, and the above function is called for each one...now...please correct me if i'm wrong, but wouldn't the function do the same thing for every patch?! thanks in advance.

Jambolo
04-28-2002, 09:01 AM
Originally posted by blt8:
wouldn't the function do the same thing for every patch?!

It appears to me that m_HeightMap is specific to each patch.

blt8
04-28-2002, 10:56 AM
omg i'm stupid...should have seen that (it was verrrrrryyyyy late hehe). thanks a lot =)