Skip to content

Commit

Permalink
Ogre 1.12.10 upgrade (#878)
Browse files Browse the repository at this point in the history
* Upgrade to OGRE 1.12.10

Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
ijnek committed Aug 2, 2022
1 parent 1ee274d commit 4e976dc
Show file tree
Hide file tree
Showing 90 changed files with 236 additions and 124 deletions.
2 changes: 1 addition & 1 deletion rviz_common/include/rviz_common/frame_manager_iface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#pragma clang diagnostic ignored "-Wkeyword-macro"
#endif

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>

#ifdef __clang__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define RVIZ_COMMON__FRAME_POSITION_TRACKING_VIEW_CONTROLLER_HPP_

#include <OgreQuaternion.h>
#include <OgreVector3.h>
#include <OgreVector.h>

#include "rviz_common/view_controller.hpp"
#include "rviz_common/visibility_control.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class SelectionRenderer
~SelectionRenderer() override = default;

RVIZ_COMMON_PUBLIC
virtual void initialize(Ogre::Camera * camera, Ogre::SceneManager * scene_manager);
virtual void initialize(Ogre::Camera * camera);

RVIZ_COMMON_PUBLIC
virtual void render(
Expand Down Expand Up @@ -160,7 +160,7 @@ class SelectionRenderer
rviz_common::DisplayContext * context_;

Ogre::Camera * camera_;
Ogre::SceneManager * scene_manager_;
Ogre::SceneNode * camera_node_;

Ogre::MaterialPtr fallback_pick_material_;
Ogre::Technique * fallback_pick_technique_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include <OgreMaterialManager.h>
#include <OgreRenderQueueListener.h>
#include <OgreVector3.h>
#include <OgreVector.h>

#include <QObject> // NOLINT: cpplint is unable to handle the include order here

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <vector>

#include <OgreVector3.h>
#include <OgreVector.h>

#include "rviz_common/visibility_control.hpp"

Expand Down
2 changes: 1 addition & 1 deletion rviz_common/include/rviz_common/msg_conversions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef RVIZ_COMMON__MSG_CONVERSIONS_HPP_
#define RVIZ_COMMON__MSG_CONVERSIONS_HPP_

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>

#include "geometry_msgs/msg/point.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef RVIZ_COMMON__PROPERTIES__VECTOR_PROPERTY_HPP_
#define RVIZ_COMMON__PROPERTIES__VECTOR_PROPERTY_HPP_

#include <OgreVector3.h>
#include <OgreVector.h>

#include "rviz_common/properties/property.hpp"
#include "rviz_common/visibility_control.hpp"
Expand Down
2 changes: 1 addition & 1 deletion rviz_common/include/rviz_common/render_panel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <mutex>
#include <vector>

#include <OgreVector3.h>
#include <OgreVector.h>

#include <QWidget> // NOLINT: cpplint is unable to handle the include order here

Expand Down
2 changes: 1 addition & 1 deletion rviz_common/include/rviz_common/validate_floats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <cmath>
#include <vector>

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>

#include "geometry_msgs/msg/point_stamped.hpp"
Expand Down
2 changes: 1 addition & 1 deletion rviz_common/include/rviz_common/view_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <string>

#include <OgreVector3.h>
#include <OgreVector.h>

#include <QCursor> // NOLINT: cpplint is unable to handle the include order here
#include <QMap> // NOLINT: cpplint is unable to handle the include order here
Expand Down
2 changes: 1 addition & 1 deletion rviz_common/src/rviz_common/frame_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <string>
#include <vector>

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>

#include <QObject> // NOLINT: cpplint is unable to handle the include order here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ void SelectionManager::initialize()

// create picking camera
camera_ = scene_manager->createCamera(name + "_camera");
auto camera_node = scene_manager->getRootSceneNode()->createChildSceneNode();
camera_node->attachObject(camera_);

renderer_->initialize(camera_, scene_manager);
renderer_->initialize(camera_);

handler_manager_ = context_->getHandlerManager();
handler_manager_->addListener(this);
Expand Down
10 changes: 5 additions & 5 deletions rviz_common/src/rviz_common/interaction/selection_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ namespace interaction
SelectionRenderer::SelectionRenderer(rviz_common::DisplayContext * context)
: context_(context),
camera_(nullptr),
scene_manager_(nullptr)
camera_node_(nullptr)
{}

void SelectionRenderer::initialize(Ogre::Camera * camera, Ogre::SceneManager * scene_manager)
void SelectionRenderer::initialize(Ogre::Camera * camera)
{
camera_ = camera;
scene_manager_ = scene_manager;
camera_node_ = camera_->getParentSceneNode();

fallback_pick_material_ = Ogre::MaterialManager::getSingleton().getByName(
"rviz/DefaultPickAndDepth");
Expand Down Expand Up @@ -165,8 +165,8 @@ void SelectionRenderer::configureCamera(

camera_->setCustomProjectionMatrix(true, scale_matrix * trans_matrix * proj_matrix);

camera_->setPosition(viewport->getCamera()->getDerivedPosition());
camera_->setOrientation(viewport->getCamera()->getDerivedOrientation());
camera_node_->setPosition(viewport->getCamera()->getDerivedPosition());
camera_node_->setOrientation(viewport->getCamera()->getDerivedOrientation());
}

float SelectionRenderer::getRelativeCoordinate(float coordinate, int dimension) const
Expand Down
6 changes: 4 additions & 2 deletions rviz_common/src/rviz_common/interaction/view_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <OgreSceneNode.h>
#include <OgreTextureManager.h>
#include <OgreViewport.h>
#include <OgreVector3.h>
#include <OgreVector.h>

#include "rviz_common/logging.hpp"

Expand Down Expand Up @@ -80,8 +80,10 @@ void ViewPicker::initialize()
auto scene_manager = context_->getSceneManager();

camera_ = scene_manager->createCamera("ViewPicker_camera");
auto camera_node = scene_manager->getRootSceneNode()->createChildSceneNode();
camera_node->attachObject(camera_);

renderer_->initialize(camera_, scene_manager);
renderer_->initialize(camera_);

handler_manager_ = context_->getHandlerManager();
}
Expand Down
17 changes: 11 additions & 6 deletions rviz_common/src/rviz_common/render_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,22 @@ void RenderPanel::initialize(DisplayContext * context, bool use_main_scene)
context_ = context;

if (use_main_scene) {
Ogre::SceneManager * scene_manager = context_->getSceneManager();

rviz_rendering::RenderWindowOgreAdapter::setSceneManager(
render_window_, context_->getSceneManager());
render_window_, scene_manager);
std::string camera_name;
static int count = 0;
camera_name = "RenderPanelCamera" + std::to_string(count++);
auto default_camera_ = context_->getSceneManager()->createCamera(camera_name);
default_camera_->setNearClipDistance(0.01f);
default_camera_->setPosition(default_camera_pose_);
default_camera_->lookAt(Ogre::Vector3(0, 0, 0));
auto default_camera = scene_manager->createCamera(camera_name);
default_camera->setNearClipDistance(0.01f);

auto camera_node = scene_manager->getRootSceneNode()->createChildSceneNode();
camera_node->attachObject(default_camera);
camera_node->setPosition(default_camera_pose_);
camera_node->lookAt(Ogre::Vector3(0, 0, 0), Ogre::Node::TS_WORLD);

rviz_rendering::RenderWindowOgreAdapter::setOgreCamera(render_window_, default_camera_);
rviz_rendering::RenderWindowOgreAdapter::setOgreCamera(render_window_, default_camera);
}
// scene_manager_ = scene_manager;
// scene_manager_->addListener(this);
Expand Down
4 changes: 2 additions & 2 deletions rviz_common/src/rviz_common/visualization_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ void VisualizationManager::onUpdate()
view_manager_->getCurrent() &&
view_manager_->getCurrent()->getCamera())
{
using rviz_rendering::RenderWindowOgreAdapter;
RenderWindowOgreAdapter::getDirectionalLight(render_panel_->getRenderWindow())->setDirection(
rviz_rendering::RenderWindowOgreAdapter::setDirectionalLightDirection(
render_panel_->getRenderWindow(),
view_manager_->getCurrent()->getCamera()->getDerivedDirection());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <thread>
#include <vector>

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <vector>

#include <OgreRay.h>
#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>
#include <OgreSceneManager.h>
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include <OgreTexture.h>
#include <OgreMaterial.h>
#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreSharedPtr.h>

#endif // Q_MOC_RUN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <string>
#include <utility>

#include <OgreVector3.h>
#include <OgreVector.h>

#include "visualization_msgs/msg/marker.hpp"
#include "rclcpp/rclcpp.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <QObject> // NOLINT

#ifndef Q_MOC_RUN
#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreColourValue.h>

#include "sensor_msgs/msg/point_cloud2.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <OgreManualObject.h>
#include <OgreMaterialManager.h>
#include <OgreSceneNode.h>
#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>

#include "rviz_default_plugins/displays/pose_array/pose_array_display.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <memory>
#include <string>

#include <OgreVector3.h>
#include <OgreVector.h>

#include "std_msgs/msg/string.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <vector>

#include <OgreQuaternion.h>
#include <OgreVector3.h>
#include <OgreVector.h>

#include "geometry_msgs/msg/transform_stamped.hpp"
#include "tf2/exceptions.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <string>

#include <OgreVector3.h>
#include <OgreVector.h>

#include "rviz_common/properties/status_property.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <string>
#include <map>

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>
#include <OgreAny.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <string>
#include <vector>

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>
#include <OgreSceneNode.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#ifndef Q_MOC_RUN

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>
#include <OgreAny.h>
#include <OgreMaterial.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#ifndef Q_MOC_RUN

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>
#include <OgreAny.h>
#include <OgreMaterial.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#include <QCursor> // NOLINT cpplint cannot handle include order

#include <OgreVector3.h>
#include <OgreVector.h>

#include "rviz_common/tool.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef RVIZ_DEFAULT_PLUGINS__TOOLS__POINT__POINT_TOOL_HPP_
#define RVIZ_DEFAULT_PLUGINS__TOOLS__POINT__POINT_TOOL_HPP_

#include <OgreVector3.h>
#include <OgreVector.h>

#include <QCursor> // NOLINT cpplint cannot handle the include order here
#include <QObject> // NOLINT cpplint cannot handle the include order here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <string>
#include <utility>

#include <OgreVector3.h>
#include <OgreVector.h>

#include <QCursor> // NOLINT cpplint cannot handle include order here

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <string>
#include <vector>

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>

#include "rviz_common/transformation/frame_transformer.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef RVIZ_DEFAULT_PLUGINS__VIEW_CONTROLLERS__FOLLOWER__THIRD_PERSON_FOLLOWER_VIEW_CONTROLLER_HPP_
#define RVIZ_DEFAULT_PLUGINS__VIEW_CONTROLLERS__FOLLOWER__THIRD_PERSON_FOLLOWER_VIEW_CONTROLLER_HPP_

#include <OgreVector3.h>
#include <OgreVector.h>

#include "rviz_default_plugins/view_controllers/xy_orbit/xy_orbit_view_controller.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# pragma clang diagnostic ignored "-Wkeyword-macro"
#endif

#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreQuaternion.h>

#ifdef __clang__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <memory>

#include <OgreVector3.h>
#include <OgreVector.h>

#include <QCursor> // NOLINT(build/include_order)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#endif

#include <OgreRay.h>
#include <OgreVector3.h>
#include <OgreVector.h>

#ifdef __clang__
# pragma clang diagnostic pop
Expand Down
Loading

0 comments on commit 4e976dc

Please sign in to comment.