Example #1
0
float TerrainLattice::GetVertexElevation(float x, float y)
{
	Terrain *pTerrain = GetTerrainAtPoint(x, y);
	if(pTerrain!=NULL)
	{
		return pTerrain->GetVertexElevation(pTerrain->GetVertexW(x,y));
	}
	else
		return 0.f;
}
Example #2
0
uint32 TerrainLattice::GetTerrainInfo(float x,float y,uint32 bitMask,uint32 bitOffset)
{
	if(SnapPointToVertexGrid(x,y) == false)
		return 0;

	if(x<0 || y<0)
		return 0;

	int idxX = (int)(x/m_TerrainWidth);
	int idxY = (int)(y/m_TerrainHeight);
	Terrain* pTerrain = NULL;
	pTerrain = GetTerrain(idxX,idxY);
	if(pTerrain && !(pTerrain->IsEmpty()))
	{
		int idx = pTerrain->GetVertexW(x,y);
		return pTerrain->GetVertexInfo(idx,bitMask, (uint8)bitOffset);
	}
	return 0;
}