|
@@ -1,5 +1,6 @@
|
|
|
#include "CBall.h"
|
|
|
CBall cBall;
|
|
|
+uint16 CBall::s_iAirResistanceDistMult[201];
|
|
|
//-------------------------------------------------------------------------------------------------
|
|
|
//00156E3C
|
|
|
void CBall::UpdateFrame() {
|
|
@@ -57,9 +58,75 @@ int CBall::GetPassLength(int, int) {
|
|
|
}
|
|
|
//-------------------------------------------------------------------------------------------------
|
|
|
//00157DA4
|
|
|
-int CBall::SetBallMoveToPos(TPoint3D *, TPoint3D, TPoint3D, int, int, int) {
|
|
|
- return 0;
|
|
|
-}
|
|
|
+int CBall::SetBallMoveToPos(TPoint3D* pt1, TPoint3D pt2, TPoint3D pt3, int i4, int i5, int i6) {
|
|
|
+ TPoint pt_0;
|
|
|
+ pt_0.dx_0 = pt3.point_0.dx_0 - pt2.point_0.dx_0;
|
|
|
+ pt_0.dy_4 = pt3.point_0.dy_4 - pt2.point_0.dy_4;
|
|
|
+ // 157db8
|
|
|
+ int Mag_r7 = XMATH_Mag(&pt_0);
|
|
|
+ int tmp_r5;
|
|
|
+ bool b_r7;
|
|
|
+ // 157dca
|
|
|
+ if (i5 >= 1) {
|
|
|
+ // 157dce
|
|
|
+ if (Mag_r7 != 0) {
|
|
|
+ // 157dd0
|
|
|
+ int tmp_r1 = i5;
|
|
|
+ if (i5 <= 1)
|
|
|
+ tmp_r1 = 1;
|
|
|
+ tmp_r5 = Mag_r7 / tmp_r1;
|
|
|
+ } else {
|
|
|
+ // 157e12
|
|
|
+ tmp_r5 = 30;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 157e1e
|
|
|
+ while (tmp_r5 < 512) {
|
|
|
+ // 157e24
|
|
|
+ if ((CBall::s_iAirResistanceDistMult[tmp_r5] * tmp_r5 / 2048) * i5 >= Mag_r7)
|
|
|
+ break;
|
|
|
+ tmp_r5++;
|
|
|
+ }
|
|
|
+ b_r7 = true;
|
|
|
+ } else {
|
|
|
+ // 157de2
|
|
|
+ tmp_r5 = i4;
|
|
|
+ int tmp_r1 = 1;
|
|
|
+ int tmp_r6 = 1;
|
|
|
+ // 157dea
|
|
|
+ if (tmp_r5 > 1)
|
|
|
+ tmp_r1 = tmp_r5;
|
|
|
+
|
|
|
+ int tmp_r0 = (Mag_r7 / tmp_r1) << 11;
|
|
|
+ uint tmp_r10 = CBall::s_iAirResistanceDistMult[tmp_r5];
|
|
|
+ if (tmp_r10 > 1)
|
|
|
+ tmp_r6 = tmp_r10;
|
|
|
+ i5 = tmp_r0 / tmp_r6;
|
|
|
+
|
|
|
+ b_r7 = false;
|
|
|
+ // 157e10
|
|
|
+ }
|
|
|
+
|
|
|
+ // 157e40
|
|
|
+ XMATH_Normalize(&pt_0, i5);
|
|
|
+ *pt1 = pt_0;
|
|
|
+ int r0_i=tmp_r5 * tmp_r5 * 98; //必须这样写 原来的写法除法不对
|
|
|
+
|
|
|
+ pt1->dz_8 = ((r0_i>>1) + (pt3.dz_8 - pt2.dz_8)) / tmp_r5;
|
|
|
+ // 157e62
|
|
|
+ if (i6 != 0) {
|
|
|
+ // 157e6a
|
|
|
+ pt1->dz_8 = (pt1->dz_8 << 10) / (1024 + tGame.mTMath_6734.field_394 / 2);
|
|
|
+ // 157e88
|
|
|
+ }
|
|
|
+ // 157e8c
|
|
|
+ int Result = XMATH_Mag3D(pt1);
|
|
|
+ if (b_r7)
|
|
|
+ Result = tmp_r5;
|
|
|
+ return Result;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//-------------------------------------------------------------------------------------------------
|
|
|
//00157EAC
|
|
|
int CBall::SetBallMoveToPosLow(TPoint3D *, TPoint3D, TPoint3D, int, int) {
|