Commit 841522e4 authored by Nicolas Van der Noot's avatar Nicolas Van der Noot
Browse files

correct viewpoint past visualization

parent 27a6f3a6
......@@ -193,11 +193,26 @@ void update_java(Simu_realtime *realtime)
if (java->visu_past_flag)
{
java->visu_past_flag = 0;
java->visu_past_flag = 0;
java->last_past_q_flag = 1;
update_jni(java->jni_struct, java, java->nb_q, java->past_q);
}
else if (java->change_viewpoint)
{
if (java->last_past_q_flag)
{
update_jni(java->jni_struct, java, java->nb_q, java->past_q);
}
else
{
update_jni(java->jni_struct, java, java->nb_q, java->cur_q);
}
}
else
{
java->last_past_q_flag = 0;
update_jni(java->jni_struct, java, java->nb_q, java->cur_q);
}
}
......
......@@ -116,6 +116,8 @@ Realtime_java* init_realtime_java(void *realtime_options, MbsData* mbs_data)
java->flag_buffer_round = 0;
java->last_past_q_flag = 0;
java->cur_q = (double*) malloc(nb_q * sizeof(double));
for(i=0; i<nb_q; i++)
{
......
......@@ -54,6 +54,7 @@ typedef struct Realtime_java
int visu_past_flag; ///< 1 to view what happened before, 0 otherwise
double t_visu_past; ///< requested time for past visualization
int flag_buffer_round; ///< 1 if buffer already filled, 0 otherwise
int last_past_q_flag; ///< 1 if last visu was with past_q, 0 otherwise
char *mbs_file; ///< path and file name fot the .mbs file used for Java visualization
double *tsim_save; ///< vector saving the simulation time [s]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment