Revision: 57004
http://sourceforge.net/p/brlcad/code/57004
Author: iiizzzaaakkk
Date: 2013-08-20 21:04:01 +0000 (Tue, 20 Aug 2013)
Log Message:
-----------
removed the isgreater keyword which is C99 standard. Modified logic of
rt_hrt_prep: No need for max variable anylonger. My intuition tells me to make
Xu and Yu shorter than Zu.
Modified Paths:
--------------
brlcad/trunk/src/librt/primitives/hrt/hrt.c
Modified: brlcad/trunk/src/librt/primitives/hrt/hrt.c
===================================================================
--- brlcad/trunk/src/librt/primitives/hrt/hrt.c 2013-08-20 19:02:51 UTC (rev
57003)
+++ brlcad/trunk/src/librt/primitives/hrt/hrt.c 2013-08-20 21:04:01 UTC (rev
57004)
@@ -222,7 +222,7 @@
{
register struct hrt_specific *hrt;
struct rt_hrt_internal *hip;
- fastf_t magsq_x, magsq_y, magsq_z, max;
+ fastf_t magsq_x, magsq_y, magsq_z;
mat_t R, TEMP;
vect_t Xu, Yu, Zu;
fastf_t f;
@@ -244,24 +244,11 @@
bu_log("rt_hrt_prep(): hrt(%s) near-zero length <d> distance to cusps
(%g) causes problems\n", stp->st_name, hip->d);
return 1;
}
- max = hip->xdir[X];
- if (isgreater(hip->ydir[Y], max)) {
- max = hip->ydir[Y];
- }
- if (isgreater(hip->zdir[Z], max)) {
- max = hip->zdir[Z];
- }
-
if (hip->d > 10000.0) {
bu_log("rt_hrt_prep(): hrt(%s) very large <d> distance to cusps (%g)
causes problems\n", stp->st_name, hip->d);
- /* BAD */
+ /* BAD */
}
- if (hip->d > max) {
- bu_log("rt_hrt_prep(): hrt(%s) Inappropriate value for <d> distance to
cusps (%g) \n", stp->st_name, hip->d);
- /* BAD */
- }
-
/* Create unit length versions of X, Y, Z */
f = 1.0/sqrt(magsq_x);
VSCALE(Xu, hip->xdir, f);
@@ -287,6 +274,12 @@
return 1;
}
+ /* Scale X and Y */
+ f = 0.8/sqrt(magsq_x);
+ VSCALE(Xu, hip->xdir, f);
+ f = 0.8/sqrt(magsq_y);
+ VSCALE(Yu, hip->ydir, f);
+
/* Solid is OK, compute constant terms now */
BU_GET(hrt, struct hrt_specific);
@@ -325,11 +318,7 @@
/* compute bounding sphere */
VMOVE(stp->st_center, hrt->hrt_V);
- f = magsq_x;
- if (magsq_y > f)
- f = magsq_y;
- if (magsq_z > f)
- f = magsq_z;
+ f = hip->zdir[Z] * 1.25;
stp->st_aradius = stp->st_bradius = sqrt(f);
/* compute bounding RPP */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits