From 2633a4af4317c85439be7fb1adebe1b7ab0198f9 Mon Sep 17 00:00:00 2001 From: Mark Mine Date: Thu, 6 Feb 2003 21:37:45 +0000 Subject: [PATCH] fix build break --- .../src/stitchbase/stitchCylindricalLens.cxx | 16 +++++++------- pandaapp/src/stitchbase/stitchFisheyeLens.cxx | 14 ++++++------ pandaapp/src/stitchbase/stitchPSphereLens.cxx | 22 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandaapp/src/stitchbase/stitchCylindricalLens.cxx b/pandaapp/src/stitchbase/stitchCylindricalLens.cxx index 4a816eed1e..02ff43d21d 100644 --- a/pandaapp/src/stitchbase/stitchCylindricalLens.cxx +++ b/pandaapp/src/stitchbase/stitchCylindricalLens.cxx @@ -27,7 +27,7 @@ // This is the focal-length constant for fisheye lenses. See // stitchFisheyeLens.h. -static const double k = 60.0; +static const double cylindrical_k = 60.0; StitchCylindricalLens:: StitchCylindricalLens() { @@ -39,7 +39,7 @@ get_focal_length(double width_mm) const { return _focal_length; } if (_flags & F_fov) { - return width_mm * k / _fov; + return width_mm * cylindrical_k / _fov; } return 0.0; } @@ -50,7 +50,7 @@ get_hfov(double width_mm) const { return _fov; } if (_flags & F_focal_length) { - return width_mm * k / _focal_length; + return width_mm * cylindrical_k / _focal_length; } return 0.0; } @@ -66,8 +66,8 @@ extrude(const LPoint2d &point_mm, double width_mm) const { LVector2d v2 = point_mm; double fl = get_focal_length(width_mm); - return LVector3d(sin(deg_2_rad(v2[0] * k / fl)) * fl, - cos(deg_2_rad(v2[0] * k / fl)) * fl, + return LVector3d(sin(deg_2_rad(v2[0] * cylindrical_k / fl)) * fl, + cos(deg_2_rad(v2[0] * cylindrical_k / fl)) * fl, v2[1]); } @@ -88,7 +88,7 @@ project(const LVector3d &vec, double width_mm) const { // The x position is the angle about the Z axis. double x = - rad_2_deg(atan2(xy[0], xy[1])) * get_focal_length(width_mm) / k; + rad_2_deg(atan2(xy[0], xy[1])) * get_focal_length(width_mm) / cylindrical_k; // The y position is the Z height divided by the perspective // distance. @@ -107,7 +107,7 @@ project_left(const LVector3d &vec, double width_mm) const { LVector2d xy(v3[0], v3[1]); double x = (rad_2_deg(atan2(-xy[0], -xy[1])) - 180.0) * - get_focal_length(width_mm) / k; + get_focal_length(width_mm) / cylindrical_k; double y = v3[2] / length(xy) * get_focal_length(width_mm); return LPoint2d(x, y); @@ -123,7 +123,7 @@ project_right(const LVector3d &vec, double width_mm) const { LVector2d xy(v3[0], v3[1]); double x = (rad_2_deg(atan2(-xy[0], -xy[1])) + 180.0) * - get_focal_length(width_mm) / k; + get_focal_length(width_mm) / cylindrical_k; double y = v3[2] / length(xy) * get_focal_length(width_mm); return LPoint2d(x, y); diff --git a/pandaapp/src/stitchbase/stitchFisheyeLens.cxx b/pandaapp/src/stitchbase/stitchFisheyeLens.cxx index 71ddef6ea4..32149dbcb3 100644 --- a/pandaapp/src/stitchbase/stitchFisheyeLens.cxx +++ b/pandaapp/src/stitchbase/stitchFisheyeLens.cxx @@ -39,7 +39,7 @@ // for 35mm film. Don't know how well this extends to other lenses // and other negative sizes. -static const double k = 60.0; +static const double fisheye_k = 60.0; StitchFisheyeLens:: StitchFisheyeLens() { @@ -51,7 +51,7 @@ get_focal_length(double width_mm) const { return _focal_length; } if (_flags & F_fov) { - return width_mm * k / _fov; + return width_mm * fisheye_k / _fov; } return 0.0; } @@ -62,7 +62,7 @@ get_hfov(double width_mm) const { return _fov; } if (_flags & F_focal_length) { - return width_mm * k / _focal_length; + return width_mm * fisheye_k / _focal_length; } return 0.0; } @@ -85,7 +85,7 @@ extrude(const LPoint2d &point_mm, double width_mm) const { v2 /= r; // Now get the point r units around the circle in the YZ plane. - double dist = r * k / get_focal_length(width_mm); + double dist = r * fisheye_k / get_focal_length(width_mm); LVector3d p(0.0, cos(deg_2_rad(dist)), sin(deg_2_rad(dist))); // And rotate this point around the Y axis. @@ -128,7 +128,7 @@ project(const LVector3d &vec, double width_mm) const { // along the great circle to the point. double r = 90.0 - rad_2_deg(atan2(x[0], x[1])); - return y * (r * get_focal_length(width_mm) / k); + return y * (r * get_focal_length(width_mm) / fisheye_k); } void StitchFisheyeLens:: @@ -200,9 +200,9 @@ pick_up_singularity(TriangleRasterizer &rast, // from forward. double outer_mm = - (180 * get_focal_length(width_mm) / k); + (180 * get_focal_length(width_mm) / fisheye_k); double inner_mm = - ((180 - _singularity_tolerance * 2) * get_focal_length(width_mm) / k); + ((180 - _singularity_tolerance * 2) * get_focal_length(width_mm) / fisheye_k); int xsize = rast._output->get_x_size(); int ysize = rast._output->get_y_size(); diff --git a/pandaapp/src/stitchbase/stitchPSphereLens.cxx b/pandaapp/src/stitchbase/stitchPSphereLens.cxx index aad2a65fdb..0226a76d9c 100644 --- a/pandaapp/src/stitchbase/stitchPSphereLens.cxx +++ b/pandaapp/src/stitchbase/stitchPSphereLens.cxx @@ -29,7 +29,7 @@ // This is the focal-length constant for fisheye lenses. See // stitchFisheyeLens.h. -static const double k = 60.0; +static const double psphere_k = 60.0; StitchPSphereLens:: StitchPSphereLens() { @@ -41,7 +41,7 @@ get_focal_length(double width_mm) const { return _focal_length; } if (_flags & F_fov) { - return width_mm * k / _fov; + return width_mm * psphere_k / _fov; } return 0.0; } @@ -52,7 +52,7 @@ get_hfov(double width_mm) const { return _fov; } if (_flags & F_focal_length) { - return width_mm * k / _focal_length; + return width_mm * psphere_k / _focal_length; } return 0.0; } @@ -63,8 +63,8 @@ extrude(const LPoint2d &point_mm, double width_mm) const { double fl = get_focal_length(width_mm); return LVector3d::forward() * - LMatrix3d::rotate_mat(v2[1] * k / fl, LVector3d::right()) * - LMatrix3d::rotate_mat(-v2[0] * k / fl, LVector3d::up()); + LMatrix3d::rotate_mat(v2[1] * psphere_k / fl, LVector3d::right()) * + LMatrix3d::rotate_mat(-v2[0] * psphere_k / fl, LVector3d::up()); } @@ -83,14 +83,14 @@ project(const LVector3d &vec, double width_mm) const { // The x position is the angle about the Z axis. double x = - rad_2_deg(atan2(xy[0], xy[1])) * get_focal_length(width_mm) / k; + rad_2_deg(atan2(xy[0], xy[1])) * get_focal_length(width_mm) / psphere_k; // Unroll the Z angle, and the y position is the angle about the X // axis. xy = normalize(xy); LVector2d yz(v3[0]*xy[0] + v3[1]*xy[1], v3[2]); double y = - rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / k; + rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / psphere_k; return LPoint2d(x, y); } @@ -105,12 +105,12 @@ project_left(const LVector3d &vec, double width_mm) const { LVector2d xy(v3[0], v3[1]); double x = (rad_2_deg(atan2(-xy[0], -xy[1])) - 180.0) * - get_focal_length(width_mm) / k; + get_focal_length(width_mm) / psphere_k; xy = normalize(xy); LVector2d yz(v3[0]*xy[0] + v3[1]*xy[1], v3[2]); double y = - rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / k; + rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / psphere_k; return LPoint2d(x, y); } @@ -125,12 +125,12 @@ project_right(const LVector3d &vec, double width_mm) const { LVector2d xy(v3[0], v3[1]); double x = (rad_2_deg(atan2(-xy[0], -xy[1])) + 180.0) * - get_focal_length(width_mm) / k; + get_focal_length(width_mm) / psphere_k; xy = normalize(xy); LVector2d yz(v3[0]*xy[0] + v3[1]*xy[1], v3[2]); double y = - rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / k; + rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / psphere_k; return LPoint2d(x, y); }