Revision: 57100
          http://sourceforge.net/p/brlcad/code/57100
Author:   iiizzzaaakkk
Date:     2013-08-23 12:48:33 +0000 (Fri, 23 Aug 2013)
Log Message:
-----------
Added rt_hrt_norm() function which Computes the normal to the heart given a 
point on the heart

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-23 10:36:57 UTC (rev 
57099)
+++ brlcad/trunk/src/librt/primitives/hrt/hrt.c 2013-08-23 12:48:33 UTC (rev 
57100)
@@ -697,9 +697,28 @@
  * above equations by six here.
  */
 void
-rt_hrt_norm()
+rt_hrt_norm(register struct hit *hitp, struct soltab *stp, register struct 
xray *rp)
 {
-    bu_log("rt_hrt_norm: Not implemented yet!\n");
+    register struct hrt_specific *hrt =
+       (struct hrt_specific *)stp->st_specific;
+
+    fastf_t w, fx, fy, fz;
+    vect_t work;
+
+    VJOIN1(hitp->hit_point, rp->r_pt, hitp->hit_dist, rp->r_dir);
+    w = hitp->hit_vpriv[X] * hitp->hit_vpriv[X] 
+        + 9.0/4.0 * hitp->hit_vpriv[Y] * hitp->hit_vpriv[Y] 
+        + hitp->hit_vpriv[Z] * hitp->hit_vpriv[Z] - 1.0;
+    fx = (w * w - hitp->hit_vpriv[Y] * hitp->hit_vpriv[Y] * 
hitp->hit_vpriv[Y]) * hitp->hit_vpriv[X];
+    fy = 0.5 * hitp->hit_vpriv[Y] * hitp->hit_vpriv[Y] * (8.0/9.0 * w * w 
+    - (hitp->hit_vpriv[X] * hitp->hit_vpriv[X] + 9.0 / 80.0 * 
hitp->hit_vpriv[Z] 
+    * hitp->hit_vpriv[Z] * hitp->hit_vpriv[Z]));
+    fz = w * w * hitp->hit_vpriv[Z] - 160.0/9.0 * hitp->hit_vpriv[Y] * 
hitp->hit_vpriv[Y] 
+    * hitp->hit_vpriv[Y] * hitp->hit_vpriv[Z] * hitp->hit_vpriv[Z];
+    VSET(work, fx, fy, fz);
+    VUNITIZE(work);
+
+    MAT3X3VEC(hitp->hit_normal, hrt->hrt_invR, work);
 }
 
 

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

Reply via email to