test_camera_3d.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. /**************************************************************************/
  2. /* test_camera_3d.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef TEST_CAMERA_3D_H
  31. #define TEST_CAMERA_3D_H
  32. #include "scene/3d/camera_3d.h"
  33. #include "scene/main/viewport.h"
  34. #include "scene/main/window.h"
  35. #include "tests/test_macros.h"
  36. // Constants.
  37. #define SQRT3 (1.7320508f)
  38. TEST_CASE("[SceneTree][Camera3D] Getters and setters") {
  39. Camera3D *test_camera = memnew(Camera3D);
  40. SUBCASE("Cull mask") {
  41. constexpr int cull_mask = (1 << 5) | (1 << 7) | (1 << 9);
  42. constexpr int set_enable_layer = 3;
  43. constexpr int set_disable_layer = 5;
  44. test_camera->set_cull_mask(cull_mask);
  45. CHECK(test_camera->get_cull_mask() == cull_mask);
  46. test_camera->set_cull_mask_value(set_enable_layer, true);
  47. CHECK(test_camera->get_cull_mask_value(set_enable_layer));
  48. test_camera->set_cull_mask_value(set_disable_layer, false);
  49. CHECK_FALSE(test_camera->get_cull_mask_value(set_disable_layer));
  50. }
  51. SUBCASE("Attributes") {
  52. Ref<CameraAttributes> attributes = memnew(CameraAttributes);
  53. test_camera->set_attributes(attributes);
  54. CHECK(test_camera->get_attributes() == attributes);
  55. Ref<CameraAttributesPhysical> physical_attributes = memnew(CameraAttributesPhysical);
  56. test_camera->set_attributes(physical_attributes);
  57. CHECK(test_camera->get_attributes() == physical_attributes);
  58. }
  59. SUBCASE("Camera frustum properties") {
  60. constexpr float depth_near = 0.2f;
  61. constexpr float depth_far = 995.0f;
  62. constexpr float fov = 120.0f;
  63. constexpr float size = 7.0f;
  64. constexpr float h_offset = 1.1f;
  65. constexpr float v_offset = -1.6f;
  66. const Vector2 frustum_offset(5, 7);
  67. test_camera->set_near(depth_near);
  68. CHECK(test_camera->get_near() == depth_near);
  69. test_camera->set_far(depth_far);
  70. CHECK(test_camera->get_far() == depth_far);
  71. test_camera->set_fov(fov);
  72. CHECK(test_camera->get_fov() == fov);
  73. test_camera->set_size(size);
  74. CHECK(test_camera->get_size() == size);
  75. test_camera->set_h_offset(h_offset);
  76. CHECK(test_camera->get_h_offset() == h_offset);
  77. test_camera->set_v_offset(v_offset);
  78. CHECK(test_camera->get_v_offset() == v_offset);
  79. test_camera->set_frustum_offset(frustum_offset);
  80. CHECK(test_camera->get_frustum_offset() == frustum_offset);
  81. test_camera->set_keep_aspect_mode(Camera3D::KeepAspect::KEEP_HEIGHT);
  82. CHECK(test_camera->get_keep_aspect_mode() == Camera3D::KeepAspect::KEEP_HEIGHT);
  83. test_camera->set_keep_aspect_mode(Camera3D::KeepAspect::KEEP_WIDTH);
  84. CHECK(test_camera->get_keep_aspect_mode() == Camera3D::KeepAspect::KEEP_WIDTH);
  85. }
  86. SUBCASE("Projection mode") {
  87. test_camera->set_projection(Camera3D::ProjectionType::PROJECTION_ORTHOGONAL);
  88. CHECK(test_camera->get_projection() == Camera3D::ProjectionType::PROJECTION_ORTHOGONAL);
  89. test_camera->set_projection(Camera3D::ProjectionType::PROJECTION_PERSPECTIVE);
  90. CHECK(test_camera->get_projection() == Camera3D::ProjectionType::PROJECTION_PERSPECTIVE);
  91. }
  92. SUBCASE("Helper setters") {
  93. constexpr float fov = 90.0f, size = 6.0f;
  94. constexpr float near1 = 0.1f, near2 = 0.5f;
  95. constexpr float far1 = 1001.0f, far2 = 1005.0f;
  96. test_camera->set_perspective(fov, near1, far1);
  97. CHECK(test_camera->get_projection() == Camera3D::ProjectionType::PROJECTION_PERSPECTIVE);
  98. CHECK(test_camera->get_near() == near1);
  99. CHECK(test_camera->get_far() == far1);
  100. CHECK(test_camera->get_fov() == fov);
  101. test_camera->set_orthogonal(size, near2, far2);
  102. CHECK(test_camera->get_projection() == Camera3D::ProjectionType::PROJECTION_ORTHOGONAL);
  103. CHECK(test_camera->get_near() == near2);
  104. CHECK(test_camera->get_far() == far2);
  105. CHECK(test_camera->get_size() == size);
  106. }
  107. SUBCASE("Doppler tracking") {
  108. test_camera->set_doppler_tracking(Camera3D::DopplerTracking::DOPPLER_TRACKING_IDLE_STEP);
  109. CHECK(test_camera->get_doppler_tracking() == Camera3D::DopplerTracking::DOPPLER_TRACKING_IDLE_STEP);
  110. test_camera->set_doppler_tracking(Camera3D::DopplerTracking::DOPPLER_TRACKING_PHYSICS_STEP);
  111. CHECK(test_camera->get_doppler_tracking() == Camera3D::DopplerTracking::DOPPLER_TRACKING_PHYSICS_STEP);
  112. test_camera->set_doppler_tracking(Camera3D::DopplerTracking::DOPPLER_TRACKING_DISABLED);
  113. CHECK(test_camera->get_doppler_tracking() == Camera3D::DopplerTracking::DOPPLER_TRACKING_DISABLED);
  114. }
  115. memdelete(test_camera);
  116. }
  117. TEST_CASE("[SceneTree][Camera3D] Position queries") {
  118. // Cameras need a viewport to know how to compute their frustums, so we make a fake one here.
  119. Camera3D *test_camera = memnew(Camera3D);
  120. SubViewport *mock_viewport = memnew(SubViewport);
  121. // 4:2.
  122. mock_viewport->set_size(Vector2(400, 200));
  123. SceneTree::get_singleton()->get_root()->add_child(mock_viewport);
  124. mock_viewport->add_child(test_camera);
  125. test_camera->set_keep_aspect_mode(Camera3D::KeepAspect::KEEP_WIDTH);
  126. REQUIRE_MESSAGE(test_camera->is_current(), "Camera3D should be made current upon entering tree.");
  127. SUBCASE("Orthogonal projection") {
  128. test_camera->set_projection(Camera3D::ProjectionType::PROJECTION_ORTHOGONAL);
  129. // The orthogonal case is simpler, so we test a more random position + rotation combination here.
  130. // For the other cases we'll use zero translation and rotation instead.
  131. test_camera->set_global_position(Vector3(1, 2, 3));
  132. test_camera->look_at(Vector3(-4, 5, 1));
  133. // Width = 5, Aspect Ratio = 400 / 200 = 2, so Height is 2.5.
  134. test_camera->set_orthogonal(5.0f, 0.5f, 1000.0f);
  135. const Basis basis = test_camera->get_global_basis();
  136. // Subtract near so offset starts from the near plane.
  137. const Vector3 offset1 = basis.xform(Vector3(-1.5f, 3.5f, 0.2f - test_camera->get_near()));
  138. const Vector3 offset2 = basis.xform(Vector3(2.0f, -0.5f, -0.6f - test_camera->get_near()));
  139. const Vector3 offset3 = basis.xform(Vector3(-3.0f, 1.0f, -0.6f - test_camera->get_near()));
  140. const Vector3 offset4 = basis.xform(Vector3(-2.0f, 1.5f, -0.6f - test_camera->get_near()));
  141. const Vector3 offset5 = basis.xform(Vector3(0, 0, 10000.0f - test_camera->get_near()));
  142. SUBCASE("is_position_behind") {
  143. CHECK(test_camera->is_position_behind(test_camera->get_global_position() + offset1));
  144. CHECK_FALSE(test_camera->is_position_behind(test_camera->get_global_position() + offset2));
  145. SUBCASE("h/v offset should have no effect on the result of is_position_behind") {
  146. test_camera->set_h_offset(-11.0f);
  147. test_camera->set_v_offset(22.1f);
  148. CHECK(test_camera->is_position_behind(test_camera->get_global_position() + offset1));
  149. test_camera->set_h_offset(4.7f);
  150. test_camera->set_v_offset(-3.0f);
  151. CHECK_FALSE(test_camera->is_position_behind(test_camera->get_global_position() + offset2));
  152. }
  153. // Reset h/v offsets.
  154. test_camera->set_h_offset(0);
  155. test_camera->set_v_offset(0);
  156. }
  157. SUBCASE("is_position_in_frustum") {
  158. // If the point is behind the near plane, it is outside the camera frustum.
  159. // So offset1 is not in frustum.
  160. CHECK_FALSE(test_camera->is_position_in_frustum(test_camera->get_global_position() + offset1));
  161. // If |right| > 5 / 2 or |up| > 2.5 / 2, the point is outside the camera frustum.
  162. // So offset2 is in frustum and offset3 and offset4 are not.
  163. CHECK(test_camera->is_position_in_frustum(test_camera->get_global_position() + offset2));
  164. CHECK_FALSE(test_camera->is_position_in_frustum(test_camera->get_global_position() + offset3));
  165. CHECK_FALSE(test_camera->is_position_in_frustum(test_camera->get_global_position() + offset4));
  166. // offset5 is beyond the far plane, so it is not in frustum.
  167. CHECK_FALSE(test_camera->is_position_in_frustum(test_camera->get_global_position() + offset5));
  168. }
  169. }
  170. SUBCASE("Perspective projection") {
  171. test_camera->set_projection(Camera3D::ProjectionType::PROJECTION_PERSPECTIVE);
  172. // Camera at origin, looking at +Z.
  173. test_camera->set_global_position(Vector3(0, 0, 0));
  174. test_camera->set_global_rotation(Vector3(0, 0, 0));
  175. // Keep width, so horizontal fov = 120.
  176. // Since the near plane distance is 1,
  177. // with trig we know the near plane's width is 2 * sqrt(3), so its height is sqrt(3).
  178. test_camera->set_perspective(120.0f, 1.0f, 1000.0f);
  179. SUBCASE("is_position_behind") {
  180. CHECK_FALSE(test_camera->is_position_behind(Vector3(0, 0, -1.5f)));
  181. CHECK(test_camera->is_position_behind(Vector3(2, 0, -0.2f)));
  182. }
  183. SUBCASE("is_position_in_frustum") {
  184. CHECK(test_camera->is_position_in_frustum(Vector3(-1.3f, 0, -1.1f)));
  185. CHECK_FALSE(test_camera->is_position_in_frustum(Vector3(2, 0, -1.1f)));
  186. CHECK(test_camera->is_position_in_frustum(Vector3(1, 0.5f, -1.1f)));
  187. CHECK_FALSE(test_camera->is_position_in_frustum(Vector3(1, 1, -1.1f)));
  188. CHECK(test_camera->is_position_in_frustum(Vector3(0, 0, -1.5f)));
  189. CHECK_FALSE(test_camera->is_position_in_frustum(Vector3(0, 0, -0.5f)));
  190. }
  191. }
  192. memdelete(test_camera);
  193. memdelete(mock_viewport);
  194. }
  195. TEST_CASE("[SceneTree][Camera3D] Project/Unproject position") {
  196. // Cameras need a viewport to know how to compute their frustums, so we make a fake one here.
  197. Camera3D *test_camera = memnew(Camera3D);
  198. SubViewport *mock_viewport = memnew(SubViewport);
  199. // 4:2.
  200. mock_viewport->set_size(Vector2(400, 200));
  201. SceneTree::get_singleton()->get_root()->add_child(mock_viewport);
  202. mock_viewport->add_child(test_camera);
  203. test_camera->set_global_position(Vector3(0, 0, 0));
  204. test_camera->set_global_rotation(Vector3(0, 0, 0));
  205. test_camera->set_keep_aspect_mode(Camera3D::KeepAspect::KEEP_HEIGHT);
  206. SUBCASE("project_position") {
  207. SUBCASE("Orthogonal projection") {
  208. test_camera->set_orthogonal(5.0f, 0.5f, 1000.0f);
  209. // Center.
  210. CHECK(test_camera->project_position(Vector2(200, 100), 0.5f).is_equal_approx(Vector3(0, 0, -0.5f)));
  211. CHECK(test_camera->project_position(Vector2(200, 100), test_camera->get_far()).is_equal_approx(Vector3(0, 0, -test_camera->get_far())));
  212. // Top left.
  213. CHECK(test_camera->project_position(Vector2(0, 0), 1.5f).is_equal_approx(Vector3(-5.0f, 2.5f, -1.5f)));
  214. CHECK(test_camera->project_position(Vector2(0, 0), test_camera->get_near()).is_equal_approx(Vector3(-5.0f, 2.5f, -test_camera->get_near())));
  215. // Bottom right.
  216. CHECK(test_camera->project_position(Vector2(400, 200), 5.0f).is_equal_approx(Vector3(5.0f, -2.5f, -5.0f)));
  217. CHECK(test_camera->project_position(Vector2(400, 200), test_camera->get_far()).is_equal_approx(Vector3(5.0f, -2.5f, -test_camera->get_far())));
  218. }
  219. SUBCASE("Perspective projection") {
  220. test_camera->set_perspective(120.0f, 0.5f, 1000.0f);
  221. // Center.
  222. CHECK(test_camera->project_position(Vector2(200, 100), 0.5f).is_equal_approx(Vector3(0, 0, -0.5f)));
  223. CHECK(test_camera->project_position(Vector2(200, 100), 100.0f).is_equal_approx(Vector3(0, 0, -100.0f)));
  224. CHECK(test_camera->project_position(Vector2(200, 100), test_camera->get_far()).is_equal_approx(Vector3(0, 0, -1.0f) * test_camera->get_far()));
  225. // 3/4th way to Top left.
  226. CHECK(test_camera->project_position(Vector2(100, 50), 0.5f).is_equal_approx(Vector3(-SQRT3 * 0.5f, SQRT3 * 0.25f, -0.5f)));
  227. CHECK(test_camera->project_position(Vector2(100, 50), 1.0f).is_equal_approx(Vector3(-SQRT3, SQRT3 * 0.5f, -1.0f)));
  228. CHECK(test_camera->project_position(Vector2(100, 50), test_camera->get_near()).is_equal_approx(Vector3(-SQRT3, SQRT3 * 0.5f, -1.0f) * test_camera->get_near()));
  229. // 3/4th way to Bottom right.
  230. CHECK(test_camera->project_position(Vector2(300, 150), 0.5f).is_equal_approx(Vector3(SQRT3 * 0.5f, -SQRT3 * 0.25f, -0.5f)));
  231. CHECK(test_camera->project_position(Vector2(300, 150), 1.0f).is_equal_approx(Vector3(SQRT3, -SQRT3 * 0.5f, -1.0f)));
  232. CHECK(test_camera->project_position(Vector2(300, 150), test_camera->get_far()).is_equal_approx(Vector3(SQRT3, -SQRT3 * 0.5f, -1.0f) * test_camera->get_far()));
  233. }
  234. }
  235. // Uses cases that are the inverse of the above sub-case.
  236. SUBCASE("unproject_position") {
  237. SUBCASE("Orthogonal projection") {
  238. test_camera->set_orthogonal(5.0f, 0.5f, 1000.0f);
  239. // Center
  240. CHECK(test_camera->unproject_position(Vector3(0, 0, -0.5f)).is_equal_approx(Vector2(200, 100)));
  241. // Top left
  242. CHECK(test_camera->unproject_position(Vector3(-5.0f, 2.5f, -1.5f)).is_equal_approx(Vector2(0, 0)));
  243. // Bottom right
  244. CHECK(test_camera->unproject_position(Vector3(5.0f, -2.5f, -5.0f)).is_equal_approx(Vector2(400, 200)));
  245. }
  246. SUBCASE("Perspective projection") {
  247. test_camera->set_perspective(120.0f, 0.5f, 1000.0f);
  248. // Center.
  249. CHECK(test_camera->unproject_position(Vector3(0, 0, -0.5f)).is_equal_approx(Vector2(200, 100)));
  250. CHECK(test_camera->unproject_position(Vector3(0, 0, -100.0f)).is_equal_approx(Vector2(200, 100)));
  251. // 3/4th way to Top left.
  252. WARN(test_camera->unproject_position(Vector3(-SQRT3 * 0.5f, SQRT3 * 0.25f, -0.5f)).is_equal_approx(Vector2(100, 50)));
  253. WARN(test_camera->unproject_position(Vector3(-SQRT3, SQRT3 * 0.5f, -1.0f)).is_equal_approx(Vector2(100, 50)));
  254. // 3/4th way to Bottom right.
  255. CHECK(test_camera->unproject_position(Vector3(SQRT3 * 0.5f, -SQRT3 * 0.25f, -0.5f)).is_equal_approx(Vector2(300, 150)));
  256. CHECK(test_camera->unproject_position(Vector3(SQRT3, -SQRT3 * 0.5f, -1.0f)).is_equal_approx(Vector2(300, 150)));
  257. }
  258. }
  259. memdelete(test_camera);
  260. memdelete(mock_viewport);
  261. }
  262. TEST_CASE("[SceneTree][Camera3D] Project ray") {
  263. // Cameras need a viewport to know how to compute their frustums, so we make a fake one here.
  264. Camera3D *test_camera = memnew(Camera3D);
  265. SubViewport *mock_viewport = memnew(SubViewport);
  266. // 4:2.
  267. mock_viewport->set_size(Vector2(400, 200));
  268. SceneTree::get_singleton()->get_root()->add_child(mock_viewport);
  269. mock_viewport->add_child(test_camera);
  270. test_camera->set_global_position(Vector3(0, 0, 0));
  271. test_camera->set_global_rotation(Vector3(0, 0, 0));
  272. test_camera->set_keep_aspect_mode(Camera3D::KeepAspect::KEEP_HEIGHT);
  273. SUBCASE("project_ray_origin") {
  274. SUBCASE("Orthogonal projection") {
  275. test_camera->set_orthogonal(5.0f, 0.5f, 1000.0f);
  276. // Center.
  277. CHECK(test_camera->project_ray_origin(Vector2(200, 100)).is_equal_approx(Vector3(0, 0, -0.5f)));
  278. // Top left.
  279. CHECK(test_camera->project_ray_origin(Vector2(0, 0)).is_equal_approx(Vector3(-5.0f, 2.5f, -0.5f)));
  280. // Bottom right.
  281. CHECK(test_camera->project_ray_origin(Vector2(400, 200)).is_equal_approx(Vector3(5.0f, -2.5f, -0.5f)));
  282. }
  283. SUBCASE("Perspective projection") {
  284. test_camera->set_perspective(120.0f, 0.5f, 1000.0f);
  285. // Center.
  286. CHECK(test_camera->project_ray_origin(Vector2(200, 100)).is_equal_approx(Vector3(0, 0, 0)));
  287. // Top left.
  288. CHECK(test_camera->project_ray_origin(Vector2(0, 0)).is_equal_approx(Vector3(0, 0, 0)));
  289. // Bottom right.
  290. CHECK(test_camera->project_ray_origin(Vector2(400, 200)).is_equal_approx(Vector3(0, 0, 0)));
  291. }
  292. }
  293. SUBCASE("project_ray_normal") {
  294. SUBCASE("Orthogonal projection") {
  295. test_camera->set_orthogonal(5.0f, 0.5f, 1000.0f);
  296. // Center.
  297. CHECK(test_camera->project_ray_normal(Vector2(200, 100)).is_equal_approx(Vector3(0, 0, -1)));
  298. // Top left.
  299. CHECK(test_camera->project_ray_normal(Vector2(0, 0)).is_equal_approx(Vector3(0, 0, -1)));
  300. // Bottom right.
  301. CHECK(test_camera->project_ray_normal(Vector2(400, 200)).is_equal_approx(Vector3(0, 0, -1)));
  302. }
  303. SUBCASE("Perspective projection") {
  304. test_camera->set_perspective(120.0f, 0.5f, 1000.0f);
  305. // Center.
  306. CHECK(test_camera->project_ray_normal(Vector2(200, 100)).is_equal_approx(Vector3(0, 0, -1)));
  307. // Top left.
  308. CHECK(test_camera->project_ray_normal(Vector2(0, 0)).is_equal_approx(Vector3(-SQRT3, SQRT3 / 2, -0.5f).normalized()));
  309. // Bottom right.
  310. CHECK(test_camera->project_ray_normal(Vector2(400, 200)).is_equal_approx(Vector3(SQRT3, -SQRT3 / 2, -0.5f).normalized()));
  311. }
  312. }
  313. SUBCASE("project_local_ray_normal") {
  314. test_camera->set_rotation_degrees(Vector3(60, 60, 60));
  315. SUBCASE("Orthogonal projection") {
  316. test_camera->set_orthogonal(5.0f, 0.5f, 1000.0f);
  317. // Center.
  318. CHECK(test_camera->project_local_ray_normal(Vector2(200, 100)).is_equal_approx(Vector3(0, 0, -1)));
  319. // Top left.
  320. CHECK(test_camera->project_local_ray_normal(Vector2(0, 0)).is_equal_approx(Vector3(0, 0, -1)));
  321. // Bottom right.
  322. CHECK(test_camera->project_local_ray_normal(Vector2(400, 200)).is_equal_approx(Vector3(0, 0, -1)));
  323. }
  324. SUBCASE("Perspective projection") {
  325. test_camera->set_perspective(120.0f, 0.5f, 1000.0f);
  326. // Center.
  327. CHECK(test_camera->project_local_ray_normal(Vector2(200, 100)).is_equal_approx(Vector3(0, 0, -1)));
  328. // Top left.
  329. CHECK(test_camera->project_local_ray_normal(Vector2(0, 0)).is_equal_approx(Vector3(-SQRT3, SQRT3 / 2, -0.5f).normalized()));
  330. // Bottom right.
  331. CHECK(test_camera->project_local_ray_normal(Vector2(400, 200)).is_equal_approx(Vector3(SQRT3, -SQRT3 / 2, -0.5f).normalized()));
  332. }
  333. }
  334. memdelete(test_camera);
  335. memdelete(mock_viewport);
  336. }
  337. #undef SQRT3
  338. #endif // TEST_CAMERA_3D_H