From 87b30ad6e18213c24ff01f6322945388cb59320a Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Tue, 22 Jun 2021 17:26:50 -0700 Subject: [PATCH 01/12] =?UTF-8?q?=F0=9F=8E=88=205.1.0=20(#351)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Louise Poubel --- CMakeLists.txt | 2 +- Changelog.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09fb7c83e..a4f7c85f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) #============================================================================ # Initialize the project #============================================================================ -project(ignition-rendering5 VERSION 5.0.0) +project(ignition-rendering5 VERSION 5.1.0) #============================================================================ # Find ignition-cmake diff --git a/Changelog.md b/Changelog.md index e4c58f116..3711be38c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,89 @@ ### Ignition Rendering 5.X.X (20XX-XX-XX) +### Ignition Rendering 5.1.0 (2021-06-22) + +1. add ifdef for apple in integration test + * [Pull request #349](https://github.com/ignitionrobotics/ign-rendering/pull/349) + +1. Update light map tutorial + * [Pull request #346](https://github.com/ignitionrobotics/ign-rendering/pull/346) + +1. relax gaussian test tolerance + * [Pull request #344](https://github.com/ignitionrobotics/ign-rendering/pull/344) + +1. Fix custom shaders uniforms ign version number + * [Pull request #343](https://github.com/ignitionrobotics/ign-rendering/pull/343) + +1. recreate node only when needed + * [Pull request #342](https://github.com/ignitionrobotics/ign-rendering/pull/342) + +1. Backport memory fixes found by ASAN + * [Pull request #340](https://github.com/ignitionrobotics/ign-rendering/pull/340) + +1. Fix FSAA in UI and lower VRAM consumption + * [Pull request #313](https://github.com/ignitionrobotics/ign-rendering/pull/313) + +1. Fix depth alpha + * [Pull request #316](https://github.com/ignitionrobotics/ign-rendering/pull/316) + +1. Fix floating point precision bug handling alpha channel (#332) + * [Pull request #333](https://github.com/ignitionrobotics/ign-rendering/pull/333) + +1. Fix heap overflow when reading + * [Pull request #337](https://github.com/ignitionrobotics/ign-rendering/pull/337) + +1. Fix new [] / delete mismatch + * [Pull request #338](https://github.com/ignitionrobotics/ign-rendering/pull/338) + +1. Test re-enabling depth camera integration test on mac + * [Pull request #335](https://github.com/ignitionrobotics/ign-rendering/pull/335) + +1. Include MoveTo Helper class to ign-rendering + * [Pull request #311](https://github.com/ignitionrobotics/ign-rendering/pull/311) + +1. Remove `tools/code_check` and update codecov + * [Pull request #321](https://github.com/ignitionrobotics/ign-rendering/pull/321) + +1. [OGRE 1.x] Uniform buffer shader support + * [Pull request #294](https://github.com/ignitionrobotics/ign-rendering/pull/294) + +1. Helper function to get a scene + * [Pull request #320](https://github.com/ignitionrobotics/ign-rendering/pull/320) + +1. fix capsule mouse picking + * [Pull request #319](https://github.com/ignitionrobotics/ign-rendering/pull/319) + +1. Fix depth alpha + * [Pull request #316](https://github.com/ignitionrobotics/ign-rendering/pull/316) + +1. Add shadows to Ogre2DepthCamera without crashing + * [Pull request #303](https://github.com/ignitionrobotics/ign-rendering/pull/303) + +1. Reduce lidar data discretization + * [Pull request #296](https://github.com/ignitionrobotics/ign-rendering/pull/296) + +1. update light visual size + * [Pull request #306](https://github.com/ignitionrobotics/ign-rendering/pull/306) + +1. Improve build times by reducing included headers + * [Pull request #299](https://github.com/ignitionrobotics/ign-rendering/pull/299) + +1. Add light map tutorial + * [Pull request #302](https://github.com/ignitionrobotics/ign-rendering/pull/302) + +1. Prevent console warnings when multiple texture coordinates are present + * [Pull request #301](https://github.com/ignitionrobotics/ign-rendering/pull/301) + +1. Fix gazebo scene viewer build + * [Pull request #289](https://github.com/ignitionrobotics/ign-rendering/pull/289) + +1. Silence noisy sky error + * [Pull request #282](https://github.com/ignitionrobotics/ign-rendering/pull/282) + +1. Added command line argument to pick version of Ogre + * [Pull request #277](https://github.com/ignitionrobotics/ign-rendering/pull/277) + ### Ignition Rendering 5.0.0 (2021-03-30) 1. Add ogre2 skybox support From 44a19485aa32f48fd116ad6b5e938996eb5fbd90 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Fri, 16 Jul 2021 12:10:33 -0700 Subject: [PATCH 02/12] More nullptr checking on Node classes (#364) Signed-off-by: Louise Poubel --- ogre/src/OgreNode.cc | 61 +++++++++++++++++++++++++++++++++++++++--- ogre2/src/Ogre2Node.cc | 57 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 110 insertions(+), 8 deletions(-) diff --git a/ogre/src/OgreNode.cc b/ogre/src/OgreNode.cc index 2a3196549..f96024c51 100644 --- a/ogre/src/OgreNode.cc +++ b/ogre/src/OgreNode.cc @@ -58,8 +58,13 @@ Ogre::SceneNode *OgreNode::Node() const void OgreNode::Destroy() { BaseNode::Destroy(); - Ogre::SceneManager *ogreSceneManager = this->scene->OgreSceneManager(); - ogreSceneManager->destroySceneNode(this->ogreNode); + + if (nullptr != this->scene) + { + Ogre::SceneManager *ogreSceneManager = this->scene->OgreSceneManager(); + if (nullptr != ogreSceneManager) + ogreSceneManager->destroySceneNode(this->ogreNode); + } this->ogreNode = nullptr; } @@ -82,24 +87,36 @@ void OgreNode::SetRawLocalPose(const math::Pose3d &_Pose3d) ////////////////////////////////////////////////// math::Vector3d OgreNode::RawLocalPosition() const { + if (nullptr == this->ogreNode) + return math::Vector3d(); + return OgreConversions::Convert(this->ogreNode->getPosition()); } ////////////////////////////////////////////////// void OgreNode::SetRawLocalPosition(const math::Vector3d &_position) { + if (nullptr == this->ogreNode) + return; + this->ogreNode->setPosition(OgreConversions::Convert(_position)); } ////////////////////////////////////////////////// math::Quaterniond OgreNode::RawLocalRotation() const { + if (nullptr == this->ogreNode) + return math::Quaterniond(); + return OgreConversions::Convert(this->ogreNode->getOrientation()); } ////////////////////////////////////////////////// void OgreNode::SetRawLocalRotation(const math::Quaterniond &_rotation) { + if (nullptr == this->ogreNode) + return; + this->ogreNode->setOrientation(OgreConversions::Convert(_rotation)); } @@ -117,12 +134,29 @@ void OgreNode::Load() ////////////////////////////////////////////////// void OgreNode::Init() { - Ogre::SceneManager *sceneManager; - sceneManager = this->scene->OgreSceneManager(); + if (nullptr == this->scene) + { + ignerr << "Failed to initialize node: scene is NULL" << std::endl; + return; + } + + auto sceneManager = this->scene->OgreSceneManager(); + if (nullptr == sceneManager) + { + ignerr << "Failed to initialize node: scene manager is NULL" << std::endl; + return; + } + this->ogreNode = sceneManager->createSceneNode(this->name); + if (nullptr == this->ogreNode) + { + ignerr << "Failed to create Ogre node" << std::endl; + return; + } this->ogreNode->setInheritScale(true); this->children = OgreNodeStorePtr(new OgreNodeStore); } + ////////////////////////////////////////////////// NodeStorePtr OgreNode::Children() const { @@ -132,6 +166,9 @@ NodeStorePtr OgreNode::Children() const ////////////////////////////////////////////////// bool OgreNode::AttachChild(NodePtr _child) { + if (nullptr == this->ogreNode) + return false; + OgreNodePtr derived = std::dynamic_pointer_cast(_child); if (!derived) @@ -149,6 +186,9 @@ bool OgreNode::AttachChild(NodePtr _child) ////////////////////////////////////////////////// bool OgreNode::DetachChild(NodePtr _child) { + if (nullptr == this->ogreNode) + return false; + OgreNodePtr derived = std::dynamic_pointer_cast(_child); if (!derived) @@ -159,6 +199,7 @@ bool OgreNode::DetachChild(NodePtr _child) } this->ogreNode->removeChild(derived->Node()); + return true; } @@ -172,24 +213,36 @@ OgreNodePtr OgreNode::SharedThis() ////////////////////////////////////////////////// math::Vector3d OgreNode::LocalScale() const { + if (nullptr == this->ogreNode) + return math::Vector3d(); + return OgreConversions::Convert(this->ogreNode->getScale()); } ////////////////////////////////////////////////// bool OgreNode::InheritScale() const { + if (nullptr == this->ogreNode) + return false; + return this->ogreNode->getInheritScale(); } ////////////////////////////////////////////////// void OgreNode::SetInheritScale(bool _inherit) { + if (nullptr == this->ogreNode) + return; + this->ogreNode->setInheritScale(_inherit); } ////////////////////////////////////////////////// void OgreNode::SetLocalScaleImpl(const math::Vector3d &_scale) { + if (nullptr == this->ogreNode) + return; + this->ogreNode->setScale(OgreConversions::Convert(_scale)); } diff --git a/ogre2/src/Ogre2Node.cc b/ogre2/src/Ogre2Node.cc index 63a43a936..88adc9fdc 100644 --- a/ogre2/src/Ogre2Node.cc +++ b/ogre2/src/Ogre2Node.cc @@ -65,8 +65,13 @@ Ogre::SceneNode *Ogre2Node::Node() const void Ogre2Node::Destroy() { BaseNode::Destroy(); - Ogre::SceneManager *ogreSceneManager = this->scene->OgreSceneManager(); - ogreSceneManager->destroySceneNode(this->ogreNode); + + if (nullptr != this->scene) + { + Ogre::SceneManager *ogreSceneManager = this->scene->OgreSceneManager(); + if (nullptr != ogreSceneManager) + ogreSceneManager->destroySceneNode(this->ogreNode); + } this->ogreNode = nullptr; } @@ -89,24 +94,36 @@ void Ogre2Node::SetRawLocalPose(const math::Pose3d &_Pose3d) ////////////////////////////////////////////////// math::Vector3d Ogre2Node::RawLocalPosition() const { + if (nullptr == this->ogreNode) + return math::Vector3d(); + return Ogre2Conversions::Convert(this->ogreNode->getPosition()); } ////////////////////////////////////////////////// void Ogre2Node::SetRawLocalPosition(const math::Vector3d &_position) { + if (nullptr == this->ogreNode) + return; + this->ogreNode->setPosition(Ogre2Conversions::Convert(_position)); } ////////////////////////////////////////////////// math::Quaterniond Ogre2Node::RawLocalRotation() const { + if (nullptr == this->ogreNode) + return math::Quaterniond(); + return Ogre2Conversions::Convert(this->ogreNode->getOrientation()); } ////////////////////////////////////////////////// void Ogre2Node::SetRawLocalRotation(const math::Quaterniond &_rotation) { + if (nullptr == this->ogreNode) + return; + this->ogreNode->setOrientation(Ogre2Conversions::Convert(_rotation)); } @@ -124,9 +141,25 @@ void Ogre2Node::Load() ////////////////////////////////////////////////// void Ogre2Node::Init() { - Ogre::SceneManager *sceneManager; - sceneManager = this->scene->OgreSceneManager(); + if (nullptr == this->scene) + { + ignerr << "Failed to initialize node: scene is NULL" << std::endl; + return; + } + + auto sceneManager = this->scene->OgreSceneManager(); + if (nullptr == sceneManager) + { + ignerr << "Failed to initialize node: scene manager is NULL" << std::endl; + return; + } + this->ogreNode = sceneManager->createSceneNode(); + if (nullptr == this->ogreNode) + { + ignerr << "Failed to create Ogre node" << std::endl; + return; + } this->ogreNode->setInheritScale(true); this->children = Ogre2NodeStorePtr(new Ogre2NodeStore); } @@ -140,6 +173,9 @@ NodeStorePtr Ogre2Node::Children() const ////////////////////////////////////////////////// bool Ogre2Node::AttachChild(NodePtr _child) { + if (nullptr == this->ogreNode) + return false; + Ogre2NodePtr derived = std::dynamic_pointer_cast(_child); if (!derived) @@ -184,6 +220,7 @@ bool Ogre2Node::DetachChild(NodePtr _child) } this->ogreNode->removeChild(derived->Node()); + return true; } @@ -197,24 +234,36 @@ Ogre2NodePtr Ogre2Node::SharedThis() ////////////////////////////////////////////////// math::Vector3d Ogre2Node::LocalScale() const { + if (nullptr == this->ogreNode) + return math::Vector3d(); + return Ogre2Conversions::Convert(this->ogreNode->getScale()); } ////////////////////////////////////////////////// bool Ogre2Node::InheritScale() const { + if (nullptr == this->ogreNode) + return false; + return this->ogreNode->getInheritScale(); } ////////////////////////////////////////////////// void Ogre2Node::SetInheritScale(bool _inherit) { + if (nullptr == this->ogreNode) + return; + this->ogreNode->setInheritScale(_inherit); } ////////////////////////////////////////////////// void Ogre2Node::SetLocalScaleImpl(const math::Vector3d &_scale) { + if (nullptr == this->ogreNode) + return; + this->ogreNode->setScale(Ogre2Conversions::Convert(_scale)); } From dbbc3d70a424b15d05bb11d9c2f58280ea96d3fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Tue, 20 Jul 2021 22:57:13 +0200 Subject: [PATCH 03/12] Moved ScreenToPlane and ScreenToScene from ign-gui to ign-rendering (#363) * Moved ScreenToPlane and ScreenToScene from ign-gui to ign-rendering Signed-off-by: ahcorde * added plane offset Signed-off-by: ahcorde * Added new signature Signed-off-by: ahcorde * Fix doxygen Signed-off-by: Steven Peters * Add const version of RayQueryResult bool operator Signed-off-by: Steven Peters * Improvements to Utils_TEST * Use tighter tolerances in expectations * Use IGN_PI/2 instead of 1.57 to tighten X tolerance * Clarify comments about max distance, which is only used when the ray does not intersect an object * Add expectations on RayQueryResult values * Add test of API without RayQueryResult Signed-off-by: Steven Peters * Test ScreenToPlane with non-zero offset Signed-off-by: Steven Peters Co-authored-by: Steven Peters --- include/ignition/rendering/RayQuery.hh | 6 + include/ignition/rendering/Utils.hh | 49 ++++++++ src/Utils.cc | 71 +++++++++++ src/Utils_TEST.cc | 167 +++++++++++++++++++++++++ 4 files changed, 293 insertions(+) create mode 100644 src/Utils_TEST.cc diff --git a/include/ignition/rendering/RayQuery.hh b/include/ignition/rendering/RayQuery.hh index b3130e46d..772177808 100644 --- a/include/ignition/rendering/RayQuery.hh +++ b/include/ignition/rendering/RayQuery.hh @@ -45,6 +45,12 @@ namespace ignition /// \brief Intersected object id public: unsigned int objectId = 0; + /// \brief Returns false if result is not valid + public: operator bool() const + { + return distance > 0; + } + /// \brief Returns false if result is not valid public: operator bool() { diff --git a/include/ignition/rendering/Utils.hh b/include/ignition/rendering/Utils.hh index 79fefab45..d34d1b1b5 100644 --- a/include/ignition/rendering/Utils.hh +++ b/include/ignition/rendering/Utils.hh @@ -18,9 +18,14 @@ #define IGNITION_RENDERING_UTILS_HH_ #include +#include +#include +#include "ignition/rendering/Camera.hh" #include "ignition/rendering/config.hh" #include "ignition/rendering/Export.hh" +#include "ignition/rendering/RayQuery.hh" + namespace ignition { @@ -30,6 +35,50 @@ namespace ignition // Inline bracket to help doxygen filtering. inline namespace IGNITION_RENDERING_VERSION_NAMESPACE { // + /// \brief Retrieve the first point on a surface in the 3D scene hit by a + /// ray cast from the given 2D screen coordinates. + /// \param[in] _screenPos 2D coordinates on the screen, in pixels. + /// \param[in] _camera User camera + /// \param[in] _rayQuery Ray query for mouse clicks + /// \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( + const math::Vector2i &_screenPos, + const CameraPtr &_camera, + const RayQueryPtr &_rayQuery, + float maxDistance = 10.0); + + /// \brief Retrieve the first point on a surface in the 3D scene hit by a + /// ray cast from the given 2D screen coordinates. + /// \param[in] _screenPos 2D coordinates on the screen, in pixels. + /// \param[in] _camera User camera + /// \param[in] _rayQuery Ray query for mouse clicks + /// \param[inout] _rayResult Ray query result + /// \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( + const math::Vector2i &_screenPos, + const CameraPtr &_camera, + const RayQueryPtr &_rayQuery, + RayQueryResult &_rayResult, + float maxDistance = 10.0); + + /// \brief Retrieve the point on a plane at z = 0 in the 3D scene hit by a + /// ray cast from the given 2D screen coordinates. + /// \param[in] _screenPos 2D coordinates on the screen, in pixels. + /// \param[in] _camera User camera + /// \param[in] _rayQuery Ray query for mouse clicks + /// \param[in] _offset Offset along the plane normal + /// \return 3D coordinates of a point in the 3D scene. + IGNITION_RENDERING_VISIBLE + math::Vector3d ScreenToPlane( + const math::Vector2i &_screenPos, + const CameraPtr &_camera, + const RayQueryPtr &_rayQuery, + const float offset = 0.0); + /// \brief Get the screen scaling factor. /// \return The screen scaling factor. IGNITION_RENDERING_VISIBLE diff --git a/src/Utils.cc b/src/Utils.cc index 20ed08285..094f48568 100644 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -20,6 +20,12 @@ #include #endif +#include "ignition/math/Plane.hh" +#include "ignition/math/Vector2.hh" +#include "ignition/math/Vector3.hh" + +#include "ignition/rendering/Camera.hh" +#include "ignition/rendering/RayQuery.hh" #include "ignition/rendering/Utils.hh" namespace ignition @@ -28,6 +34,71 @@ namespace rendering { inline namespace IGNITION_RENDERING_VERSION_NAMESPACE { // +///////////////////////////////////////////////// +math::Vector3d ScreenToScene( + const math::Vector2i &_screenPos, + const CameraPtr &_camera, + const RayQueryPtr &_rayQuery, + RayQueryResult &_rayResult, + float _maxDistance) +{ + // Normalize point on the image + double width = _camera->ImageWidth(); + double height = _camera->ImageHeight(); + + double nx = 2.0 * _screenPos.X() / width - 1.0; + double ny = 1.0 - 2.0 * _screenPos.Y() / height; + + // Make a ray query + _rayQuery->SetFromCamera( + _camera, math::Vector2d(nx, ny)); + + _rayResult = _rayQuery->ClosestPoint(); + if (_rayResult) + return _rayResult.point; + + // Set point to be maxDistance m away if no intersection found + return _rayQuery->Origin() + + _rayQuery->Direction() * _maxDistance; +} + +///////////////////////////////////////////////// +math::Vector3d ScreenToScene( + const math::Vector2i &_screenPos, + const CameraPtr &_camera, + const RayQueryPtr &_rayQuery, + float _maxDistance) +{ + RayQueryResult rayResult; + return ScreenToScene(_screenPos, _camera, _rayQuery, rayResult, _maxDistance); +} + +///////////////////////////////////////////////// +math::Vector3d ScreenToPlane( + const math::Vector2i &_screenPos, + const CameraPtr &_camera, + const RayQueryPtr &_rayQuery, + const float offset) +{ + // Normalize point on the image + double width = _camera->ImageWidth(); + double height = _camera->ImageHeight(); + + double nx = 2.0 * _screenPos.X() / width - 1.0; + double ny = 1.0 - 2.0 * _screenPos.Y() / height; + + // Make a ray query + _rayQuery->SetFromCamera( + _camera, math::Vector2d(nx, ny)); + + ignition::math::Planed plane(ignition::math::Vector3d(0, 0, 1), offset); + + math::Vector3d origin = _rayQuery->Origin(); + math::Vector3d direction = _rayQuery->Direction(); + double distance = plane.Distance(origin, direction); + return origin + direction * distance; +} + ///////////////////////////////////////////////// float screenScalingFactor() { diff --git a/src/Utils_TEST.cc b/src/Utils_TEST.cc new file mode 100644 index 000000000..17f00314a --- /dev/null +++ b/src/Utils_TEST.cc @@ -0,0 +1,167 @@ +/* * Copyright (C) 2021 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +#include + +#include + +#include "ignition/rendering/Camera.hh" +#include "ignition/rendering/RayQuery.hh" +#include "ignition/rendering/RenderEngine.hh" +#include "ignition/rendering/RenderingIface.hh" +#include "ignition/rendering/Scene.hh" +#include "ignition/rendering/Utils.hh" +#include "ignition/rendering/Visual.hh" + +#include "test_config.h" // NOLINT(build/include) + +using namespace ignition; +using namespace rendering; + +class UtilTest : public testing::Test, + public testing::WithParamInterface +{ + // Documentation inherited + public: void SetUp() override + { + ignition::common::Console::SetVerbosity(4); + } + + public: void ClickToScene(const std::string &_renderEngine); +}; + +void UtilTest::ClickToScene(const std::string &_renderEngine) +{ + RenderEngine *engine = rendering::engine(_renderEngine); + if (!engine) + { + igndbg << "Engine '" << _renderEngine + << "' is not supported" << std::endl; + return; + } + ScenePtr scene = engine->CreateScene("scene"); + + CameraPtr camera(scene->CreateCamera()); + EXPECT_TRUE(camera != nullptr); + + camera->SetLocalPosition(0.0, 0.0, 15); + camera->SetLocalRotation(0.0, IGN_PI / 2, 0.0); + + unsigned int width = 640u; + unsigned int height = 480u; + camera->SetImageWidth(width); + camera->SetImageHeight(height); + + const int halfWidth = static_cast(width / 2); + const int halfHeight = static_cast(height / 2); + const ignition::math::Vector2i centerClick(halfWidth, halfHeight); + + RayQueryPtr rayQuery = scene->CreateRayQuery(); + EXPECT_TRUE(rayQuery != nullptr); + + // 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); + + 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 + // API without RayQueryResult and default max distance + result = ScreenToScene(centerClick, camera, rayQuery); + + // No objects currently in the scene, so return a point max distance in + // front of camera + // The default max distance is 10 meters away + EXPECT_NEAR(5.0 - camera->NearClipPlane(), result.Z(), 4e-6); + EXPECT_NEAR(0.0, result.X(), 2e-6); + EXPECT_NEAR(0.0, result.Y(), 2e-6); + + // Try with different max distance + RayQueryResult rayResult; + 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); + EXPECT_NEAR(0.0, result.Y(), 4e-6); + EXPECT_FALSE(rayResult); + EXPECT_EQ(0u, rayResult.objectId); + + VisualPtr root = scene->RootVisual(); + + // create box visual to collide with the ray + VisualPtr box = scene->CreateVisual(); + box->AddGeometry(scene->CreateBox()); + box->SetOrigin(0.0, 0.0, 0.0); + box->SetLocalPosition(0.0, 0.0, 0.0); + box->SetLocalRotation(0.0, 0.0, 0.0); + box->SetLocalScale(1.0, 1.0, 1.0); + root->AddChild(box); + + // API without RayQueryResult and default max distance + result = ScreenToScene(centerClick, camera, rayQuery, rayResult); + + EXPECT_NEAR(0.5, result.Z(), 1e-10); + EXPECT_NEAR(0.0, result.X(), 2e-6); + EXPECT_NEAR(0.0, result.Y(), 2e-6); + EXPECT_TRUE(rayResult); + EXPECT_NEAR(14.5 - camera->NearClipPlane(), rayResult.distance, 4e-6); + EXPECT_EQ(box->Id(), rayResult.objectId); + + result = ScreenToScene(centerClick, camera, rayQuery, rayResult, 20.0); + + EXPECT_NEAR(0.5, result.Z(), 1e-10); + EXPECT_NEAR(0.0, result.X(), 2e-6); + EXPECT_NEAR(0.0, result.Y(), 2e-6); + EXPECT_TRUE(rayResult); + EXPECT_NEAR(14.5 - camera->NearClipPlane(), rayResult.distance, 4e-6); + EXPECT_EQ(box->Id(), rayResult.objectId); + + // Move camera closer to box + camera->SetLocalPosition(0.0, 0.0, 7.0); + camera->SetLocalRotation(0.0, IGN_PI / 2, 0.0); + + result = ScreenToScene(centerClick, camera, rayQuery, rayResult); + + EXPECT_NEAR(0.5, result.Z(), 1e-10); + EXPECT_NEAR(0.0, result.X(), 2e-6); + EXPECT_NEAR(0.0, result.Y(), 2e-6); + EXPECT_TRUE(rayResult); + EXPECT_NEAR(6.5 - camera->NearClipPlane(), rayResult.distance, 4e-6); + EXPECT_EQ(box->Id(), rayResult.objectId); +} + +///////////////////////////////////////////////// +TEST_P(UtilTest, ClickToScene) +{ + ClickToScene(GetParam()); +} + +INSTANTIATE_TEST_CASE_P(ClickToScene, UtilTest, + RENDER_ENGINE_VALUES, + ignition::rendering::PrintToStringParam()); + +int main(int argc, char **argv) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} From 9341eb24f37a5c2b1ceb5c2dc07ab8473a2a0f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Wed, 21 Jul 2021 00:06:39 +0200 Subject: [PATCH 04/12] Fixed screento functions names (#368) 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); From f11d8d1689add10107cd5395450110a3c72bc757 Mon Sep 17 00:00:00 2001 From: Rhys Date: Thu, 12 Aug 2021 02:40:48 +0100 Subject: [PATCH 05/12] [macOS] support OpenGL < 4.2 in PBS shader (#377) - OpenGL < 4.2 does not support swizzling built in types (e.g. float). - Update the definition of @piece( maxR1F0 ) to work in OpenGL 4.1 Signed-off-by: Rhys Mainwaring --- ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl b/ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl index 2aba21aa7..9db4c8608 100644 --- a/ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl +++ b/ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl @@ -12,7 +12,7 @@ @property( !fresnel_scalar ) @piece( maxR1F0 )max( 1.0 - ROUGHNESS, @insertpiece( F0 ).x )@end @end @property( fresnel_scalar ) - @piece( maxR1F0 )max( (1.0 - ROUGHNESS).xxx, @insertpiece( F0 ).xyz )@end + @piece( maxR1F0 )max( (1.0 - vec3(ROUGHNESS, 0.0, 0.0)).xxx, @insertpiece( F0 ).xyz )@end @end //For mortals: From 4a9251c434c8b9541ab36daf126a40a2516d9f99 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Tue, 24 Aug 2021 10:57:28 -0700 Subject: [PATCH 06/12] =?UTF-8?q?=F0=9F=91=A9=E2=80=8D=F0=9F=8C=BE=20Remov?= =?UTF-8?q?e=20bitbucket-pipelines.yml=20(#385)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Louise Poubel --- bitbucket-pipelines.yml | 43 ----------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 bitbucket-pipelines.yml diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml deleted file mode 100644 index df611f271..000000000 --- a/bitbucket-pipelines.yml +++ /dev/null @@ -1,43 +0,0 @@ -image: ubuntu:bionic - -pipelines: - default: - - step: - script: # Modify the commands below to build your repository. - - apt update - - apt -y install wget lsb-release gnupg - - sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' - - wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add - - - apt-get update - - apt-get -y install - cmake pkg-config cppcheck libogre-1.9-dev libogre-2.1-dev libglew-dev libfreeimage-dev doxygen ruby-ronn freeglut3-dev libxmu-dev libxi-dev curl git g++-8 uuid-dev xvfb - - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8 - - gcc -v - - g++ -v - - gcov -v - # Dependency: Ignition packages - - apt-get -y install - libignition-cmake2-dev libignition-common3-dev libignition-math6-dev libignition-plugin-dev - # lcov - - git clone https://github.com/linux-test-project/lcov.git - - cd lcov - - make install - - cd .. - # Ignition rendering - - mkdir build - - cd build - - cmake .. -DCMAKE_BUILD_TYPE=coverage - - make -j4 - - make install - - make codecheck - # Run tests - # - Xvfb :1 -screen 0 1280x1024x24 & - # - DISPLAY=:1.0 make test - # - DISPLAY=:1.0 RENDER_ENGINE_VALUES=ogre2 MESA_GL_VERSION_OVERRIDE=3.3 make test - # Build an example - - cd ../examples/simple_demo - - mkdir build - - cd build - - cmake .. - - make -j4 - From 99c08c528f6799b77d9d6ad504b7e515e1227877 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Tue, 24 Aug 2021 20:14:02 +0200 Subject: [PATCH 07/12] Set OGRE minimal version to 1.8. Warn on versions not supported (ign-rendering3) (#376) * Set OGRE minimal version to 1.8. Warn on versions not supported. Flag USE_UNOFFICIAL_OGRE_VERSIONS to disable the warning for the experienced users. Signed-off-by: Jose Luis Rivero --- CMakeLists.txt | 26 +++++++++++++++++++++----- Changelog.md | 6 +++++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18c2c955b..c9c01cf54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ ign_configure_project(VERSION_SUFFIX) # Set project-specific options #============================================================================ -# ignition-rendering currently has no options that are unique to it +option(USE_UNOFFICAL_OGRE_VERSIONS "Accept unsupported Ogre versions in the build" OFF) #============================================================================ # Search for project-specific dependencies @@ -61,10 +61,26 @@ endif() # Find OGRE list(APPEND ign_ogre_components "RTShaderSystem" "Terrain" "Overlay") -ign_find_package(IgnOGRE VERSION 1.8.0 - COMPONENTS ${ign_ogre_components} - REQUIRED_BY ogre - PRIVATE_FOR ogre) +# Ogre versions greater than 1.9 are not officialy supported. +# Display a warning for the users on this setup unless they provide +# USE_UNOFFICAL_OGRE_VERSIONS flag +if (NOT USE_UNOFFICAL_OGRE_VERSIONS) + ign_find_package(IgnOGRE VERSION 1.10 + COMPONENTS ${ign_ogre_components}) + + if (OGRE_FOUND) + IGN_BUILD_WARNING("Ogre 1.x versions greater than 1.9 are not officially supported." + "The software might compile and even work but support from upstream" + "could be reduced to accepting patches for newer versions") + else() + # If ogre 1.10 or greater was not found, then proceed to look for 1.9.x + # versions which are offically supported + ign_find_package(IgnOGRE VERSION 1.9.0 + COMPONENTS ${ign_ogre_components} + REQUIRED_BY ogre + PRIVATE_FOR ogre) + endif() +endif() if (OGRE_FOUND) # find boost - mainly needed on macOS and also by the terrain component diff --git a/Changelog.md b/Changelog.md index f34ae20fb..00a2876aa 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,10 @@ ## Ignition Rendering -### Ignition Rendering 3.X.X (2021-XX-XX) +### Ignition Rendering 3.x.x (2021-XX-XX) + +1. CMake warning on Ogre versions that are not officially supported. + To disable the new warning, it is enough to enable the cmake option USE_UNOFFICAL_OGRE_VERSIONS + * [Pull request 376](https://github.com/ignitionrobotics/ign-rendering/pull/376) ### Ignition Rendering 3.5.0 (2021-05-25) From 08ee26c8458582de548561e2c75e78997697843a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Mon, 30 Aug 2021 23:36:59 +0200 Subject: [PATCH 08/12] Improved doxygen (#389) Signed-off-by: ahcorde --- .github/workflows/ci.yml | 1 + include/ignition/rendering/Camera.hh | 4 +- .../ignition/rendering/GaussianNoisePass.hh | 2 +- include/ignition/rendering/Geometry.hh | 4 +- include/ignition/rendering/GpuRays.hh | 2 +- include/ignition/rendering/Light.hh | 6 +- include/ignition/rendering/Marker.hh | 2 +- include/ignition/rendering/Material.hh | 28 ++-- include/ignition/rendering/Mesh.hh | 4 +- include/ignition/rendering/RayQuery.hh | 5 +- include/ignition/rendering/RenderEngine.hh | 2 +- include/ignition/rendering/RenderTypes.hh | 136 +++++++++--------- include/ignition/rendering/Scene.hh | 8 +- include/ignition/rendering/Storage.hh | 22 +-- include/ignition/rendering/Text.hh | 4 +- include/ignition/rendering/ThermalCamera.hh | 2 +- .../ignition/rendering/TransformController.hh | 3 +- include/ignition/rendering/TransformType.hh | 6 +- include/ignition/rendering/Utils.hh | 6 +- include/ignition/rendering/Visual.hh | 16 +-- .../ignition/rendering/base/BaseGeometry.hh | 8 +- .../rendering/base/BaseGizmoVisual.hh | 1 - include/ignition/rendering/base/BaseLight.hh | 10 ++ .../ignition/rendering/base/BaseMaterial.hh | 9 +- include/ignition/rendering/base/BaseMesh.hh | 5 +- include/ignition/rendering/base/BaseScene.hh | 17 ++- .../ignition/rendering/ogre/OgreCamera.hh | 13 +- .../rendering/ogre/OgreConversions.hh | 2 +- .../ignition/rendering/ogre/OgreMaterial.hh | 8 +- .../rendering/ogre/OgreRTShaderSystem.hh | 10 +- .../rendering/ogre/OgreRenderEngine.hh | 3 +- .../rendering/ogre/OgreSelectionBuffer.hh | 2 +- .../ignition/rendering/ogre2/Ogre2Camera.hh | 2 +- .../rendering/ogre2/Ogre2Conversions.hh | 2 +- .../ignition/rendering/ogre2/Ogre2Material.hh | 16 ++- .../ignition/rendering/ogre2/Ogre2Node.hh | 2 +- .../rendering/ogre2/Ogre2RenderEngine.hh | 3 +- .../rendering/ogre2/Ogre2SelectionBuffer.hh | 6 +- .../ignition/rendering/optix/OptixCamera.hh | 2 +- .../ignition/rendering/optix/OptixMaterial.hh | 4 +- 40 files changed, 214 insertions(+), 174 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36175c3a..53e67b817 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: uses: ignition-tooling/action-ignition-ci@bionic with: codecov-enabled: true + doxygen-enabled: true focal-ci: runs-on: ubuntu-latest name: Ubuntu Focal CI diff --git a/include/ignition/rendering/Camera.hh b/include/ignition/rendering/Camera.hh index d5e31ae16..a34cd28d1 100644 --- a/include/ignition/rendering/Camera.hh +++ b/include/ignition/rendering/Camera.hh @@ -81,8 +81,8 @@ namespace ignition public: virtual math::Angle HFOV() const = 0; /// \brief Set the camera's horizontal field-of-view - /// \param[in] _angle Desired horizontal field-of-view - public: virtual void SetHFOV(const math::Angle &_angle) = 0; + /// \param[in] _hfov Desired horizontal field-of-view + public: virtual void SetHFOV(const math::Angle &_hfov) = 0; /// \brief Get the camera's aspect ratio /// \return The camera's aspect ratio diff --git a/include/ignition/rendering/GaussianNoisePass.hh b/include/ignition/rendering/GaussianNoisePass.hh index d76218358..efb3cc7f8 100644 --- a/include/ignition/rendering/GaussianNoisePass.hh +++ b/include/ignition/rendering/GaussianNoisePass.hh @@ -58,7 +58,7 @@ namespace ignition public: virtual void SetMean(double _mean) = 0; /// \brief Set stddev. - /// \param[in] _stddev Standard deviation of Gaussian noise. + /// \param[in] _stdDev Standard deviation of Gaussian noise. public: virtual void SetStdDev(double _stdDev) = 0; /// \brief Set the mean of the bias value. Bias is computed based on diff --git a/include/ignition/rendering/Geometry.hh b/include/ignition/rendering/Geometry.hh index c0016c4cf..02037ebd7 100644 --- a/include/ignition/rendering/Geometry.hh +++ b/include/ignition/rendering/Geometry.hh @@ -55,13 +55,13 @@ namespace ignition /// \param[in] _name Name of registered Material /// \param[in] _unique True if the specified material should be cloned public: virtual void SetMaterial(const std::string &_name, - bool unique = true) = 0; + bool _unique = true) = 0; /// \brief Set the materials of this Geometry /// \param[in] _material New Material to be assigned /// \param[in] _unique True if the given material should be cloned public: virtual void SetMaterial(MaterialPtr _material, - bool unique = true) = 0; + bool _unique = true) = 0; /// \brief Get the material of this geometry /// \return Material used by this geometry diff --git a/include/ignition/rendering/GpuRays.hh b/include/ignition/rendering/GpuRays.hh index 2d7ffcb44..0d0e8f6dd 100644 --- a/include/ignition/rendering/GpuRays.hh +++ b/include/ignition/rendering/GpuRays.hh @@ -54,7 +54,7 @@ namespace ignition /// \brief Configure behaviour for data values outside of camera range /// \param[in] _clamp True to clamp data to camera clip distances, // false to leave data values as +/-inf when out of camera range - public: virtual void SetClamp(const bool _value) = 0; + public: virtual void SetClamp(const bool _clamp) = 0; /// \brief Get behaviour for data values outside of camera range /// \return True if data values are clampped to camera clip distances, diff --git a/include/ignition/rendering/Light.hh b/include/ignition/rendering/Light.hh index bb6d3f5a6..1cd0b943e 100644 --- a/include/ignition/rendering/Light.hh +++ b/include/ignition/rendering/Light.hh @@ -96,7 +96,7 @@ namespace ignition public: virtual double AttenuationRange() const = 0; /// \brief Set the attenuation range - /// \param[in] _value New attenuation range + /// \param[in] _range New attenuation range public: virtual void SetAttenuationRange(double _range) = 0; /// \brief Determine if this light cast shadows @@ -171,7 +171,7 @@ namespace ignition public: virtual void SetInnerAngle(double _radians) = 0; /// \brief Set the inner angle of the spotlight - /// \param[in] _radians New inner angle of the spotlight + /// \param[in] _angle New inner angle of the spotlight public: virtual void SetInnerAngle(const math::Angle &_angle) = 0; /// \brief Get the outer angle of the spotlight @@ -183,7 +183,7 @@ namespace ignition public: virtual void SetOuterAngle(double _radians) = 0; /// \brief Set the outer angle of the spotlight - /// \param[in] _radians New outer angle of the spotlight + /// \param[in] _angle New outer angle of the spotlight public: virtual void SetOuterAngle(const math::Angle &_angle) = 0; /// \brief Get the falloff of the spotlight diff --git a/include/ignition/rendering/Marker.hh b/include/ignition/rendering/Marker.hh index 93a639b67..ae42e3939 100644 --- a/include/ignition/rendering/Marker.hh +++ b/include/ignition/rendering/Marker.hh @@ -97,7 +97,7 @@ namespace ignition public: virtual int32_t Layer() const = 0; /// \brief Set the render type of this Marker - /// \param[in] The desired render type + /// \param[in] _markerType The desired render type public: virtual void SetType( const ignition::rendering::MarkerType _markerType) = 0; diff --git a/include/ignition/rendering/Material.hh b/include/ignition/rendering/Material.hh index 349f9650b..114dc6a08 100644 --- a/include/ignition/rendering/Material.hh +++ b/include/ignition/rendering/Material.hh @@ -201,8 +201,8 @@ namespace ignition public: virtual std::string Texture() const = 0; /// \brief Set the material texture - /// \param[in] _name URI of the new texture file - public: virtual void SetTexture(const std::string &_name) = 0; + /// \param[in] _texture URI of the new texture file + public: virtual void SetTexture(const std::string &_texture) = 0; /// \brief Removes any texture mapped to this material public: virtual void ClearTexture() = 0; @@ -216,8 +216,8 @@ namespace ignition public: virtual std::string NormalMap() const = 0; /// \brief Set the material normal map - /// \param[in] _name URI of the new normal map file - public: virtual void SetNormalMap(const std::string &_name) = 0; + /// \param[in] _normalMap URI of the new normal map file + public: virtual void SetNormalMap(const std::string &_normalMap) = 0; /// \brief Removes any normal map mapped to this material public: virtual void ClearNormalMap() = 0; @@ -231,8 +231,9 @@ namespace ignition public: virtual std::string RoughnessMap() const = 0; /// \brief Set the material roughness map - /// \param[in] _name URI of the new roughness map file - public: virtual void SetRoughnessMap(const std::string &_name) = 0; + /// \param[in] _roughnessMap URI of the new roughness map file + public: virtual void SetRoughnessMap( + const std::string &_roughnessMap) = 0; /// \brief Removes any roughness map mapped to this material public: virtual void ClearRoughnessMap() = 0; @@ -246,8 +247,9 @@ namespace ignition public: virtual std::string MetalnessMap() const = 0; /// \brief Set the material metalness map - /// \param[in] _name URI of the new metalness map file - public: virtual void SetMetalnessMap(const std::string &_name) = 0; + /// \param[in] _metalnessMap URI of the new metalness map file + public: virtual void SetMetalnessMap( + const std::string &_metalnessMap) = 0; /// \brief Removes any metalness map mapped to this material public: virtual void ClearMetalnessMap() = 0; @@ -261,8 +263,9 @@ namespace ignition public: virtual std::string EnvironmentMap() const = 0; /// \brief Set the material environment map - /// \param[in] _name URI of the new environment map file - public: virtual void SetEnvironmentMap(const std::string &_name) = 0; + /// \param[in] _metalnessMap URI of the new environment map file + public: virtual void SetEnvironmentMap( + const std::string &_metalnessMap) = 0; /// \brief Removes any environment map mapped to this material public: virtual void ClearEnvironmentMap() = 0; @@ -276,8 +279,9 @@ namespace ignition public: virtual std::string EmissiveMap() const = 0; /// \brief Set the material emissive map - /// \param[in] _name URI of the new emissive map file - public: virtual void SetEmissiveMap(const std::string &_name) = 0; + /// \param[in] _emissiveMap URI of the new emissive map file + public: virtual void SetEmissiveMap( + const std::string &_emissiveMap) = 0; /// \brief Removes any emissive map mapped to this material public: virtual void ClearEmissiveMap() = 0; diff --git a/include/ignition/rendering/Mesh.hh b/include/ignition/rendering/Mesh.hh index 59ee0a19c..59c194b93 100644 --- a/include/ignition/rendering/Mesh.hh +++ b/include/ignition/rendering/Mesh.hh @@ -104,13 +104,13 @@ namespace ignition /// \param[in] _name Name of registered Material /// \param[in] _unique True if the specified material should be cloned public: virtual void SetMaterial(const std::string &_name, - bool unique = true) = 0; + bool _unique = true) = 0; /// \brief Set the materials of this SubMesh /// \param[in] _material New Material to be assigned /// \param[in] _unique True if the given material should be cloned public: virtual void SetMaterial(MaterialPtr _material, - bool unique = true) = 0; + bool _unique = true) = 0; }; } } diff --git a/include/ignition/rendering/RayQuery.hh b/include/ignition/rendering/RayQuery.hh index 772177808..b1402075e 100644 --- a/include/ignition/rendering/RayQuery.hh +++ b/include/ignition/rendering/RayQuery.hh @@ -75,7 +75,7 @@ namespace ignition public: virtual math::Vector3d Origin() const = 0; /// \brief Set ray direction - /// \param[in] _origin Ray origin + /// \param[in] _dir Ray origin public: virtual void SetDirection(const math::Vector3d &_dir) = 0; /// \brief Get ray direction @@ -89,8 +89,7 @@ namespace ignition const math::Vector2d &_coord) = 0; /// \brief Compute intersections - /// \param[out] A vector of intersection results - /// \return True if results are not empty + /// \return A vector of intersection results public: virtual RayQueryResult ClosestPoint() = 0; }; } diff --git a/include/ignition/rendering/RenderEngine.hh b/include/ignition/rendering/RenderEngine.hh index 495d1f153..a40dc44e6 100644 --- a/include/ignition/rendering/RenderEngine.hh +++ b/include/ignition/rendering/RenderEngine.hh @@ -164,7 +164,7 @@ namespace ignition const std::string &_name) = 0; /// \brief Add path to media resource location - /// \param[in] _paths Absolute path to resource location + /// \param[in] _path Absolute path to resource location public: virtual void AddResourcePath(const std::string &_path) = 0; /// \brief Get the render pass system for this engine. diff --git a/include/ignition/rendering/RenderTypes.hh b/include/ignition/rendering/RenderTypes.hh index 28e81e4f2..44c106181 100644 --- a/include/ignition/rendering/RenderTypes.hh +++ b/include/ignition/rendering/RenderTypes.hh @@ -21,19 +21,19 @@ #include -/// \def IGN_VISIBILITY_ALL +/// \typedef IGN_VISIBILITY_ALL /// \brief Render everything visibility mask. #define IGN_VISIBILITY_ALL 0x0FFFFFFF -/// \def IGN_VISIBILITY_SELECTION +/// \typedef IGN_VISIBILITY_SELECTION /// \brief Renders only objects that can be selected. #define IGN_VISIBILITY_SELECTION 0x10000000 -/// \def IGN_VISIBILITY_GUI +/// \typedef IGN_VISIBILITY_GUI /// \brief Render GUI visuals mask. #define IGN_VISIBILITY_GUI 0x00000001 -/// \def IGN_VISIBILITY_SELECTABLE +/// \typedef IGN_VISIBILITY_SELECTABLE /// \brief Render visuals that are selectable mask. #define IGN_VISIBILITY_SELECTABLE 0x00000002 @@ -82,264 +82,264 @@ namespace ignition class ThermalCamera; class Visual; - /// \def ArrowVisualPtr + /// \typedef ArrowVisualPtr /// \brief Shared pointer to ArrowVisual typedef shared_ptr ArrowVisualPtr; - /// \def AxisVisualPtr + /// \typedef AxisVisualPtr /// \brief Shared pointer to AxisVisual typedef shared_ptr AxisVisualPtr; - /// \def CameraPtr + /// \typedef CameraPtr /// \brief Shared pointer to Camera typedef shared_ptr CameraPtr; - /// \def DepthCameraPtr + /// \typedef DepthCameraPtr /// \brief Shared pointer to DepthCamera typedef shared_ptr DepthCameraPtr; - /// \def ThermalCameraPtr + /// \typedef ThermalCameraPtr /// \brief Shared pointer to ThermalCamera typedef shared_ptr ThermalCameraPtr; - /// \def GpuRaysPtr + /// \typedef GpuRaysPtr /// \brief Shared pointer to GpuRays typedef shared_ptr GpuRaysPtr; - /// \def DirectionalLightPtr + /// \typedef DirectionalLightPtr /// \brief Shared pointer to DirectionalLight typedef shared_ptr DirectionalLightPtr; - /// \def GaussianNoisePass + /// \typedef GaussianNoisePassPtr /// \brief Shared pointer to GaussianNoisePass typedef shared_ptr GaussianNoisePassPtr; - /// \def GeometryPtr + /// \typedef GeometryPtr /// \brief Shared pointer to Geometry typedef shared_ptr GeometryPtr; - /// \def GizmoVisualPtr + /// \typedef GizmoVisualPtr /// \brief Shared pointer to GizmoVisual typedef shared_ptr GizmoVisualPtr; - /// \def GridPtr + /// \typedef GridPtr /// \brief Shared pointer to Grid typedef shared_ptr GridPtr; - /// \def JointVisualPtr + /// \typedef JointVisualPtr /// \brief Shared pointer to JointVisual typedef shared_ptr JointVisualPtr; - /// \def ImagePtr + /// \typedef ImagePtr /// \brief Shared pointer to Image typedef shared_ptr ImagePtr; - /// \def LightPtr + /// \typedef LightPtr /// \brief Shared pointer to Light typedef shared_ptr LightPtr; - /// \def MaterialPtr + /// \typedef MaterialPtr /// \brief Shared pointer to Material typedef shared_ptr MaterialPtr; - /// \def MarkerPtr + /// \typedef MarkerPtr /// \brief Shared pointer to Marker typedef shared_ptr MarkerPtr; - /// \def MeshPtr + /// \typedef MeshPtr /// \brief Shared pointer to Mesh typedef shared_ptr MeshPtr; - /// \def NodePtr + /// \typedef NodePtr /// \brief Shared pointer to Node typedef shared_ptr NodePtr; - /// \def ObjectPtr + /// \typedef ObjectPtr /// \brief Shared pointer to Object typedef shared_ptr ObjectPtr; - /// \def ObjectFactoryPtr + /// \typedef ObjectFactoryPtr /// \brief Shared pointer to ObjectFactory typedef shared_ptr ObjectFactoryPtr; - /// \def PointLightPtr + /// \typedef PointLightPtr /// \brief Shared pointer to PointLight typedef shared_ptr PointLightPtr; - /// \def RayQueryPtr + /// \typedef RayQueryPtr /// \brief Shared pointer to RayQuery typedef shared_ptr RayQueryPtr; - /// \def RenderPassPtr + /// \typedef RenderPassPtr /// \brief Shared pointer to RenderPass typedef shared_ptr RenderPassPtr; - /// \def RenderPassSystemPtr + /// \typedef RenderPassSystemPtr /// \brief Shared pointer to RenderPassSystem typedef shared_ptr RenderPassSystemPtr; - /// \def RenderTargetPtr + /// \typedef RenderTargetPtr /// \brief Shared pointer to RenderTarget typedef shared_ptr RenderTargetPtr; - /// \def RenderTexturePtr + /// \typedef RenderTexturePtr /// \brief Shared pointer to RenderTexture typedef shared_ptr RenderTexturePtr; - /// \def RenderWindowPtr + /// \typedef RenderWindowPtr /// \brief Shared pointer to RenderWindow typedef shared_ptr RenderWindowPtr; - /// \def ScenePtr + /// \typedef ScenePtr /// \brief Shared pointer to Scene typedef shared_ptr ScenePtr; - /// \def SensorPtr + /// \typedef SensorPtr /// \brief Shared pointer to Sensor typedef shared_ptr SensorPtr; /// \brief Shared pointer to ShaderParams typedef shared_ptr ShaderParamsPtr; - /// \def SpotLightPtr + /// \typedef SpotLightPtr /// \brief Shared pointer to SpotLight typedef shared_ptr SpotLightPtr; - /// \def SubMeshPtr + /// \typedef SubMeshPtr /// \brief Shared pointer to SubMesh typedef shared_ptr SubMeshPtr; - /// \def TextPtr + /// \typedef TextPtr /// \brief Shared pointer to Text typedef shared_ptr TextPtr; - /// \def VisualPtr + /// \typedef VisualPtr /// \brief Shared pointer to Visual typedef shared_ptr VisualPtr; - /// \def const ArrowVisualPtr + /// \typedef const ArrowVisualPtr /// \brief Shared pointer to const ArrowVisual typedef shared_ptr ConstArrowVisualPtr; - /// \def const AxisVisualPtr + /// \typedef const AxisVisualPtr /// \brief Shared pointer to const AxisVisual typedef shared_ptr ConstAxisVisualPtr; - /// \def const CameraPtr + /// \typedef const CameraPtr /// \brief Shared pointer to const Camera typedef shared_ptr ConstCameraPtr; - /// \def const DepthCameraPtr + /// \typedef const DepthCameraPtr /// \brief Shared pointer to const DepthCamera typedef shared_ptr ConstDepthCameraPtr; - /// \def const ThermalCameraPtr + /// \typedef const ThermalCameraPtr /// \brief Shared pointer to const ThermalCamera typedef shared_ptr ConstThermalCameraPtr; - /// \def const GpuRaysPtr + /// \typedef const GpuRaysPtr /// \brief Shared pointer to const GpuRays typedef shared_ptr ConstGpuRaysPtr; - /// \def const DirectionalLightPtr + /// \typedef const DirectionalLightPtr /// \brief Shared pointer to const DirectionalLight typedef shared_ptr ConstDirectionalLightPtr; - /// \def const GaussianNoisePass + /// \typedef const ConstGaussianNoisePass /// \brief Shared pointer to const GaussianNoisePass typedef shared_ptr ConstGaussianNoisePass; - /// \def const GeometryPtr + /// \typedef const GeometryPtr /// \brief Shared pointer to const Geometry typedef shared_ptr ConstGeometryPtr; - /// \def const GizmoVisualPtr + /// \typedef const GizmoVisualPtr /// \brief Shared pointer to const GizmoVisual typedef shared_ptr ConstGizmoVisualPtr; - /// \def const JointVisualPtr + /// \typedef const JointVisualPtr /// \brief Shared pointer to const JointVisual typedef shared_ptr ConstJointVisualPtr; - /// \def const ImagePtr + /// \typedef const ImagePtr /// \brief Shared pointer to const Image typedef shared_ptr ConstImagePtr; - /// \def const LightPtr + /// \typedef const LightPtr /// \brief Shared pointer to const Light typedef shared_ptr ConstLightPtr; - /// \def const MaterialPtr + /// \typedef const MaterialPtr /// \brief Shared pointer to const Material typedef shared_ptr ConstMaterialPtr; - /// \def const MeshPtr + /// \typedef const MeshPtr /// \brief Shared pointer to const Mesh typedef shared_ptr ConstMeshPtr; - /// \def const NodePtr + /// \typedef const NodePtr /// \brief Shared pointer to const Node typedef shared_ptr ConstNodePtr; - /// \def const ObjectPtr + /// \typedef const ObjectPtr /// \brief Shared pointer to const Object typedef shared_ptr ConstObjectPtr; - /// \def const ObjectFactoryPtr + /// \typedef const ObjectFactoryPtr /// \brief Shared pointer to const ObjectFactory typedef shared_ptr ConstObjectFactoryPtr; - /// \def const PointLightPtr + /// \typedef const PointLightPtr /// \brief Shared pointer to const PointLight typedef shared_ptr ConstPointLightPtr; - /// \def RayQueryPtr + /// \typedef RayQueryPtr /// \brief Shared pointer to RayQuery typedef shared_ptr ConstRayQueryPtr; - /// \def const RenderPassPtr + /// \typedef const RenderPassPtr /// \brief Shared pointer to const RenderPass typedef shared_ptr ConstRenderPassPtr; - /// \def const RenderPassSystemPtr + /// \typedef const RenderPassSystemPtr /// \brief Shared pointer to const RenderPassSystem typedef shared_ptr ConstRenderPassSystemPtr; - /// \def const RenderTargetPtr + /// \typedef const RenderTargetPtr /// \brief Shared pointer to const RenderTarget typedef shared_ptr ConstRenderTargetPtr; - /// \def const RenderTexturePtr + /// \typedef const RenderTexturePtr /// \brief Shared pointer to const RenderTexture typedef shared_ptr ConstRenderTexturePtr; - /// \def const RenderWindowPtr + /// \typedef const RenderWindowPtr /// \brief Shared pointer to const RenderWindow typedef shared_ptr ConstRenderWindowPtr; - /// \def const ScenePtr + /// \typedef const ScenePtr /// \brief Shared pointer to const Scene typedef shared_ptr ConstScenePtr; - /// \def const SensorPtr + /// \typedef const SensorPtr /// \brief Shared pointer to const Sensor typedef shared_ptr ConstSensorPtr; /// \brief Shared pointer to const ShaderParams typedef shared_ptr ConstShaderParamsPtr; - /// \def const SpotLightPtr + /// \typedef const SpotLightPtr /// \brief Shared pointer to const SpotLight typedef shared_ptr ConstSpotLightPtr; - /// \def const SubMeshPtr + /// \typedef const SubMeshPtr /// \brief Shared pointer to const SubMesh typedef shared_ptr ConstSubMeshPtr; - /// \def const SubMeshPtr + /// \typedef const SubMeshPtr /// \brief Shared pointer to const SubMesh typedef shared_ptr ConstTextPtr; - /// \def const VisualPtr + /// \typedef const VisualPtr /// \brief Shared pointer to const Visual typedef shared_ptr ConstVisualPtr; } diff --git a/include/ignition/rendering/Scene.hh b/include/ignition/rendering/Scene.hh index 6ca000f8f..bbe71a31f 100644 --- a/include/ignition/rendering/Scene.hh +++ b/include/ignition/rendering/Scene.hh @@ -204,7 +204,7 @@ namespace ignition /// scene, no work will be done. Depending on the _recursive argument, /// this function will either detach all child nodes from the scene graph /// or recursively destroy them. - /// \param[in] _id ID of the node to destroy + /// \param[in] _node Node pointer to destroy /// \param[in] _recursive True to recursively destroy the node and its /// children, false to destroy only this node and detach the children public: virtual void DestroyNode(NodePtr _node, @@ -276,7 +276,7 @@ namespace ignition /// scene, no work will be done. Depending on the _recursive argument, /// this function will either detach all child nodes from the scene graph /// or recursively destroy them. - /// \param[in] _id ID of the light to destroy + /// \param[in] _light Light pointer to destroy /// \param[in] _recursive True to recursively destroy the node and its /// children, false to destroy only this node and detach the children public: virtual void DestroyLight(LightPtr _light, @@ -348,7 +348,7 @@ namespace ignition /// this scene, no work will be done. Depending on the _recursive /// argument, this function will either detach all child nodes from the /// scene graph or recursively destroy them. - /// \param[in] _id ID of the sensor to destroy + /// \param[in] _sensor Sensor pointer to destroy /// \param[in] _recursive True to recursively destroy the node and its /// children, false to destroy only this node and detach the children public: virtual void DestroySensor(SensorPtr _sensor, @@ -421,7 +421,7 @@ namespace ignition /// this function will either detach all child nodes from the scene graph /// or recursively destroy them. /// consequently be detached from the scene graph, but not destroyed. - /// \param[in] _id ID of the node to destroy + /// \param[in] _node Visual pointer to destroy /// \param[in] _recursive True to recursively destroy the node and its /// children, false to destroy only this node and detach the children public: virtual void DestroyVisual(VisualPtr _node, diff --git a/include/ignition/rendering/Storage.hh b/include/ignition/rendering/Storage.hh index e11d2ce53..82f741045 100644 --- a/include/ignition/rendering/Storage.hh +++ b/include/ignition/rendering/Storage.hh @@ -48,11 +48,11 @@ namespace ignition template class IGNITION_RENDERING_VISIBLE Map { - /// \def TPtr + /// \typedef TPtr /// \brief Shared pointer to T typedef std::shared_ptr TPtr; - /// \def const TPtr + /// \typedef const TPtr /// \brief Shared pointer to const T typedef std::shared_ptr ConstTPtr; @@ -97,7 +97,7 @@ namespace ignition /// \brief Remove the given element. If the given element does not exist /// no work will be done. - /// \param[in] _key Key of the element in question + /// \param[in] _value Key of the element in question public: virtual void Remove(TPtr _value) = 0; /// \brief Remove all elements from this map @@ -113,11 +113,11 @@ namespace ignition template class IGNITION_RENDERING_VISIBLE Store { - /// \def TPtr + /// \typedef TPtr /// \brief Shared pointer to T typedef std::shared_ptr TPtr; - /// \def const TPtr + /// \typedef const TPtr /// \brief Shared pointer to const T typedef std::shared_ptr ConstTPtr; @@ -218,7 +218,7 @@ namespace ignition public: virtual void DestroyAll() = 0; }; - /// \class CompositeStore CompositeStore.hh + /// \class CompositeStore Storage.hh ignition/rendering/Storage.hh /// ignition/rendering/CompositeStore.hh /// \brief Represents a collection of Store objects, collectively working as /// a single composite store. @@ -227,19 +227,19 @@ namespace ignition class IGNITION_RENDERING_VISIBLE CompositeStore : public Store { - /// \def TPtr + /// \typedef TPtr /// \brief Shared pointer to T typedef std::shared_ptr TPtr; - /// \def TPtr + /// \typedef TPtr /// \brief Store of T typedef Store TStore; - /// \def TStorePtr + /// \typedef TStorePtr /// \brief Shared pointer to TStore typedef std::shared_ptr TStorePtr; - /// \def const TStorePtr + /// \typedef const TStorePtr /// \brief Shared pointer to const TStore typedef std::shared_ptr ConstTStorePtr; @@ -280,7 +280,7 @@ namespace ignition public: virtual TStorePtr RemoveStore(unsigned int _index) = 0; }; - /// \class StoreWrapper StoreWrapper.hh ignition/rendering/StoreWrapper.hh + /// \class StoreWrapper Storage.hh ignition/rendering/StoreWrapper.hh /// \brief Simple wrapper class that allows a Store of type Derived to be /// treated as a Store of type Base, where Derived is some class derived /// from Base. This is useful in storing Stores of different derived types diff --git a/include/ignition/rendering/Text.hh b/include/ignition/rendering/Text.hh index 45a83dd87..bcd7d91e2 100644 --- a/include/ignition/rendering/Text.hh +++ b/include/ignition/rendering/Text.hh @@ -133,7 +133,7 @@ namespace ignition public: virtual TextVerticalAlign VerticalAlignment() const = 0; /// \brief Set the baseline height of the text - /// \param[in] _height Baseline height + /// \param[in] _baseline Baseline height /// \sa Baseline() public: virtual void SetBaseline(const float _baseline) = 0; @@ -143,7 +143,7 @@ namespace ignition public: virtual float Baseline() const = 0; /// \brief True = text always is displayed ontop. - /// \param[in] _show Set to true to render the text on top of + /// \param[in] _onTop Set to true to render the text on top of /// all other drawables. /// \sa ShowOnTop() public: virtual void SetShowOnTop(const bool _onTop) = 0; diff --git a/include/ignition/rendering/ThermalCamera.hh b/include/ignition/rendering/ThermalCamera.hh index 4890cfab2..643fed05a 100644 --- a/include/ignition/rendering/ThermalCamera.hh +++ b/include/ignition/rendering/ThermalCamera.hh @@ -107,7 +107,7 @@ namespace ignition /// If set, the temperature reading of heat sources will vary within /// a temperature of +/- range/2 instead of returning a fixed uniform /// temperature for the entire heat source - /// \param[in] _rnage Temperature variation range + /// \param[in] _range Temperature variation range /// \sa HeatSourceTemperatureRange public: virtual void SetHeatSourceTemperatureRange(float _range) = 0; diff --git a/include/ignition/rendering/TransformController.hh b/include/ignition/rendering/TransformController.hh index 3e537fa87..8f0be4f8c 100644 --- a/include/ignition/rendering/TransformController.hh +++ b/include/ignition/rendering/TransformController.hh @@ -64,7 +64,8 @@ namespace ignition public: virtual CameraPtr Camera() const; /// \brief Get the attached node - /// \param[in] _node Node the transform controller is attached to + /// \return The node which is being transformed, nullptr if there is no + /// node attached. public: virtual NodePtr Node() const; /// \brief Attach the transform controller to the specified node diff --git a/include/ignition/rendering/TransformType.hh b/include/ignition/rendering/TransformType.hh index 64b8e0529..faf1f66d5 100644 --- a/include/ignition/rendering/TransformType.hh +++ b/include/ignition/rendering/TransformType.hh @@ -29,7 +29,7 @@ namespace ignition { inline namespace IGNITION_RENDERING_VERSION_NAMESPACE { // - /// \enum Transform axis + /// \enum TransformAxis /// \brief Unique identifiers for transformation axes. enum IGNITION_RENDERING_VISIBLE TransformAxis { @@ -55,7 +55,7 @@ namespace ignition TA_SCALE_Z = 0x00000400 }; - /// \enum Transform mode + /// \enum TransformMode /// \brief Unique identifiers for transformation modes. enum IGNITION_RENDERING_VISIBLE TransformMode { @@ -69,7 +69,7 @@ namespace ignition TM_SCALE = TA_SCALE_X | TA_SCALE_Y, TA_SCALEZ, }; - /// \enum Transform space + /// \enum TransformSpace /// \brief Unique identifiers for transformation spaces. enum IGNITION_RENDERING_VISIBLE TransformSpace { diff --git a/include/ignition/rendering/Utils.hh b/include/ignition/rendering/Utils.hh index 7c1c15e35..5f87a3ea5 100644 --- a/include/ignition/rendering/Utils.hh +++ b/include/ignition/rendering/Utils.hh @@ -47,7 +47,7 @@ namespace ignition const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, - float maxDistance = 10.0); + float _maxDistance = 10.0); /// \brief Retrieve the first point on a surface in the 3D scene hit by a /// ray cast from the given 2D screen coordinates. @@ -63,7 +63,7 @@ namespace ignition const CameraPtr &_camera, const RayQueryPtr &_rayQuery, RayQueryResult &_rayResult, - float maxDistance = 10.0); + float _maxDistance = 10.0); /// \brief Retrieve the point on a plane at z = 0 in the 3D scene hit by a /// ray cast from the given 2D screen coordinates. @@ -77,7 +77,7 @@ namespace ignition const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, - const float offset = 0.0); + const float _offset = 0.0); /// \brief Get the screen scaling factor. /// \return The screen scaling factor. diff --git a/include/ignition/rendering/Visual.hh b/include/ignition/rendering/Visual.hh index 0a76c08b0..12838afa4 100644 --- a/include/ignition/rendering/Visual.hh +++ b/include/ignition/rendering/Visual.hh @@ -83,25 +83,25 @@ namespace ignition /// \param[in] _name Name of the material to be assigned /// \param[in] _unique True if the specified material should be cloned public: virtual void SetMaterial(const std::string &_name, - bool unique = true) = 0; + bool _unique = true) = 0; /// \brief Set the material for all attached visuals and geometries - /// \param[in] _name Name of the material to be assigned + /// \param[in] _material Name of the material to be assigned /// \param[in] _unique True if the specified material should be cloned public: virtual void SetMaterial(MaterialPtr _material, - bool unique = true) = 0; + bool _unique = true) = 0; /// \brief Set the material for all attached visuals only - /// \param[in] _name Name of the material to be assigned + /// \param[in] _material Name of the material to be assigned /// \param[in] _unique True if the specified material should be cloned public: virtual void SetChildMaterial(MaterialPtr _material, - bool unique = true) = 0; + bool _unique = true) = 0; /// \brief Set the material for all attached geometries only - /// \param[in] _name Name of the material to be assigned + /// \param[in] _material Name of the material to be assigned /// \param[in] _unique True if the specified material should be cloned public: virtual void SetGeometryMaterial(MaterialPtr _material, - bool unique = true) = 0; + bool _unique = true) = 0; /// \brief Get the material assigned to attached visuals and geometries. /// \return the Pointer to the material assigned to this visual. If the @@ -121,7 +121,7 @@ namespace ignition /// \brief Get custom data stored in this visual /// \param[in] _key Unique key - /// \param[in] _value Value in any type + /// \return Data associated with the key. public: virtual Variant UserData(const std::string &_key) const = 0; }; } diff --git a/include/ignition/rendering/base/BaseGeometry.hh b/include/ignition/rendering/base/BaseGeometry.hh index 78578053f..6460f52dd 100644 --- a/include/ignition/rendering/base/BaseGeometry.hh +++ b/include/ignition/rendering/base/BaseGeometry.hh @@ -40,11 +40,13 @@ namespace ignition public: virtual void RemoveParent() override; - public: virtual void SetMaterial(const std::string &_name, - bool unique = true) override; + // Documentation inherited + public: virtual void SetMaterial(const std::string &_material, + bool _unique = true) override; + // Documentation inherited public: virtual void SetMaterial(MaterialPtr _material, - bool unique = true) override = 0; + bool _unique = true) override = 0; // Documentation inherited public: virtual void Destroy() override; diff --git a/include/ignition/rendering/base/BaseGizmoVisual.hh b/include/ignition/rendering/base/BaseGizmoVisual.hh index a00ffc982..c517f861f 100644 --- a/include/ignition/rendering/base/BaseGizmoVisual.hh +++ b/include/ignition/rendering/base/BaseGizmoVisual.hh @@ -87,7 +87,6 @@ namespace ignition protected: void CreateRotationVisual(); /// \brief Create gizmo visual for scale - /// \return Rotation visual protected: void CreateScaleVisual(); /// \brief Current gizmo mode diff --git a/include/ignition/rendering/base/BaseLight.hh b/include/ignition/rendering/base/BaseLight.hh index 05dee7f53..0994a75ea 100644 --- a/include/ignition/rendering/base/BaseLight.hh +++ b/include/ignition/rendering/base/BaseLight.hh @@ -34,26 +34,36 @@ namespace ignition public: virtual ~BaseLight(); + // Documentation inherited public: virtual void SetDiffuseColor(double _r, double _g, double _b, double _a = 1.0); + // Documentation inherited. public: virtual void SetDiffuseColor(const math::Color &_color) = 0; + // Documentation inherited. public: virtual void SetSpecularColor(double _r, double _g, double _b, double _a = 1.0); + // Documentation inherited. public: virtual void SetSpecularColor(const math::Color &_color) = 0; + // Documentation inherited. public: virtual void SetAttenuationConstant(double _value) = 0; + // Documentation inherited. public: virtual void SetAttenuationLinear(double _value) = 0; + // Documentation inherited. public: virtual void SetAttenuationQuadratic(double _value) = 0; + // Documentation inherited. public: virtual void SetAttenuationRange(double _range) = 0; + // Documentation inherited. public: virtual void SetCastShadows(bool _castShadows) = 0; + // Documentation inherited. protected: virtual void Reset(); }; diff --git a/include/ignition/rendering/base/BaseMaterial.hh b/include/ignition/rendering/base/BaseMaterial.hh index 28d12c7ef..c6c2861e5 100644 --- a/include/ignition/rendering/base/BaseMaterial.hh +++ b/include/ignition/rendering/base/BaseMaterial.hh @@ -85,7 +85,7 @@ namespace ignition public: virtual void SetReflectivity(const double _reflectivity) override; // Documentation inherited - public: virtual void SetCastShadows(const bool _cast) override; + public: virtual void SetCastShadows(const bool _castShadows) override; // Documentation inherited public: virtual void SetReceiveShadows(const bool _receiveShadows) @@ -234,8 +234,9 @@ namespace ignition // Documentation inherited public: virtual MaterialType Type() const override; - public: virtual void SetShaderType(enum ShaderType /*_type*/) override + public: virtual void SetShaderType(enum ShaderType _type) override { + (void)_type; // no op } @@ -448,9 +449,9 @@ namespace ignition ////////////////////////////////////////////////// template - void BaseMaterial::SetCastShadows(const bool _cast) + void BaseMaterial::SetCastShadows(const bool _castShadows) { - this->castShadows = _cast; + this->castShadows = _castShadows; } ////////////////////////////////////////////////// diff --git a/include/ignition/rendering/base/BaseMesh.hh b/include/ignition/rendering/base/BaseMesh.hh index ee8719ab4..c8b4d5808 100644 --- a/include/ignition/rendering/base/BaseMesh.hh +++ b/include/ignition/rendering/base/BaseMesh.hh @@ -48,7 +48,8 @@ namespace ignition // Documentation inherited. public: virtual void SetSkeletonLocalTransforms( - const std::map &) override; + const std::map &_tfs) + override; public: virtual unsigned int SubMeshCount() const override; @@ -66,9 +67,11 @@ namespace ignition // Documentation inherited. public: virtual MaterialPtr Material() const override; + // Documentation inherited. public: virtual void SetMaterial(const std::string &_name, bool _unique = true) override; + // Documentation inherited. public: virtual void SetMaterial(MaterialPtr _material, bool _unique = true) override; diff --git a/include/ignition/rendering/base/BaseScene.hh b/include/ignition/rendering/base/BaseScene.hh index cda67c578..41da6508f 100644 --- a/include/ignition/rendering/base/BaseScene.hh +++ b/include/ignition/rendering/base/BaseScene.hh @@ -431,8 +431,11 @@ namespace ignition /// \param[in] _id Unique id /// \param[in] _name Name of thermal camera protected: virtual ThermalCameraPtr CreateThermalCameraImpl( - unsigned int /*_id*/, const std::string &/*_name*/) + unsigned int _id, const std::string &_name) { + // The following two lines will avoid doxygen warnings + (void)_id; + (void)_name; ignerr << "Thermal camera not supported by: " << this->Engine()->Name() << std::endl; return ThermalCameraPtr(); @@ -441,9 +444,11 @@ namespace ignition /// \brief Implementation for creating GpuRays sensor. /// \param[in] _id Unique id /// \param[in] _name Name of GpuRays sensor - protected: virtual GpuRaysPtr CreateGpuRaysImpl(unsigned int /*_id*/, - const std::string & /*_name*/) + protected: virtual GpuRaysPtr CreateGpuRaysImpl(unsigned int _id, + const std::string & _name) { + (void)_id; + (void)_name; ignerr << "GpuRays not supported by: " << this->Engine()->Name() << std::endl; return GpuRaysPtr(); @@ -461,9 +466,11 @@ namespace ignition /// \brief Implementation for creating a GizmoVisual. /// \param[in] _id Unique id /// \param[in] _name Name of GizmoVisual - protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int, - const std::string &) + protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id, + const std::string &_name) { + (void)_id; + (void)_name; ignerr << "GizmoVisual not supported by: " << this->Engine()->Name() << std::endl; return GizmoVisualPtr(); diff --git a/ogre/include/ignition/rendering/ogre/OgreCamera.hh b/ogre/include/ignition/rendering/ogre/OgreCamera.hh index c823845e1..a648ece20 100644 --- a/ogre/include/ignition/rendering/ogre/OgreCamera.hh +++ b/ogre/include/ignition/rendering/ogre/OgreCamera.hh @@ -45,30 +45,41 @@ namespace ignition public: virtual ~OgreCamera(); - public: virtual void SetHFOV(const math::Angle &_angle) override; + // Documentation inherited. + public: virtual void SetHFOV(const math::Angle &_hfov) override; + // Documentation inherited. public: virtual double AspectRatio() const override; + // Documentation inherited. public: virtual void SetAspectRatio(const double _ratio) override; + // Documentation inherited. public: virtual unsigned int AntiAliasing() const override; + // Documentation inherited. public: virtual void SetAntiAliasing(const unsigned int _aa) override; + // Documentation inherited. public: virtual void SetFarClipPlane(const double _far) override; + // Documentation inherited. public: virtual void SetNearClipPlane(const double _near) override; public: virtual math::Color BackgroundColor() const; public: virtual void SetBackgroundColor(const math::Color &_color); + // Documentation inherited. public: virtual void Render() override; + // Documentation inherited. public: virtual RenderWindowPtr CreateRenderWindow() override; + // Documentation inherited. public: virtual math::Matrix4d ProjectionMatrix() const override; + // Documentation inherited. public: virtual math::Matrix4d ViewMatrix() const override; public: void SetVFOV(double cameraVFOV) const; diff --git a/ogre/include/ignition/rendering/ogre/OgreConversions.hh b/ogre/include/ignition/rendering/ogre/OgreConversions.hh index bacb29d72..0bb3b632e 100644 --- a/ogre/include/ignition/rendering/ogre/OgreConversions.hh +++ b/ogre/include/ignition/rendering/ogre/OgreConversions.hh @@ -93,7 +93,7 @@ namespace ignition public: static Ogre::Matrix4 Convert(const math::Matrix4d &_m); /// \brief Ign-rendering PixelFormat to Ogre PixelFormat - /// \param[in] _v Ign-rendering PixelFormat + /// \param[in] _format Ign-rendering PixelFormat /// return Ogre PixelFormat public: static Ogre::PixelFormat Convert(PixelFormat _format); diff --git a/ogre/include/ignition/rendering/ogre/OgreMaterial.hh b/ogre/include/ignition/rendering/ogre/OgreMaterial.hh index 6fe098705..d9cffa5e2 100644 --- a/ogre/include/ignition/rendering/ogre/OgreMaterial.hh +++ b/ogre/include/ignition/rendering/ogre/OgreMaterial.hh @@ -94,6 +94,7 @@ namespace ignition public: virtual bool CastShadows() const override; + // Documentation inherited. public: virtual void SetCastShadows(const bool _castShadows) override; public: virtual bool ReceiveShadows() const override; @@ -109,7 +110,8 @@ namespace ignition public: virtual std::string Texture() const override; - public: virtual void SetTexture(const std::string &_name) override; + // Documentation inherited. + public: virtual void SetTexture(const std::string &_texture) override; public: virtual void ClearTexture() override; @@ -117,12 +119,14 @@ namespace ignition public: virtual std::string NormalMap() const override; - public: virtual void SetNormalMap(const std::string &_name) override; + // Documentation inherited. + public: virtual void SetNormalMap(const std::string &_normalMap) override; public: virtual void ClearNormalMap() override; public: virtual enum ShaderType ShaderType() const override; + // Documentation inherited. public: virtual void SetShaderType(enum ShaderType _type) override; public: virtual Ogre::MaterialPtr Material() const; diff --git a/ogre/include/ignition/rendering/ogre/OgreRTShaderSystem.hh b/ogre/include/ignition/rendering/ogre/OgreRTShaderSystem.hh index f63a19173..56450b8fc 100644 --- a/ogre/include/ignition/rendering/ogre/OgreRTShaderSystem.hh +++ b/ogre/include/ignition/rendering/ogre/OgreRTShaderSystem.hh @@ -45,8 +45,8 @@ namespace ignition class IGNITION_RENDERING_OGRE_VISIBLE OgreRTShaderSystem : public common::SingletonT { - /// \enum LightingModel. - /// \brief The type of lighting. + /// \enum LightingModel + /// \brief The type of lighting public: enum LightingModel { /// \brief Per-Vertex lighting: best performance. @@ -83,11 +83,11 @@ namespace ignition public: void AddScene(OgreScenePtr _scene); /// \brief Remove a scene - /// \param[in] The scene to remove + /// \param[in] _scene The scene to remove public: void RemoveScene(OgreScenePtr _scene); /// \brief Remove a scene - /// \param[in] Name of the scene to remove. + /// \param[in] _scene Name of the scene to remove. public: void RemoveScene(const std::string &_scene); /// \brief Update the shaders. This should not be called frequently. @@ -95,7 +95,7 @@ namespace ignition /// \brief Set an Ogre::Entity to use RT shaders. /// \param[in] _vis OgreSubMesh that will use the OgreRTShaderSystem. - public: void AttachEntity(OgreSubMesh *vis); + public: void AttachEntity(OgreSubMesh *_vis); /// \brief Remove and entity. /// \param[in] _vis Remove this visual. diff --git a/ogre/include/ignition/rendering/ogre/OgreRenderEngine.hh b/ogre/include/ignition/rendering/ogre/OgreRenderEngine.hh index 26b94d083..6003fbc3b 100644 --- a/ogre/include/ignition/rendering/ogre/OgreRenderEngine.hh +++ b/ogre/include/ignition/rendering/ogre/OgreRenderEngine.hh @@ -69,7 +69,7 @@ namespace ignition public virtual BaseRenderEngine, public common::SingletonT { - /// \enum RenderPathType + /// \enum OgreRenderPathType /// \brief The type of rendering path used by the rendering engine. public: enum OgreRenderPathType { @@ -186,4 +186,3 @@ namespace ignition } } #endif - diff --git a/ogre/include/ignition/rendering/ogre/OgreSelectionBuffer.hh b/ogre/include/ignition/rendering/ogre/OgreSelectionBuffer.hh index ac244a93f..51c76af25 100644 --- a/ogre/include/ignition/rendering/ogre/OgreSelectionBuffer.hh +++ b/ogre/include/ignition/rendering/ogre/OgreSelectionBuffer.hh @@ -47,7 +47,7 @@ namespace ignition class IGNITION_RENDERING_OGRE_VISIBLE OgreSelectionBuffer { /// \brief Constructor - /// \param[in] _camera Name of the camera to generate a selection + /// \param[in] _cameraName Name of the camera to generate a selection /// buffer for. /// \param[in] _mgr Pointer to the scene manager. public: OgreSelectionBuffer(const std::string &_cameraName, diff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2Camera.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2Camera.hh index 0773445b0..41052fee5 100644 --- a/ogre2/include/ignition/rendering/ogre2/Ogre2Camera.hh +++ b/ogre2/include/ignition/rendering/ogre2/Ogre2Camera.hh @@ -46,7 +46,7 @@ namespace ignition public: virtual ~Ogre2Camera(); // Documenation inherited. - public: virtual void SetHFOV(const math::Angle &_angle) override; + public: virtual void SetHFOV(const math::Angle &_hfov) override; // Documenation inherited. public: virtual double AspectRatio() const override; diff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2Conversions.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2Conversions.hh index d4326a1c9..dc9d4fed5 100644 --- a/ogre2/include/ignition/rendering/ogre2/Ogre2Conversions.hh +++ b/ogre2/include/ignition/rendering/ogre2/Ogre2Conversions.hh @@ -94,7 +94,7 @@ namespace ignition public: static Ogre::Matrix4 Convert(const math::Matrix4d &_m); /// \brief Ign-rendering PixelFormat to Ogre PixelFormat - /// \param[in] _v Ign-rendering PixelFormat + /// \param[in] _format Ign-rendering PixelFormat /// return Ogre PixelFormat public: static Ogre::PixelFormat Convert(PixelFormat _format); diff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2Material.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2Material.hh index 7f9d30039..3b8c0b2c2 100644 --- a/ogre2/include/ignition/rendering/ogre2/Ogre2Material.hh +++ b/ogre2/include/ignition/rendering/ogre2/Ogre2Material.hh @@ -77,7 +77,7 @@ namespace ignition public: virtual std::string Texture() const override; // Documentation inherited - public: virtual void SetTexture(const std::string &_name) override; + public: virtual void SetTexture(const std::string &_texture) override; // Documentation inherited public: virtual void ClearTexture() override; @@ -89,7 +89,7 @@ namespace ignition public: virtual std::string NormalMap() const override; // Documentation inherited - public: virtual void SetNormalMap(const std::string &_name) override; + public: virtual void SetNormalMap(const std::string &_normalMap) override; // Documentation inherited public: virtual void ClearNormalMap() override; @@ -101,7 +101,8 @@ namespace ignition public: virtual std::string RoughnessMap() const override; // Documentation inherited - public: virtual void SetRoughnessMap(const std::string &_name) override; + public: virtual void SetRoughnessMap( + const std::string &_roughnessMap) override; // Documentation inherited public: virtual void ClearRoughnessMap() override; @@ -113,7 +114,8 @@ namespace ignition public: virtual std::string MetalnessMap() const override; // Documentation inherited - public: virtual void SetMetalnessMap(const std::string &_name) override; + public: virtual void SetMetalnessMap( + const std::string &_metalnessMap) override; // Documentation inherited public: virtual void ClearMetalnessMap() override; @@ -125,7 +127,8 @@ namespace ignition public: virtual std::string EnvironmentMap() const override; // Documentation inherited - public: virtual void SetEnvironmentMap(const std::string &_name) override; + public: virtual void SetEnvironmentMap( + const std::string &_metalnessMap) override; // Documentation inherited public: virtual void ClearEnvironmentMap() override; @@ -140,7 +143,8 @@ namespace ignition public: virtual std::string EmissiveMap() const override; // Documentation inherited - public: virtual void SetEmissiveMap(const std::string &_name) override; + public: virtual void SetEmissiveMap( + const std::string &_emissiveMap) override; // Documentation inherited public: virtual void ClearEmissiveMap() override; diff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2Node.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2Node.hh index fb1302a99..5a6be9005 100644 --- a/ogre2/include/ignition/rendering/ogre2/Ogre2Node.hh +++ b/ogre2/include/ignition/rendering/ogre2/Ogre2Node.hh @@ -98,7 +98,7 @@ namespace ignition protected: virtual math::Quaterniond RawLocalRotation() const; /// \brief Set the raw local rotation of the node - /// \param[in] _position Local rotation to set the node to + /// \param[in] _rotation Local rotation to set the node to protected: virtual void SetRawLocalRotation( const math::Quaterniond &_rotation); diff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh index 743012557..c6f212e7a 100644 --- a/ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh +++ b/ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh @@ -112,7 +112,7 @@ namespace ignition /// \brief Create a scene /// \param[in] _id Unique scene Id - /// \parampin] _name Name of scene + /// \param[in] _name Name of scene protected: virtual ScenePtr CreateSceneImpl(unsigned int _id, const std::string &_name) override; @@ -205,4 +205,3 @@ namespace ignition } } #endif - diff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2SelectionBuffer.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2SelectionBuffer.hh index 35fd51332..0afec5482 100644 --- a/ogre2/include/ignition/rendering/ogre2/Ogre2SelectionBuffer.hh +++ b/ogre2/include/ignition/rendering/ogre2/Ogre2SelectionBuffer.hh @@ -47,7 +47,7 @@ namespace ignition class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2SelectionBuffer { /// \brief Constructor - /// \param[in] _camera Name of the camera to generate a selection + /// \param[in] _cameraName Name of the camera to generate a selection /// buffer for. /// \param[in] _scene Pointer to the scene public: Ogre2SelectionBuffer(const std::string &_cameraName, @@ -62,10 +62,6 @@ namespace ignition /// \return Returns the Ogre item at the coordinate. public: Ogre::Item *OnSelectionClick(const int _x, const int _y); - /// \brief Debug show overlay - /// \param[in] _show True to show the selection buffer in an overlay. - // public: void ShowOverlay(const bool _show); - /// \brief Call this to update the selection buffer contents public: void Update(); diff --git a/optix/include/ignition/rendering/optix/OptixCamera.hh b/optix/include/ignition/rendering/optix/OptixCamera.hh index a05491a8b..5a02e6c12 100644 --- a/optix/include/ignition/rendering/optix/OptixCamera.hh +++ b/optix/include/ignition/rendering/optix/OptixCamera.hh @@ -35,7 +35,7 @@ namespace ignition public: virtual ~OptixCamera(); - public: virtual void SetHFOV(const math::Angle &_angle); + public: virtual void SetHFOV(const math::Angle &_hfov); public: virtual void SetAspectRatio(const double _ratio); diff --git a/optix/include/ignition/rendering/optix/OptixMaterial.hh b/optix/include/ignition/rendering/optix/OptixMaterial.hh index 55b5f23b6..0c2605a2f 100644 --- a/optix/include/ignition/rendering/optix/OptixMaterial.hh +++ b/optix/include/ignition/rendering/optix/OptixMaterial.hh @@ -83,7 +83,7 @@ namespace ignition public: virtual std::string Texture() const; - public: virtual void SetTexture(const std::string &_name); + public: virtual void SetTexture(const std::string &_texture); public: virtual void ClearTexture(); @@ -91,7 +91,7 @@ namespace ignition public: virtual std::string NormalMap() const; - public: virtual void SetNormalMap(const std::string &_name); + public: virtual void SetNormalMap(const std::string &_normalMap); public: virtual void ClearNormalMap(); From 622a7bad5ded47ad7b1f7c01aefb79f3d2abb857 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Tue, 31 Aug 2021 10:45:19 -0700 Subject: [PATCH 09/12] warn about non-existent submesh (#391) Signed-off-by: Ian Chen --- ogre/src/OgreMeshFactory.cc | 9 +++++++++ ogre2/src/Ogre2MeshFactory.cc | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/ogre/src/OgreMeshFactory.cc b/ogre/src/OgreMeshFactory.cc index ff1a11390..c1101e825 100644 --- a/ogre/src/OgreMeshFactory.cc +++ b/ogre/src/OgreMeshFactory.cc @@ -450,6 +450,15 @@ bool OgreMeshFactory::LoadImpl(const MeshDescriptor &_desc) return false; } + if (ogreMesh->getNumSubMeshes() == 0u) + { + std::string msg = "Unable to load mesh: '" + _desc.meshName + "'"; + if (!_desc.subMeshName.empty()) + msg += ", submesh: '" + _desc.subMeshName + "'"; + msg += ". Mesh will be empty."; + ignwarn << msg << std::endl; + } + return true; } diff --git a/ogre2/src/Ogre2MeshFactory.cc b/ogre2/src/Ogre2MeshFactory.cc index a2852a7e8..58ff1e641 100644 --- a/ogre2/src/Ogre2MeshFactory.cc +++ b/ogre2/src/Ogre2MeshFactory.cc @@ -469,6 +469,15 @@ bool Ogre2MeshFactory::LoadImpl(const MeshDescriptor &_desc) return false; } + if (ogreMesh->getNumSubMeshes() == 0u) + { + std::string msg = "Unable to load mesh: '" + _desc.meshName + "'"; + if (!_desc.subMeshName.empty()) + msg += ", submesh: '" + _desc.subMeshName + "'"; + msg += ". Mesh will be empty."; + ignwarn << msg << std::endl; + } + return true; } From 8f961d0c4cc755b6a2ca217d5a73de268ef95514 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Wed, 8 Sep 2021 15:27:32 -0700 Subject: [PATCH 10/12] Fix doxygen for ign-rendering4 (#398) Signed-off-by: Louise Poubel --- CMakeLists.txt | 1 + include/ignition/rendering/Utils.hh | 2 +- include/ignition/rendering/Visual.hh | 4 ++-- include/ignition/rendering/base/BaseMesh.hh | 3 ++- include/ignition/rendering/base/BaseParticleEmitter.hh | 4 ++-- include/ignition/rendering/base/BaseScene.hh | 4 +++- ogre/include/ignition/rendering/ogre/OgreMesh.hh | 2 +- ogre2/include/ignition/rendering/ogre2/Ogre2Mesh.hh | 2 +- 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 374885406..81ca2b839 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,6 +168,7 @@ configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials ign_create_docs( API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md" TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md" + IMAGE_PATH_DIRS "${CMAKE_SOURCE_DIR}/tutorials/img" TAGFILES "${IGNITION-COMMON_DOXYGEN_TAGFILE} = ${IGNITION-COMMON_API_URL}" "${IGNITION-MATH_DOXYGEN_TAGFILE} = ${IGNITION-MATH_API_URL}" diff --git a/include/ignition/rendering/Utils.hh b/include/ignition/rendering/Utils.hh index 2ef18f60a..d1cea0cf8 100644 --- a/include/ignition/rendering/Utils.hh +++ b/include/ignition/rendering/Utils.hh @@ -91,7 +91,7 @@ namespace ignition /// \brief Transform a bounding box. /// \param[in] _box The bounding box. /// \param[in] _pose Pose used to transform the bounding box. - /// \param[out] _vertices Vertices of the transformed bounding box in + /// \return Vertices of the transformed bounding box in /// world coordinates. IGNITION_RENDERING_VISIBLE ignition::math::AxisAlignedBox transformAxisAlignedBox( diff --git a/include/ignition/rendering/Visual.hh b/include/ignition/rendering/Visual.hh index 421bb4f94..0e26fc233 100644 --- a/include/ignition/rendering/Visual.hh +++ b/include/ignition/rendering/Visual.hh @@ -123,11 +123,11 @@ namespace ignition public: virtual uint32_t VisibilityFlags() const = 0; /// \brief Add visibility flags - /// \param[in] _visibility flags + /// \param[in] _flags Visibility flags public: virtual void AddVisibilityFlags(uint32_t _flags) = 0; /// \brief Remove visibility flags - /// \param[in] _visibility flags + /// \param[in] _flags Visibility flags public: virtual void RemoveVisibilityFlags(uint32_t _flags) = 0; /// \brief Store any custom data associated with this visual diff --git a/include/ignition/rendering/base/BaseMesh.hh b/include/ignition/rendering/base/BaseMesh.hh index 0f7e1e1af..4f55794db 100644 --- a/include/ignition/rendering/base/BaseMesh.hh +++ b/include/ignition/rendering/base/BaseMesh.hh @@ -59,7 +59,8 @@ namespace ignition // Documentation inherited. public: virtual void SetSkeletonWeights( - const std::unordered_map &) override; + const std::unordered_map &_weights) + override; // Documentation inherited. public: virtual void SetSkeletonAnimationEnabled(const std::string &_name, diff --git a/include/ignition/rendering/base/BaseParticleEmitter.hh b/include/ignition/rendering/base/BaseParticleEmitter.hh index 1c0459a2a..6789129d1 100644 --- a/include/ignition/rendering/base/BaseParticleEmitter.hh +++ b/include/ignition/rendering/base/BaseParticleEmitter.hh @@ -110,8 +110,8 @@ namespace ignition public: virtual double MaxVelocity() const override; // Documentation inherited. - public: virtual void SetVelocityRange(double _minVel, - double _maxVel) override; + public: virtual void SetVelocityRange(double _minVelocity, + double _maxVelocity) override; // Documentation inherited. public: virtual ignition::math::Color ColorStart() const override; diff --git a/include/ignition/rendering/base/BaseScene.hh b/include/ignition/rendering/base/BaseScene.hh index 04311b830..93a521cd4 100644 --- a/include/ignition/rendering/base/BaseScene.hh +++ b/include/ignition/rendering/base/BaseScene.hh @@ -592,8 +592,10 @@ namespace ignition /// \param[in] _name Name of ParticleEmitter. /// \return Pointer to the created particle emitter. protected: virtual ParticleEmitterPtr CreateParticleEmitterImpl( - unsigned int, const std::string &) + unsigned int _id, const std::string &_name) { + (void)_id; + (void)_name; ignerr << "ParticleEmitter not supported by: " << this->Engine()->Name() << std::endl; return ParticleEmitterPtr(); diff --git a/ogre/include/ignition/rendering/ogre/OgreMesh.hh b/ogre/include/ignition/rendering/ogre/OgreMesh.hh index 11b2a6245..50d8e0b16 100644 --- a/ogre/include/ignition/rendering/ogre/OgreMesh.hh +++ b/ogre/include/ignition/rendering/ogre/OgreMesh.hh @@ -71,7 +71,7 @@ namespace ignition // Documentation inherited. public: virtual void SetSkeletonWeights( - const std::unordered_map &_weight) override; + const std::unordered_map &_weights) override; // Documentation inherited. public: virtual void SetSkeletonAnimationEnabled(const std::string &_name, diff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2Mesh.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2Mesh.hh index a6ae4c070..038c9c3b4 100644 --- a/ogre2/include/ignition/rendering/ogre2/Ogre2Mesh.hh +++ b/ogre2/include/ignition/rendering/ogre2/Ogre2Mesh.hh @@ -72,7 +72,7 @@ namespace ignition // Documentation inherited. public: virtual void SetSkeletonWeights( - const std::unordered_map &_weight) override; + const std::unordered_map &_weights) override; // Documentation inherited. public: virtual void SetSkeletonAnimationEnabled(const std::string &_name, From 018d25689ec938e57dbc433330d81d9d6459a2b5 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Wed, 8 Sep 2021 15:36:29 -0700 Subject: [PATCH 11/12] Fix single ray gpu lidar (#384) * fix 0 hfov angle Signed-off-by: Ian Chen * use ignerr Signed-off-by: Ian Chen --- ogre2/src/Ogre2GpuRays.cc | 16 ++++- test/integration/gpu_rays.cc | 114 ++++++++++++++++++++++++++++++++++- 2 files changed, 124 insertions(+), 6 deletions(-) diff --git a/ogre2/src/Ogre2GpuRays.cc b/ogre2/src/Ogre2GpuRays.cc index d63a0531c..c68bead3c 100644 --- a/ogre2/src/Ogre2GpuRays.cc +++ b/ogre2/src/Ogre2GpuRays.cc @@ -172,6 +172,9 @@ class ignition::rendering::Ogre2GpuRaysPrivate /// \brief Listener for setting particle noise value based on particle /// emitter region public: std::unique_ptr particleNoiseListener[6]; + + /// \brief Min allowed angle in radians; + public: const math::Angle kMinAllowedAngle = 1e-4; }; using namespace ignition; @@ -455,6 +458,7 @@ void Ogre2GpuRays::ConfigureCamera() { // horizontal gpu rays setup auto hfovAngle = this->AngleMax() - this->AngleMin(); + hfovAngle = std::max(this->dataPtr->kMinAllowedAngle, hfovAngle); this->SetHFOV(hfovAngle); // vertical laser setup @@ -462,7 +466,8 @@ void Ogre2GpuRays::ConfigureCamera() if (this->VerticalRangeCount() > 1) { - vfovAngle = (this->VerticalAngleMax() - this->VerticalAngleMin()).Radian(); + vfovAngle = std::max(this->dataPtr->kMinAllowedAngle.Radian(), + (this->VerticalAngleMax() - this->VerticalAngleMin()).Radian()); } else { @@ -547,11 +552,16 @@ void Ogre2GpuRays::CreateSampleTexture() double max = this->AngleMax().Radian(); double vmin = this->VerticalAngleMin().Radian(); double vmax = this->VerticalAngleMax().Radian(); - double hStep = (max-min) / static_cast(this->dataPtr->w2nd-1); + + double hAngle = std::max(this->dataPtr->kMinAllowedAngle.Radian(), max - min); + double vAngle = std::max(this->dataPtr->kMinAllowedAngle.Radian(), + vmax - vmin); + + double hStep = hAngle / static_cast(this->dataPtr->w2nd-1); double vStep = 1.0; // non-planar case if (this->dataPtr->h2nd > 1) - vStep = (vmax-vmin) / static_cast(this->dataPtr->h2nd-1); + vStep = vAngle / static_cast(this->dataPtr->h2nd-1); // create an RGB texture (cubeUVTex) to pack info that tells the shaders how // to sample from the cubemap textures. diff --git a/test/integration/gpu_rays.cc b/test/integration/gpu_rays.cc index 0db85ec79..44eb54ed3 100644 --- a/test/integration/gpu_rays.cc +++ b/test/integration/gpu_rays.cc @@ -64,6 +64,9 @@ class GpuRaysTest: public testing::Test, // Test detection of particles public: void RaysParticles(const std::string &_renderEngine); + + // Test single ray box intersection + public: void SingleRay(const std::string &_renderEngine); }; ///////////////////////////////////////////////// @@ -150,7 +153,7 @@ void GpuRaysTest::Configure(const std::string &_renderEngine) void GpuRaysTest::RaysUnitBox(const std::string &_renderEngine) { #ifdef __APPLE__ - std::cerr << "Skipping test for apple, see issue #35." << std::endl; + ignerr << "Skipping test for apple, see issue #35." << std::endl; return; #endif @@ -335,7 +338,7 @@ void GpuRaysTest::RaysUnitBox(const std::string &_renderEngine) void GpuRaysTest::LaserVertical(const std::string &_renderEngine) { #ifdef __APPLE__ - std::cerr << "Skipping test for apple, see issue #35." << std::endl; + ignerr << "Skipping test for apple, see issue #35." << std::endl; return; #endif @@ -468,7 +471,7 @@ void GpuRaysTest::LaserVertical(const std::string &_renderEngine) void GpuRaysTest::RaysParticles(const std::string &_renderEngine) { #ifdef __APPLE__ - std::cerr << "Skipping test for apple, see issue #35." << std::endl; + ignerr << "Skipping test for apple, see issue #35." << std::endl; return; #endif @@ -677,6 +680,104 @@ void GpuRaysTest::RaysParticles(const std::string &_renderEngine) engine->DestroyScene(scene); rendering::unloadEngine(engine->Name()); } + +///////////////////////////////////////////////// +/// \brief Test single ray box intersection +void GpuRaysTest::SingleRay(const std::string &_renderEngine) +{ +#ifdef __APPLE__ + ignerr << "Skipping test for apple, see issue #35." << std::endl; + return; +#endif + + if (_renderEngine == "optix") + { + igndbg << "GpuRays not supported yet in rendering engine: " + << _renderEngine << std::endl; + return; + } + + // Test GPU single ray box intersection. + // Place GPU above box looking downwards + // ray should intersect with center of box + + const double hMinAngle = 0.0; + const double hMaxAngle = 0.0; + const double minRange = 0.05; + const double maxRange = 40.0; + const int hRayCount = 1; + const int vRayCount = 1; + + // create and populate scene + RenderEngine *engine = rendering::engine(_renderEngine); + if (!engine) + { + igndbg << "Engine '" << _renderEngine + << "' is not supported" << std::endl; + return; + } + + ScenePtr scene = engine->CreateScene("scene"); + ASSERT_TRUE(scene != nullptr); + + VisualPtr root = scene->RootVisual(); + + // Create first ray caster + ignition::math::Pose3d testPose(ignition::math::Vector3d(0, 0, 7), + ignition::math::Quaterniond(0, IGN_PI/2.0, 0)); + + GpuRaysPtr gpuRays = scene->CreateGpuRays("gpu_rays"); + gpuRays->SetWorldPosition(testPose.Pos()); + gpuRays->SetWorldRotation(testPose.Rot()); + gpuRays->SetNearClipPlane(minRange); + gpuRays->SetFarClipPlane(maxRange); + gpuRays->SetAngleMin(hMinAngle); + gpuRays->SetAngleMax(hMaxAngle); + gpuRays->SetRayCount(hRayCount); + + gpuRays->SetVerticalRayCount(vRayCount); + root->AddChild(gpuRays); + + // box in the center + ignition::math::Pose3d box01Pose(ignition::math::Vector3d(0, 0, 4.5), + ignition::math::Quaterniond::Identity); + VisualPtr visualBox1 = scene->CreateVisual("UnitBox1"); + visualBox1->AddGeometry(scene->CreateBox()); + visualBox1->SetWorldPosition(box01Pose.Pos()); + visualBox1->SetWorldRotation(box01Pose.Rot()); + root->AddChild(visualBox1); + + // Verify rays caster range readings + // listen to new gpu rays frames + unsigned int channels = gpuRays->Channels(); + float *scan = new float[hRayCount * vRayCount * channels]; + common::ConnectionPtr c = + gpuRays->ConnectNewGpuRaysFrame( + std::bind(&::OnNewGpuRaysFrame, scan, + std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, + std::placeholders::_4, std::placeholders::_5)); + + gpuRays->Update(); + + int mid = 0; + double unitBoxSize = 1.0; + double expectedRangeAtMidPointBox = testPose.Pos().Z() - + (abs(box01Pose.Pos().Z()) + unitBoxSize/2); + + // rays caster 1 should see box01 and box02 + EXPECT_NEAR(scan[mid], expectedRangeAtMidPointBox, LASER_TOL); + + c.reset(); + + delete [] scan; + + scan = nullptr; + + // Clean up + engine->DestroyScene(scene); + rendering::unloadEngine(engine->Name()); +} + ///////////////////////////////////////////////// TEST_P(GpuRaysTest, Configure) { @@ -701,6 +802,13 @@ TEST_P(GpuRaysTest, RaysParticles) RaysParticles(GetParam()); } +///////////////////////////////////////////////// +TEST_P(GpuRaysTest, SingleRay) +{ + SingleRay(GetParam()); +} + + INSTANTIATE_TEST_CASE_P(GpuRays, GpuRaysTest, RENDER_ENGINE_VALUES, ignition::rendering::PrintToStringParam()); From fa915839f207a46327136c8391951e809d79b246 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 9 Sep 2021 17:51:14 -0700 Subject: [PATCH 12/12] revert ABI workaround for IsRenderWindow Signed-off-by: Ian Chen --- .../ignition/rendering/ogre2/Ogre2RenderTarget.hh | 14 ++++---------- ogre2/src/Ogre2RenderTarget.cc | 5 ----- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2RenderTarget.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2RenderTarget.hh index 87201ad1f..0acd2d241 100644 --- a/ogre2/include/ignition/rendering/ogre2/Ogre2RenderTarget.hh +++ b/ogre2/include/ignition/rendering/ogre2/Ogre2RenderTarget.hh @@ -130,11 +130,8 @@ namespace ignition public: virtual Ogre::TextureGpu *RenderTarget() const = 0; /// \brief Returns true if this is a render window - /// TODO(anyone): this function should be virtual. - /// We didn't do it to preserve ABI. - /// Look in commit history for 'Ogre2IsRenderWindowABI' to - /// see changes made and revert - public: bool IsRenderWindow() const; + /// \return True if this render target is a render window + public: virtual bool IsRenderWindow() const; // Documentation inherited public: unsigned int GLIdImpl() const; @@ -287,11 +284,8 @@ namespace ignition // Documentation inherited. public: virtual void Destroy() override; - // TODO(anyone): this function should be virtual. - // We didn't do it to preserve ABI. - // Looks in commit history for '#Ogre2IsRenderWindowABI' to - // see changes made and revert - public: bool IsRenderWindow() const; + // Documentation inherited. + public: virtual bool IsRenderWindow() const; // Documentation inherited. public: virtual Ogre::TextureGpu *RenderTarget() const override; diff --git a/ogre2/src/Ogre2RenderTarget.cc b/ogre2/src/Ogre2RenderTarget.cc index b2fc62549..fd1d75c16 100644 --- a/ogre2/src/Ogre2RenderTarget.cc +++ b/ogre2/src/Ogre2RenderTarget.cc @@ -467,11 +467,6 @@ void Ogre2RenderTarget::Render() ////////////////////////////////////////////////// bool Ogre2RenderTarget::IsRenderWindow() const { - const Ogre2RenderWindow *asWindow = - dynamic_cast(this); - if (asWindow) - return true; - return false; }