From 6aad66646f841a079a4d962b8a400eacf1c11722 Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Tue, 13 Jun 2017 15:53:44 -0500 Subject: [PATCH] Update cannon_impact function for tutorial. Ref #439 --- trick_sims/Cannon/models/cannon/gravity/src/cannon_numeric.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trick_sims/Cannon/models/cannon/gravity/src/cannon_numeric.c b/trick_sims/Cannon/models/cannon/gravity/src/cannon_numeric.c index c10d8596..eb66964e 100644 --- a/trick_sims/Cannon/models/cannon/gravity/src/cannon_numeric.c +++ b/trick_sims/Cannon/models/cannon/gravity/src/cannon_numeric.c @@ -57,12 +57,12 @@ double cannon_impact( CANNON* C ) { now = get_integ_time() ; tgo = regula_falsi( now, &(C->rf) ) ; if (tgo == 0.0) { - C->impact = 1 ; now = get_integ_time() ; reset_regula_falsi( now, &(C->rf) ) ; + C->impact = 1 ; + C->impactTime = now; C->vel[0] = 0.0 ; C->vel[1] = 0.0 ; C->acc[0] = 0.0 ; C->acc[1] = 0.0 ; - C->impactTime = C->time; fprintf(stderr, "\n\nIMPACT: SimTime = %.9f, ModelTime = %.9f, pos = %.9f\n\n", now, C->impactTime, C->pos[0] ) ; } return ( tgo ) ;