CBall.cpp 6.9 KB

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