- return ClippingBox( ( viewportWidth / 2 ) - aabb.z - aabb.x, ( viewportHeight / 2 ) - aabb.w - aabb.y, aabb.z, aabb.w );
+ Vector4 aabbInScreen( static_cast<float>( viewportWidth ) * 0.5f - aabb.z,
+ static_cast<float>( viewportHeight ) * 0.5f - aabb.w,
+ static_cast<float>( viewportWidth ) * 0.5f - aabb.x,
+ static_cast<float>( viewportHeight ) * 0.5f - aabb.y );
+
+ int x = static_cast< int >( roundf( aabbInScreen.x ) );
+ int y = static_cast< int >( roundf( aabbInScreen.y ) );
+ int z = static_cast< int >( roundf( aabbInScreen.z ) );
+ int w = static_cast< int >( roundf( aabbInScreen.w ) );
+
+ return ClippingBox( x, y, z - x, w - y );