Revision: 56255
http://sourceforge.net/p/brlcad/code/56255
Author: brlcad
Date: 2013-07-27 16:49:00 +0000 (Sat, 27 Jul 2013)
Log Message:
-----------
since there was no mention as to why they were commented out in r29559 (erik),
re-enable calculations in the render_util_spall_vec() function. do try to
prevent a division by zero.
Revision Links:
--------------
http://sourceforge.net/p/brlcad/code/29559
Modified Paths:
--------------
brlcad/trunk/src/adrt/librender/render_util.c
Modified: brlcad/trunk/src/adrt/librender/render_util.c
===================================================================
--- brlcad/trunk/src/adrt/librender/render_util.c 2013-07-27 10:20:41 UTC
(rev 56254)
+++ brlcad/trunk/src/adrt/librender/render_util.c 2013-07-27 16:49:00 UTC
(rev 56255)
@@ -48,12 +48,10 @@
/* Generate vector list for a spall cone given a reference angle */
void
render_util_spall_vec(vect_t UNUSED(dir), fastf_t UNUSED(angle), int
UNUSED(vec_num), vect_t *UNUSED(vec_list)) {
-#if 0
TIE_3 vec;
tfloat radius, t;
int i;
-
/* Otherwise the cone would be twice the angle */
angle *= 0.5;
@@ -62,8 +60,10 @@
vec.v[2] = 0;
radius = sqrt(vec.v[0]*vec.v[0] + vec.v[1]*vec.v[1]);
- vec.v[0] /= radius;
- vec.v[1] /= radius;
+ if (!ZERO(radius)) {
+ vec.v[0] /= radius;
+ vec.v[1] /= radius;
+ }
vec.v[0] = vec.v[1] < 0 ? 360.0 - acos(vec.v[0])*MATH_RAD2DEG :
acos(vec.v[0])*MATH_RAD2DEG;
@@ -76,7 +76,6 @@
t = angle * cos((i * 360 / vec_num) * MATH_DEG2RAD);
vec_list[i].v[2] = cos(acos(dir.v[2]) + t * MATH_DEG2RAD);
}
-#endif
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits