Fix code quality issues detected by PVS-Studio

This commit is contained in:
Wojtek Figat
2021-09-04 16:57:28 +02:00
parent 9c76d0c3cb
commit 53022ff013
30 changed files with 102 additions and 135 deletions

View File

@@ -1425,61 +1425,54 @@ namespace FlaxEngine
if (!BoxIntersectsSphere(ref box, ref sphere))
return ContainmentType.Disjoint;
float radiussquared = sphere.Radius * sphere.Radius;
float radiusSquared = sphere.Radius * sphere.Radius;
vector.X = sphere.Center.X - box.Minimum.X;
vector.Y = sphere.Center.Y - box.Maximum.Y;
vector.Z = sphere.Center.Z - box.Maximum.Z;
if (vector.LengthSquared > radiussquared)
if (vector.LengthSquared > radiusSquared)
return ContainmentType.Intersects;
vector.X = sphere.Center.X - box.Maximum.X;
vector.Y = sphere.Center.Y - box.Maximum.Y;
vector.Z = sphere.Center.Z - box.Maximum.Z;
if (vector.LengthSquared > radiussquared)
if (vector.LengthSquared > radiusSquared)
return ContainmentType.Intersects;
vector.X = sphere.Center.X - box.Maximum.X;
vector.Y = sphere.Center.Y - box.Minimum.Y;
vector.Z = sphere.Center.Z - box.Maximum.Z;
if (vector.LengthSquared > radiussquared)
if (vector.LengthSquared > radiusSquared)
return ContainmentType.Intersects;
vector.X = sphere.Center.X - box.Minimum.X;
vector.Y = sphere.Center.Y - box.Minimum.Y;
vector.Z = sphere.Center.Z - box.Maximum.Z;
if (vector.LengthSquared > radiussquared)
if (vector.LengthSquared > radiusSquared)
return ContainmentType.Intersects;
vector.X = sphere.Center.X - box.Minimum.X;
vector.Y = sphere.Center.Y - box.Maximum.Y;
vector.Z = sphere.Center.Z - box.Minimum.Z;
if (vector.LengthSquared > radiussquared)
if (vector.LengthSquared > radiusSquared)
return ContainmentType.Intersects;
vector.X = sphere.Center.X - box.Maximum.X;
vector.Y = sphere.Center.Y - box.Maximum.Y;
vector.Z = sphere.Center.Z - box.Minimum.Z;
if (vector.LengthSquared > radiussquared)
if (vector.LengthSquared > radiusSquared)
return ContainmentType.Intersects;
vector.X = sphere.Center.X - box.Maximum.X;
vector.Y = sphere.Center.Y - box.Minimum.Y;
vector.Z = sphere.Center.Z - box.Minimum.Z;
if (vector.LengthSquared > radiussquared)
if (vector.LengthSquared > radiusSquared)
return ContainmentType.Intersects;
vector.X = sphere.Center.X - box.Minimum.X;
vector.Y = sphere.Center.Y - box.Minimum.Y;
vector.Z = sphere.Center.Z - box.Minimum.Z;
if (vector.LengthSquared > radiussquared)
if (vector.LengthSquared > radiusSquared)
return ContainmentType.Intersects;
return ContainmentType.Contains;