Kaynağa Gözat

Fix radius calculation returning diameter

The getRadius function used to return the diameter of the bounding sphere.
Marco Bellan 8 yıl önce
ebeveyn
işleme
0686e22bf3
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      Source/BansheeUtility/Source/BsAABox.cpp

+ 1 - 1
Source/BansheeUtility/Source/BsAABox.cpp

@@ -458,7 +458,7 @@ namespace bs
 
 
 	float AABox::getRadius() const
 	float AABox::getRadius() const
 	{
 	{
-		return (mMaximum - mMinimum).length();
+		return ((mMaximum + mMinimum) * 0.5).length();
 	}
 	}
 
 
 	float AABox::getVolume() const
 	float AABox::getVolume() const