示例#1
0
//==================================================================
inline void bounds2DSweepR(
					Bound &out_bound,
					float r,
					float phiMin,
					float phiMax )
{
	out_bound.Expand( polar(r, phiMin) );
	out_bound.Expand( polar(r, phiMax) );

	for (int i=-3; i < 4; ++i)
	{
		float	phi = i * FM_PI_2;
		if ( phiMin < phi && phiMax > phi )
			out_bound.Expand( polar( r, phi ) );
	}
}
示例#2
0
//==================================================================
inline void bounds2DSweepL(
					Bound &out_bound,
					float rmin,
					float rmax,
					float tmin,
					float tmax )
{
	out_bound.Expand( polar(rmin,tmin) );
	out_bound.Expand( polar(rmax,tmin) );
	out_bound.Expand( polar(rmin,tmax) );
	out_bound.Expand( polar(rmax,tmax) );
	
	if ( tmin < FM_PI_2 && tmax > FM_PI_2 )
		out_bound.Expand( polar( rmax, FM_PI_2 ) );

	if ( tmin < FM_PI && tmax > FM_PI )
		out_bound.Expand( polar( rmax, FM_PI ) );

	if ( tmin < (FM_PI+FM_PI_2) && tmax > (FM_PI+FM_PI_2) )
		out_bound.Expand( polar( rmax, (FM_PI+FM_PI_2) ) );
}
示例#3
0
//==================================================================
inline void bounds2DSweepP(
					Bound &out_bound,
					float x,
					float y,
					float theMin,
					float theMax )
{
	float	r = DSqrt( x * x + y * y );
	float	delta = atan2f( y, x );

	theMin += delta;
	theMax += delta;
	
	out_bound.Expand( polar(r, theMin) );
	out_bound.Expand( polar(r, theMax) );

	for (int i=-1; i < 6; ++i)
	{
		float	the = i * FM_PI_2;
		if ( theMin < the && theMax > the )
			out_bound.Expand( polar( r, the ) );
	}
}