/// <summary> /// 接收两个轨迹数据,(用于轨迹分析),每一帧调用 /// </summary> /// <param name="refData">参考数据,此数据作为参考对象</param> /// <param name="AppraiseData">分析数据,需要对此数据进行分析</param> public void RecvCompairTrailData(ModelCtrlData refData, ModelCtrlData AppraiseData) { TrailCurveDrawCtrl.Instance().studyMotion.getTraj(0).add(AppraiseData.toLeftTPose()); TrailCurveDrawCtrl.Instance().studyMotion.getTraj(1).add(AppraiseData.toRightTPose()); if (cur_frame < 5) { deta_left += new Vec3(AppraiseData.bodyCtrlData.HandLeftPos - refData.bodyCtrlData.HandLeftPos); deta_right += new Vec3(AppraiseData.bodyCtrlData.HandRightPos - refData.bodyCtrlData.HandRightPos); if (cur_frame == 4) { deta_left /= 5; deta_right /= 5; } left_color_list.Add(0.0f); right_color_list.Add(0.0f); if (cur_frame == 0) { TrailCurveDrawCtrl.Instance().startDraw(true); } } else { left_color_list.Add(Math.Abs((float)(new Vec3(AppraiseData.bodyCtrlData.HandLeftPos - refData.bodyCtrlData.HandLeftPos) - deta_left).norm())); right_color_list.Add(Math.Abs((float)(new Vec3(AppraiseData.bodyCtrlData.HandRightPos - refData.bodyCtrlData.HandRightPos) - deta_right).norm())); } cur_frame++; }
/// <summary> /// 接收用于绘制轨迹的参数,自行决定是否绘制轨迹每一帧调用 /// </summary> /// <param name="modelCtrlData"></param> public void RecvTrailData(ModelCtrlData modelCtrlData) { curMotion.getTraj(0).push_back(modelCtrlData.toLeftTPose()); curMotion.getTraj(1).push_back(modelCtrlData.toRightTPose()); if (is_first) { startDraw(false); is_first = false; } }