idTech4.idBounds.GetRadius C# (CSharp) Method

GetRadius() public method

public GetRadius ( ) : float
return float
		public float GetRadius()
		{
			float total = 0.0f;

			for(int i = 0; i < 3; i++)
			{
				float b0 = (float) idMath.Abs(((i == 0) ? this.Min.X : ((i == 1) ? this.Min.Y : this.Min.Z)));
				float b1 = (float) idMath.Abs(((i == 0) ? this.Max.X : ((i == 1) ? this.Max.Y : this.Max.Z)));

				if(b0 > b1)
				{
					total += b0 * b0;
				}
				else
				{
					total += b1 * b1;
				}
			}

			return idMath.Sqrt(total);
		}

Same methods

idBounds::GetRadius ( Vector3 center ) : float