Skip to content

Commit 43cb0b1

Browse files
author
stgatilov
committed
#6557. Tiny refactor in idBounds::PlaneDistance / PlaneSide.
git-svn-id: http://svn.thedarkmod.com/svn/darkmod_src/trunk@10825 49c82d7f-2e2a-0410-a16f-ae8f201b507f
1 parent 54af27d commit 43cb0b1

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

idlib/bv/Bounds.cpp

+6-12
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,10 @@ idBounds::PlaneDistance
7272
================
7373
*/
7474
float idBounds::PlaneDistance( const idPlane &plane ) const {
75-
idVec3 center;
76-
float d1, d2;
77-
78-
center = ( b[0] + b[1] ) * 0.5f;
75+
idVec3 center = ( b[0] + b[1] ) * 0.5f;
7976

80-
d1 = plane.Distance( center );
81-
d2 = (
77+
float d1 = plane.Distance( center );
78+
float d2 = (
8279
idMath::Fabs( ( b[1].x - center.x ) * plane.Normal().x ) +
8380
idMath::Fabs( ( b[1].y - center.y ) * plane.Normal().y ) +
8481
idMath::Fabs( ( b[1].z - center.z ) * plane.Normal().z )
@@ -99,13 +96,10 @@ idBounds::PlaneSide
9996
================
10097
*/
10198
int idBounds::PlaneSide( const idPlane &plane, const float epsilon ) const {
102-
idVec3 center;
103-
float d1, d2;
104-
105-
center = ( b[0] + b[1] ) * 0.5f;
99+
idVec3 center = ( b[0] + b[1] ) * 0.5f;
106100

107-
d1 = plane.Distance( center );
108-
d2 = (
101+
float d1 = plane.Distance( center );
102+
float d2 = (
109103
idMath::Fabs( ( b[1].x - center.x ) * plane.Normal().x ) +
110104
idMath::Fabs( ( b[1].y - center.y ) * plane.Normal().y ) +
111105
idMath::Fabs( ( b[1].z - center.z ) * plane.Normal().z )

0 commit comments

Comments
 (0)