Sfoglia il codice sorgente

优化脚环-踢馆大师,将条件跳窄

liang 2 anni fa
parent
commit
59c550bb68
2 ha cambiato i file con 14 aggiunte e 12 eliminazioni
  1. 1 1
      footRing_sdk_1.0/include/pub.h
  2. 13 11
      footRing_sdk_1.0/src/Aerobics.cpp

+ 1 - 1
footRing_sdk_1.0/include/pub.h

@@ -44,7 +44,7 @@ using namespace std;
 
 #define PRESS_MIN 41000
 
-#define GAME_VERSION "0.5.63"
+#define GAME_VERSION "0.6.1"
 
 enum CMD_MOTION
 {

+ 13 - 11
footRing_sdk_1.0/src/Aerobics.cpp

@@ -182,28 +182,30 @@ void Aerobics::setResult(deque<shoes_data_cell>& step_data_vector,int LEFT_OR_RI
 	float roll  = step_data_vector.back().roll;
 
 	//暂时先将抬脚的高度阈值为0.1m, 伸脚的距离设置为0.2m
-	if (high > high_thresh && plane_length > 0.2)
+	if ( plane_length > 0.3)
 	{
 		//if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_left_status == 1 && roll > -2.9f && roll < 0.0f)
-		if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_left_status == 1 && roll > 2.0f)
+		if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_left_status == 1 && roll > 1.8f)
 		{
-			std::cout << "MOTION_STRETCH_LEFT" << endl;
+			std::cout << "MOTION_STRETCH_LEFT : " << "左侧踢"<< endl;
 			result[0] = MOTION_STRETCH_LEFT;
 			stretch_left_status = 0;
 			lift_left_status = 0;
+			stretch_front_left_status = 0;
 		}
-		else if(LEFT_OR_RIGHT == RIGHT_FOOT && stretch_right_status == 1 && roll > 2.0f)
+		else if(LEFT_OR_RIGHT == RIGHT_FOOT && stretch_right_status == 1 && roll > 1.8f)
 		{
-			std::cout << "MOTION_STRETCH_RIGHT" << endl;
+			std::cout << "MOTION_STRETCH_RIGHT: " << "右侧踢" << endl;
 			result[0] = MOTION_STRETCH_RIGHT;
 			stretch_right_status = 0;
 			lift_right_status = 0;
+			stretch_front_right_status = 0;
 		}
 
 		if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_front_left_status == 1
 			&& step_data_vector.back().pos_y > 0.2f)
 		{
-			std::cout << "MOTION_STRETCH_FRONT_LEFT" << endl;
+			std::cout << "MOTION_STRETCH_FRONT_LEFT: " << "左前踢" << endl;
 			result[0] = MOTION_STRETCH_FRONT_LEFT;
 			stretch_front_left_status = 0;
 			lift_left_status = 0;
@@ -211,7 +213,7 @@ void Aerobics::setResult(deque<shoes_data_cell>& step_data_vector,int LEFT_OR_RI
 		else if (LEFT_OR_RIGHT == RIGHT_FOOT && stretch_front_right_status == 1 
 			&& step_data_vector.back().pos_y > 0.2f)
 		{
-			std::cout << "MOTION_STRETCH_FRONT_RIGHT" << endl;
+			std::cout << "MOTION_STRETCH_FRONT_RIGHT" << "右前踢" << endl;
 			result[0] = MOTION_STRETCH_FRONT_RIGHT;
 			stretch_front_right_status = 0;
 			lift_right_status = 0;
@@ -222,19 +224,19 @@ void Aerobics::setResult(deque<shoes_data_cell>& step_data_vector,int LEFT_OR_RI
 	{
 		if (LEFT_OR_RIGHT == LEFT_FOOT && lift_left_status == 1)
 		{
-			std::cout << "MOTION_LIFT_LEFT" << endl;
+			std::cout << "MOTION_LIFT_LEFT " << "左抬脚" << endl;
 			result[0] = MOTION_LIFT_LEFT;
 			lift_left_status = 0;
 		}
 		else if (LEFT_OR_RIGHT == RIGHT_FOOT && lift_right_status == 1)
 		{
-			std::cout << "MOTION_LIFT_RIGHT" << endl;
+			std::cout << "MOTION_LIFT_RIGHT " << "右抬脚" << endl;
 			result[0] = MOTION_LIFT_RIGHT;
 			lift_right_status = 0;
 		}
 	}
 
-	/*if (plane_length > 0.2)
+	if (plane_length > 0.3)
 	{
 		std::cout << "test : plane_length > 0.2" << endl;
 	}
@@ -242,5 +244,5 @@ void Aerobics::setResult(deque<shoes_data_cell>& step_data_vector,int LEFT_OR_RI
 	if (high > high_thresh)
 	{
 		std::cout << "high > high_thresh" << endl;
-	}*/
+	}
 }