[Debian-astro-commits] [gyoto] 205/221: Change impactcoords to always return the first (backwards) encounter with the object

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit 26c95ca9f32dfb5c4627203e470c571a17000fa8
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Thu Mar 26 12:39:30 2015 +0100

    Change impactcoords to always return the first (backwards) encounter with the object
---
 lib/Astrobj.C | 2 +-
 lib/Photon.C  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Astrobj.C b/lib/Astrobj.C
index 3b5b226..6169d29 100644
--- a/lib/Astrobj.C
+++ b/lib/Astrobj.C
@@ -188,7 +188,7 @@ void Generic::processHitQuantities(Photon* ph, double* coord_ph_hit,
       GYOTO_DEBUG_EXPR(*data->time);
 #endif
     }
-    if (data->impactcoords) {
+    if (data->impactcoords && data->impactcoords[0]==DBL_MAX) {
       memcpy(data->impactcoords, coord_obj_hit, 8 * sizeof(double));
       memcpy(data->impactcoords+8, coord_ph_hit, 8 * sizeof(double));
     }
diff --git a/lib/Photon.C b/lib/Photon.C
index 858f4e0..6cbd4a3 100644
--- a/lib/Photon.C
+++ b/lib/Photon.C
@@ -420,7 +420,7 @@ int Photon::hit(Astrobj::Properties *data) {
 #       endif
 
 	// store coordinates of outgoing photon in impactcoords
-	if (data && data->impactcoords) {
+	if (data && data->impactcoords && data->impactcoords[0]==DBL_MAX) {
 	  for (size_t i=0; i<8; ++i) data->impactcoords[i]=DBL_MAX;
 	  memcpy(data->impactcoords+8, coord, 8 * sizeof(double));
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list