Skip to content

Commit

Permalink
support Ogre 1.12
Browse files Browse the repository at this point in the history
OgreTechnique and Overlay are only forward declared in some headers now.

`SimpleRenderable::setMaterial` requires a MaterialPtr from 1.12.
The std::string overload was deprecated in 1.10.
  • Loading branch information
v4hn committed Nov 18, 2024
1 parent 54b1406 commit 73fb2b3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions jsk_rviz_plugins/src/camera_info_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <OGRE/OgreSceneManager.h>
#include <OGRE/OgreTextureManager.h>
#include <OGRE/OgreTexture.h>
#include <OGRE/OgreTechnique.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <image_transport/subscriber.h>
Expand Down
8 changes: 8 additions & 0 deletions jsk_rviz_plugins/src/overlay_camera_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ void OverlayCameraDisplay::onInitialize()

bg_screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND);
bg_screen_rect_->setBoundingBox(aabInf);
#if ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH) < ((1 << 16) | (10 << 8) | 0)
bg_screen_rect_->setMaterial(bg_material_->getName());
#else
bg_screen_rect_->setMaterial(bg_material_);
#endif

bg_scene_node_->attachObject(bg_screen_rect_);
bg_scene_node_->setVisible(false);
Expand All @@ -217,7 +221,11 @@ void OverlayCameraDisplay::onInitialize()

fg_material_ = bg_material_->clone( ss.str()+"fg" );
fg_screen_rect_->setBoundingBox(aabInf);
#if ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH) < ((1 << 16) | (10 << 8) | 0)
fg_screen_rect_->setMaterial(fg_material_->getName());
#else
fg_screen_rect_->setMaterial(fg_material_);
#endif

fg_material_->setSceneBlending( Ogre::SBT_TRANSPARENT_ALPHA );
fg_screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY - 1);
Expand Down
1 change: 1 addition & 0 deletions jsk_rviz_plugins/src/overlay_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <OGRE/OgreOverlayContainer.h>
#include <OGRE/OgreOverlayManager.h>
#else
#include <OGRE/Overlay/OgreOverlay.h>
#include <OGRE/Overlay/OgrePanelOverlayElement.h>
#include <OGRE/Overlay/OgreOverlayElement.h>
#include <OGRE/Overlay/OgreOverlayContainer.h>
Expand Down
1 change: 1 addition & 0 deletions jsk_rviz_plugins/src/polygon_array_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <OGRE/OgreSceneNode.h>
#include <OGRE/OgreManualObject.h>
#include <OGRE/OgreMaterialManager.h>
#include <OGRE/OgreTechnique.h>
#include <rviz/properties/color_property.h>
#include <rviz/properties/bool_property.h>
#include <rviz/properties/enum_property.h>
Expand Down

0 comments on commit 73fb2b3

Please sign in to comment.