Ejemplo n.º 1
0
bool Frustum::InterSect( point& p )
{
	std::vector<Plane> planes  = FormPlane();
	
	for (unsigned int i = 0;i<planes.size();i++)
	{
		if(planes[i].A*p.X()+planes[i].B*p.Y()+planes[i].C*p.Z()+planes[i].D > 0.f)
		{
			return false;
		}
	}
	return true;
}
Ejemplo n.º 2
0
unsigned int Frustum::InterSectClip( point& p )
{
	unsigned ret = 0;

	std::vector<Plane> planes  = FormPlane();

	for (unsigned int i = 0;i<planes.size();i++)
	{
		if(planes[i].A*p.X()+planes[i].B*p.Y()+planes[i].C*p.Z()+planes[i].D > 0.f)
		{
			ret |= 1<<i;
		}
	}
	return ret;
}