CFTTCamera.cpp 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. #include "CFTTCamera.h"
  2. #include "CFTTMatrix32.h"
  3. #include "Matrix.h"
  4. #include "FTTGraphics.h"
  5. #include "CFTTShaderBuiltInConstants.h"
  6. CFTTVector32 CFTTCamera::s_tPosition;
  7. CFTTMatrix32 CFTTCamera::s_tOrientation;
  8. float CFTTCamera::s_fNearPlane;
  9. float CFTTCamera::s_fPerspectiveYOffset;
  10. float CFTTCamera::s_fPerspectiveXOffset;
  11. float CFTTCamera::s_fFieldOfView;
  12. float CFTTCamera::s_fFarPlane;
  13. float CFTTCamera::s_fOrthoLeft;
  14. float CFTTCamera::s_fOrthoRight;
  15. float CFTTCamera::s_fOrthoBottom;
  16. float CFTTCamera::s_fOrthoTop;
  17. bool CFTTCamera::s_bProjectionMatrixChanged;
  18. bool CFTTCamera::s_bViewMatrixChanged;
  19. int CFTTCamera::s_iViewportWidth;
  20. int CFTTCamera::s_iViewportHeight;
  21. bool CFTTCamera::s_bOrthagonal;
  22. float CFTTCamera::s_fWidthOverHeight;
  23. CFTTMatrix32 CFTTCamera::s_matProjRender;
  24. CFTTMatrix32 CFTTCamera::s_matProjCanonical;
  25. CFTTMatrix32 CFTTCamera::s_matView;
  26. CFTTMatrix32 CFTTCamera::s_matViewProjRender;
  27. CFTTMatrix32 CFTTCamera::s_matViewProjCanonical;
  28. CFTTFrustum32 CFTTCamera::s_tFrustum;
  29. CFTTSphere32 CFTTCamera::s_tFrustumBoundingSphere;
  30. CFTTCone32 CFTTCamera::s_tFrustumBoundingCone;
  31. //-------------------------------------------------------------------------------------------------
  32. //00266900 //^_- 经过单元测试,功能正常
  33. CFTTMatrix32 MakeProjectionMatrixOrtho32(float a2, float a3, float a4, float a5, float a6, float a7, EScreenRotation a8, bool a9, bool a10) {
  34. CFTTMatrix32 ret;
  35. return ret;
  36. }
  37. //-------------------------------------------------------------------------------------------------
  38. //002666C4 ^_^
  39. CFTTMatrix32 MakeProjectionMatrix32(float a2, float a3, float a4, float a5, float a6, float a7, EScreenRotation a8, bool a9, bool a10) {
  40. CFTTMatrix32 ret;
  41. return ret;
  42. }
  43. //-------------------------------------------------------------------------------------------------
  44. //002665E4 //^_- 经过单元测试,功能正常
  45. CFTTMatrix32 MakeOrientationMatrix32(CFTTVector32 const &a2, CFTTVector32 const *a3) {
  46. //以下指令不一样
  47. CFTTMatrix32 ret;
  48. return ret;
  49. }
  50. //-------------------------------------------------------------------------------------------------
  51. //001FF48C
  52. void CFTTCamera::Initialise() {
  53. }
  54. //-------------------------------------------------------------------------------------------------
  55. //001FF490 ^_- 经过单元测试,功能正常
  56. void CFTTCamera::Reset() {
  57. }
  58. //-------------------------------------------------------------------------------------------------
  59. //001FF588
  60. void CFTTCamera::Shutdown() {
  61. }
  62. //-------------------------------------------------------------------------------------------------
  63. //001FF58C ^_^ 经过单元测试,功能正常
  64. void CFTTCamera::ApplyCameraSettings() {
  65. LOGE("CFTTCamera::ApplyCameraSettings");
  66. }
  67. //-------------------------------------------------------------------------------------------------
  68. //001FF5B4//^_- 经过单元测试,功能正常
  69. void CFTTCamera::EvaluateMatricesAndFrustum() {
  70. }
  71. //-------------------------------------------------------------------------------------------------
  72. //001FFA3C ^_^ 经过单元测试,功能正常
  73. void CFTTCamera::SetPosition(CFTTVector32 const &a1) {
  74. LOGE("%x%x%x",a1.float_0,a1.float_4,a1.float_8);
  75. }
  76. //-------------------------------------------------------------------------------------------------
  77. //001FFA64 ^_^ 经过单元测试,功能正常
  78. void CFTTCamera::GetPosition(CFTTVector32 &a1) {
  79. }
  80. //-------------------------------------------------------------------------------------------------
  81. //001FFA7C ^_^
  82. void CFTTCamera::SetFrustum(CFTTFrustum32 a1) {
  83. }
  84. //-------------------------------------------------------------------------------------------------
  85. //001FFAA4 ^_^
  86. void CFTTCamera::GetFrustum(CFTTFrustum32 &a1) {
  87. }
  88. //-------------------------------------------------------------------------------------------------
  89. //001FFAB8 ^_^
  90. void CFTTCamera::GetFrustumSphere(CFTTSphere32 &a1) {
  91. }
  92. //-------------------------------------------------------------------------------------------------
  93. //001FFAD0 ^_^
  94. void CFTTCamera::GetFrustumCone(CFTTCone32 &a1) {
  95. }
  96. //-------------------------------------------------------------------------------------------------
  97. //001FFAE0 ^_^
  98. void CFTTCamera::SetOrientation(CFTTMatrix32 const &a1) {
  99. }
  100. //-------------------------------------------------------------------------------------------------
  101. //001FFB04 ^_^ 经过单元测试,功能正常
  102. void CFTTCamera::SetDirection(CFTTVector32 const &a1, CFTTVector32 const *a2) {
  103. LOGE("%x%x%x",a1.float_0,a1.float_4,a1.float_8);
  104. LOGE("%x",a2);
  105. LOGE("%x%x%x",a2->float_0,a2->float_4,a2->float_8);
  106. }
  107. //-------------------------------------------------------------------------------------------------
  108. //001FFB38 ^_^
  109. void CFTTCamera::GetOrientation(CFTTMatrix32 &a1) {
  110. }
  111. //-------------------------------------------------------------------------------------------------
  112. //001FFB48 ^_- 经过单元测试,功能正常
  113. void CFTTCamera::GetForwardDirection(CFTTVector32 &a1) {
  114. }
  115. //-------------------------------------------------------------------------------------------------
  116. //001FFB6C ^_-
  117. void CFTTCamera::GetUpDirection(CFTTVector32 &a1) {
  118. }
  119. //-------------------------------------------------------------------------------------------------
  120. //001FFB90 ^_-
  121. void CFTTCamera::GetRightDirection(CFTTVector32 &a1) {
  122. }
  123. //-------------------------------------------------------------------------------------------------
  124. //001FFBB4 ^_^ 经过单元测试,功能正常
  125. void CFTTCamera::LookAt(CFTTVector32 const &a1, CFTTVector32 const *a2) {
  126. }
  127. //-------------------------------------------------------------------------------------------------
  128. //001FFC8C ^_^
  129. void CFTTCamera::LookAt(CFTTVector32 const &a1, CFTTVector32 const &a2, float a3, CFTTVector32 const *a4) {
  130. }
  131. //-------------------------------------------------------------------------------------------------
  132. //001FFCF8 ^_^ 经过单元测试,功能正常
  133. void CFTTCamera::SetOrthographic(float a1, float a2, float a3, float a4, float a5, float a6) {
  134. LOGE("CFTTCamera::SetOrthographic=%x%x%x%x%x%x",a1,a2,a3,a4,a5,a6);
  135. }
  136. //-------------------------------------------------------------------------------------------------
  137. //001FFDD8 ^_^ 经过单元测试,功能正常
  138. void CFTTCamera::SetNearAndFarPlanes(float a1, float a2) {
  139. }
  140. //-------------------------------------------------------------------------------------------------
  141. //001FFE28 ^_^ 经过单元测试,功能正常
  142. void CFTTCamera::SetFOV(float a1) {
  143. }
  144. //-------------------------------------------------------------------------------------------------
  145. //001FFE5C ^_^ 经过单元测试,功能正常
  146. void CFTTCamera::SetOrthographic(float a1, float a2, bool a3) {
  147. }
  148. //-------------------------------------------------------------------------------------------------
  149. //001FFEB0 ^_^ 经过单元测试,功能正常
  150. bool CFTTCamera::GetOrthoSettings(float &a1, float &a2, float &a3, float &a4) {
  151. return 0;
  152. }
  153. //-------------------------------------------------------------------------------------------------
  154. //001FFEFC ^_^ 经过单元测试,功能正常
  155. void CFTTCamera::GetViewport(int &a1, int &a2) {
  156. }
  157. //-------------------------------------------------------------------------------------------------
  158. //001FFF1C ^_^ 经过单元测试,功能正常
  159. void CFTTCamera::SetViewport(int a1, int a2, float a3) {
  160. LOGE("%x%x%X",a1,a2,a3);
  161. }
  162. //-------------------------------------------------------------------------------------------------
  163. //001FFF88 ^_^
  164. bool CFTTCamera::IsOrthographic() {
  165. return 0;
  166. }
  167. //-------------------------------------------------------------------------------------------------
  168. //001FFFA8 ^_^
  169. float CFTTCamera::GetFOV() {
  170. return 0;
  171. }
  172. //-------------------------------------------------------------------------------------------------
  173. //001FFFB8 ^_^ 经过单元测试,功能正常
  174. void CFTTCamera::GetNearAndFarPlanes(float &a1, float &a2) {
  175. }
  176. //-------------------------------------------------------------------------------------------------
  177. //001FFFD8 ^_^ 经过单元测试,功能正常
  178. void CFTTCamera::SetPerspectiveOffsets(float fXOffset, float fYOffset) {
  179. }
  180. //-------------------------------------------------------------------------------------------------
  181. //00200028 ^_^
  182. void CFTTCamera::GetPerspectiveOffsets(float &a1, float &a2) {
  183. }
  184. //-------------------------------------------------------------------------------------------------
  185. //00200048 ^_^
  186. bool CFTTCamera::IsSphereInFrustum(CFTTSphere32 const &a1, bool *a2) {
  187. return false;
  188. }
  189. //-------------------------------------------------------------------------------------------------
  190. //002001DC ^_^
  191. bool CFTTCamera::IsAABBInFrustum( CFTTAABB32 const& a1, bool *a2) {
  192. int result; // r0
  193. return result;
  194. }
  195. //-------------------------------------------------------------------------------------------------
  196. //002002D0^_-模块测试可以正常运行
  197. int CFTTCamera::WorldSpaceToScreenSpace(CFTTVector32 const &a1, CFTTVector32 &a2, bool a3) {
  198. int ret = 0;
  199. return ret;
  200. }
  201. //-------------------------------------------------------------------------------------------------
  202. //0020040C^_- 局部变量的栈位置不一样,应该是声明的位置不一样造成的。 其它都一样 模块测试可以正常运行
  203. void CFTTCamera::ScreenSpaceToWorldSpace(float a1, float a2, CFTTVector32 &a3, CFTTVector32 &a4) {
  204. }
  205. //-------------------------------------------------------------------------------------------------
  206. //002004F8 ^_^
  207. CFTTMatrix32 CFTTCamera::GetCanonicalToRenderMat() {
  208. CFTTMatrix32 ret;
  209. return ret;
  210. }
  211. //-------------------------------------------------------------------------------------------------