コード例 #1
0
//=================================================================================
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;
}
コード例 #2
0
ファイル: Intersect.cpp プロジェクト: saggita/r5ge
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;
}