//=================================================================================
bool BoundedPointListNode::AllPointsInBounds( const Bounds& givenBounds ) const
{
	for( List::const_iterator iter = pointList->begin(); iter != pointList->end(); iter++ )
	{
		c3ga::vectorE2GA point = *iter;
		if( !givenBounds.Contains( point ) )
			return false;
	}
	return true;
}
Beispiel #2
0
bool Intersect::BoundsSphere (const Bounds& bounds, const Vector3f& pos, float radius)
{
	const Vector3f& center = bounds.GetCenter();
	Vector3f dir (center - pos);
	float mag = dir.Magnitude();

	if (mag > radius)
	{
		dir /= mag;
		dir *= radius;
		return bounds.Contains(pos + dir);
	}
	return true;
}