CBall.cpp 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. #include "CBall.h"
  2. CBall cBall;
  3. uint16 CBall::s_iAirResistanceDistMult[201];
  4. //-------------------------------------------------------------------------------------------------
  5. //00156E3C
  6. void CBall::UpdateFrame() {
  7. }
  8. //-------------------------------------------------------------------------------------------------
  9. //00156F38
  10. void CBall::CheckEvents() {
  11. }
  12. //-------------------------------------------------------------------------------------------------
  13. //001575DC
  14. void CBall::ClampSpeed(int, int) {
  15. }
  16. //-------------------------------------------------------------------------------------------------
  17. //00157648
  18. void CBall::Stop() {
  19. LOGE("CBall::Stop%p",this);
  20. }
  21. //-------------------------------------------------------------------------------------------------
  22. //00157668
  23. void CBall::SetVel(int i1, int i2, int i3) {
  24. LOGE("%p%x%x%xCBall::SetVel",this,i1,i2,i3);
  25. }
  26. //-------------------------------------------------------------------------------------------------
  27. //00157678
  28. void CBall::SetVelRel(int i1, int i2, int i3) {
  29. LOGE("%p%x%x%xCBall::SetVel",this,i1,i2,i3);
  30. }
  31. //-------------------------------------------------------------------------------------------------
  32. //00157698
  33. void CBall::AdjustKickToPos(TPoint) {
  34. }
  35. //-------------------------------------------------------------------------------------------------
  36. //001577B4
  37. int CBall::SetBallMoveToPosSpin(TPoint3D *a1, int a2, int a3, TPoint3D a4, TPoint3D a5, int a6, int a7) {
  38. LOGE("CBall::SetBallMoveToPosSpin%p%d%d%d%d",a1,a2,a3,a6,a7);
  39. LOGE("%d%d%d",a4.dz_8,a4.point_0.dx_0,a4.point_0.dy_4);
  40. LOGE("%d%d%d",a5.dz_8,a5.point_0.dx_0,a5.point_0.dy_4);
  41. return rand();
  42. }
  43. //-------------------------------------------------------------------------------------------------
  44. //0015799E
  45. CBall& CBall::operator=(CBall const & ball1) {
  46. return *this;
  47. }
  48. //-------------------------------------------------------------------------------------------------
  49. //00157A3C
  50. int CBall::SetBallMoveToPosLowSpin(TPoint3D *, int, int, TPoint3D, TPoint3D, int, int) {
  51. return 0;
  52. }
  53. //-------------------------------------------------------------------------------------------------
  54. //00157C94
  55. int CBall::GetPassPowerX(int, int) {
  56. return 0;
  57. }
  58. //-------------------------------------------------------------------------------------------------
  59. //00157D08
  60. int CBall::GetPassLength(int, int) {
  61. return 0;
  62. }
  63. //-------------------------------------------------------------------------------------------------
  64. //00157DA4
  65. int CBall::SetBallMoveToPos(TPoint3D* pt1, TPoint3D pt2, TPoint3D pt3, int i4, int i5, int i6) {
  66. TPoint pt_0;
  67. pt_0.dx_0 = pt3.point_0.dx_0 - pt2.point_0.dx_0;
  68. pt_0.dy_4 = pt3.point_0.dy_4 - pt2.point_0.dy_4;
  69. // 157db8
  70. int Mag_r7 = XMATH_Mag(&pt_0);
  71. int tmp_r5;
  72. bool b_r7;
  73. // 157dca
  74. if (i5 >= 1) {
  75. // 157dce
  76. if (Mag_r7 != 0) {
  77. // 157dd0
  78. int tmp_r1 = i5;
  79. if (i5 <= 1)
  80. tmp_r1 = 1;
  81. tmp_r5 = Mag_r7 / tmp_r1;
  82. } else {
  83. // 157e12
  84. tmp_r5 = 30;
  85. }
  86. // 157e1e
  87. while (tmp_r5 < 512) {
  88. // 157e24
  89. if ((CBall::s_iAirResistanceDistMult[tmp_r5] * tmp_r5 / 2048) * i5 >= Mag_r7)
  90. break;
  91. tmp_r5++;
  92. }
  93. b_r7 = true;
  94. } else {
  95. // 157de2
  96. tmp_r5 = i4;
  97. int tmp_r1 = 1;
  98. int tmp_r6 = 1;
  99. // 157dea
  100. if (tmp_r5 > 1)
  101. tmp_r1 = tmp_r5;
  102. int tmp_r0 = (Mag_r7 / tmp_r1) << 11;
  103. uint tmp_r10 = CBall::s_iAirResistanceDistMult[tmp_r5];
  104. if (tmp_r10 > 1)
  105. tmp_r6 = tmp_r10;
  106. i5 = tmp_r0 / tmp_r6;
  107. b_r7 = false;
  108. // 157e10
  109. }
  110. // 157e40
  111. XMATH_Normalize(&pt_0, i5);
  112. *pt1 = pt_0;
  113. int r0_i=tmp_r5 * tmp_r5 * 98; //必须这样写 原来的写法除法不对
  114. pt1->dz_8 = ((r0_i>>1) + (pt3.dz_8 - pt2.dz_8)) / tmp_r5;
  115. // 157e62
  116. if (i6 != 0) {
  117. // 157e6a
  118. pt1->dz_8 = (pt1->dz_8 << 10) / (1024 + tGame.mTMath_6734.field_394 / 2);
  119. // 157e88
  120. }
  121. // 157e8c
  122. int Result = XMATH_Mag3D(pt1);
  123. if (b_r7)
  124. Result = tmp_r5;
  125. return Result;
  126. }
  127. //-------------------------------------------------------------------------------------------------
  128. //00157EAC
  129. int CBall::SetBallMoveToPosLow(TPoint3D *a1, TPoint3D a2, TPoint3D a3, int a4, int a5) {
  130. LOGE("CBall::SetBallMoveToPosLow%p%x%x",a1,a4,a5);
  131. LOGE("%x%x%x",a2.dz_8,a2.point_0.dx_0,a2.point_0.dy_4);
  132. LOGE("%x%x%x",a3.dz_8,a3.point_0.dx_0,a3.point_0.dy_4);
  133. LOGE("%x%x%x",a1->dz_8,a1->point_0.dx_0,a1->point_0.dy_4);
  134. return rand();
  135. }
  136. //-------------------------------------------------------------------------------------------------
  137. //00157FF4
  138. void CBall::AirResistanceInit() {
  139. }
  140. //-------------------------------------------------------------------------------------------------
  141. //0015806C
  142. void CBall::ProjectionPassLengthInit() {
  143. }
  144. //-------------------------------------------------------------------------------------------------
  145. //00158148
  146. void CBall::PlayNetSound() {
  147. }
  148. //-------------------------------------------------------------------------------------------------
  149. //0015818C
  150. void CBall::CornerFlagCollision(int, int) {
  151. }
  152. //-------------------------------------------------------------------------------------------------
  153. //00158228
  154. int CBall::PointBallTest(TPoint *, int) {
  155. return 0;
  156. }
  157. //-------------------------------------------------------------------------------------------------
  158. //00158254
  159. void CBall::DoBallGoalBounce() {
  160. }
  161. //-------------------------------------------------------------------------------------------------
  162. //00158638
  163. void CBall::Deflect() {
  164. LOGE("%pCBall::Deflect",this);
  165. }
  166. //-------------------------------------------------------------------------------------------------
  167. //001586DC
  168. bool CBall::CheckPostXYCol(TPoint3D) {
  169. return false;
  170. }
  171. //-------------------------------------------------------------------------------------------------
  172. //001588E8
  173. bool CBall::CheckPostYZCol(TPoint3D) {
  174. return false;
  175. }
  176. //-------------------------------------------------------------------------------------------------
  177. //0015897C
  178. bool CBall::DoBallPostCollisions() {
  179. return false;
  180. }
  181. //-------------------------------------------------------------------------------------------------
  182. //001589CC
  183. bool CBall::BannerCollisionX(int) {
  184. return false;
  185. }
  186. //-------------------------------------------------------------------------------------------------
  187. //00158A60
  188. bool CBall::BannerCollisionY(int) {
  189. return false;
  190. }
  191. //-------------------------------------------------------------------------------------------------
  192. //001592A0
  193. void CBall::CounterBallSpinZ(int) {
  194. }
  195. //-------------------------------------------------------------------------------------------------
  196. //001592F8
  197. void CBall::ApplySpin(TPoint3D *, TPoint3D *, int, int) {
  198. }
  199. //-------------------------------------------------------------------------------------------------
  200. //00159334
  201. void CBall::ApplyExactSpin(TPoint3D *, TPoint3D *, int, int) {
  202. }
  203. //-------------------------------------------------------------------------------------------------
  204. //00159370
  205. void CBall::ApplyGroundSpin(TPoint3D *, TPoint3D *) {
  206. }
  207. //-------------------------------------------------------------------------------------------------
  208. //00159404
  209. void CBall::CalcSpeed() {
  210. }
  211. //-------------------------------------------------------------------------------------------------
  212. //0015946C
  213. void CBall::CalcVars() {
  214. }
  215. //-------------------------------------------------------------------------------------------------
  216. //001595A4
  217. void CBall::CheckBallInGoal() {
  218. }
  219. //-------------------------------------------------------------------------------------------------