From 5d3dfda0ead8aaef8f0fcf66e7c89ad567665da3 Mon Sep 17 00:00:00 2001 From: ahcorde Date: Tue, 20 Jul 2021 23:02:56 +0200 Subject: [PATCH] Fixed screento functions names Signed-off-by: ahcorde --- include/ignition/rendering/Utils.hh | 6 +++--- src/Utils.cc | 8 ++++---- src/Utils_TEST.cc | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/ignition/rendering/Utils.hh b/include/ignition/rendering/Utils.hh index d34d1b1b5..7c1c15e35 100644 --- a/include/ignition/rendering/Utils.hh +++ b/include/ignition/rendering/Utils.hh @@ -43,7 +43,7 @@ namespace ignition /// \param[in] _maxDistance maximum distance to check the collision /// \return 3D coordinates of a point in the 3D scene. IGNITION_RENDERING_VISIBLE - math::Vector3d ScreenToScene( + math::Vector3d screenToScene( const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, @@ -58,7 +58,7 @@ namespace ignition /// \param[in] _maxDistance maximum distance to check the collision /// \return 3D coordinates of a point in the 3D scene. IGNITION_RENDERING_VISIBLE - math::Vector3d ScreenToScene( + math::Vector3d screenToScene( const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, @@ -73,7 +73,7 @@ namespace ignition /// \param[in] _offset Offset along the plane normal /// \return 3D coordinates of a point in the 3D scene. IGNITION_RENDERING_VISIBLE - math::Vector3d ScreenToPlane( + math::Vector3d screenToPlane( const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, diff --git a/src/Utils.cc b/src/Utils.cc index 094f48568..8bd576ddd 100644 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -35,7 +35,7 @@ namespace rendering inline namespace IGNITION_RENDERING_VERSION_NAMESPACE { // ///////////////////////////////////////////////// -math::Vector3d ScreenToScene( +math::Vector3d screenToScene( const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, @@ -63,18 +63,18 @@ math::Vector3d ScreenToScene( } ///////////////////////////////////////////////// -math::Vector3d ScreenToScene( +math::Vector3d screenToScene( const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, float _maxDistance) { RayQueryResult rayResult; - return ScreenToScene(_screenPos, _camera, _rayQuery, rayResult, _maxDistance); + return screenToScene(_screenPos, _camera, _rayQuery, rayResult, _maxDistance); } ///////////////////////////////////////////////// -math::Vector3d ScreenToPlane( +math::Vector3d screenToPlane( const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, diff --git a/src/Utils_TEST.cc b/src/Utils_TEST.cc index 17f00314a..b88785969 100644 --- a/src/Utils_TEST.cc +++ b/src/Utils_TEST.cc @@ -71,23 +71,23 @@ void UtilTest::ClickToScene(const std::string &_renderEngine) RayQueryPtr rayQuery = scene->CreateRayQuery(); EXPECT_TRUE(rayQuery != nullptr); - // ScreenToPlane - math::Vector3d result = ScreenToPlane(centerClick, camera, rayQuery); + // screenToPlane + math::Vector3d result = screenToPlane(centerClick, camera, rayQuery); EXPECT_NEAR(0.0, result.Z(), 1e-10); EXPECT_NEAR(0.0, result.X(), 2e-6); EXPECT_NEAR(0.0, result.Y(), 2e-6); // call with non-zero plane offset - result = ScreenToPlane(centerClick, camera, rayQuery, 5.0); + result = screenToPlane(centerClick, camera, rayQuery, 5.0); EXPECT_NEAR(5.0, result.Z(), 1e-10); EXPECT_NEAR(0.0, result.X(), 2e-6); EXPECT_NEAR(0.0, result.Y(), 2e-6); - // ScreenToScene + // screenToScene // API without RayQueryResult and default max distance - result = ScreenToScene(centerClick, camera, rayQuery); + result = screenToScene(centerClick, camera, rayQuery); // No objects currently in the scene, so return a point max distance in // front of camera @@ -98,7 +98,7 @@ void UtilTest::ClickToScene(const std::string &_renderEngine) // Try with different max distance RayQueryResult rayResult; - result = ScreenToScene(centerClick, camera, rayQuery, rayResult, 20.0); + result = screenToScene(centerClick, camera, rayQuery, rayResult, 20.0); EXPECT_NEAR(-5.0 - camera->NearClipPlane(), result.Z(), 4e-6); EXPECT_NEAR(0.0, result.X(), 4e-6); @@ -118,7 +118,7 @@ void UtilTest::ClickToScene(const std::string &_renderEngine) root->AddChild(box); // API without RayQueryResult and default max distance - result = ScreenToScene(centerClick, camera, rayQuery, rayResult); + result = screenToScene(centerClick, camera, rayQuery, rayResult); EXPECT_NEAR(0.5, result.Z(), 1e-10); EXPECT_NEAR(0.0, result.X(), 2e-6); @@ -127,7 +127,7 @@ void UtilTest::ClickToScene(const std::string &_renderEngine) EXPECT_NEAR(14.5 - camera->NearClipPlane(), rayResult.distance, 4e-6); EXPECT_EQ(box->Id(), rayResult.objectId); - result = ScreenToScene(centerClick, camera, rayQuery, rayResult, 20.0); + result = screenToScene(centerClick, camera, rayQuery, rayResult, 20.0); EXPECT_NEAR(0.5, result.Z(), 1e-10); EXPECT_NEAR(0.0, result.X(), 2e-6); @@ -140,7 +140,7 @@ void UtilTest::ClickToScene(const std::string &_renderEngine) camera->SetLocalPosition(0.0, 0.0, 7.0); camera->SetLocalRotation(0.0, IGN_PI / 2, 0.0); - result = ScreenToScene(centerClick, camera, rayQuery, rayResult); + result = screenToScene(centerClick, camera, rayQuery, rayResult); EXPECT_NEAR(0.5, result.Z(), 1e-10); EXPECT_NEAR(0.0, result.X(), 2e-6);