private static void GmBsCmnUpdateDelaySearch(AppMain.GMS_BS_CMN_DELAY_SEARCH_WORK dsearch_work) { ++dsearch_work.cur_point; if (dsearch_work.cur_point >= dsearch_work.hist_num) { dsearch_work.cur_point = 0; } ++dsearch_work.record_cnt; dsearch_work.pos_hist_buf[dsearch_work.cur_point].Assign(dsearch_work.targ_obj.pos); }
private static void GmBsCmnInitDelaySearch( AppMain.GMS_BS_CMN_DELAY_SEARCH_WORK dsearch_work, AppMain.OBS_OBJECT_WORK targ_obj, AppMain.VecFx32[] pos_hist_buf, int hist_num) { dsearch_work.pos_hist_buf = pos_hist_buf; dsearch_work.cur_point = -1; dsearch_work.hist_num = hist_num; dsearch_work.targ_obj = targ_obj; dsearch_work.record_cnt = 0; AppMain.GmBsCmnUpdateDelaySearch(dsearch_work); }
private static void GmBsCmnGetDelaySearchPos( AppMain.GMS_BS_CMN_DELAY_SEARCH_WORK dsearch_work, int delay_time, out AppMain.VecFx32 pos) { int index; if (delay_time < dsearch_work.record_cnt) { index = dsearch_work.cur_point - delay_time; if (index < 0) { index = dsearch_work.hist_num + index; } } else { index = 0; } pos = dsearch_work.pos_hist_buf[index]; }