17 #ifndef GAZEBO_RENDERING_PROJECTOR_HH_
18 #define GAZEBO_RENDERING_PROJECTOR_HH_
24 #include <ignition/math/Pose3.hh>
26 #include <ignition/transport/Node.hh>
31 #include "gazebo/transport/transport.hh"
55 public:
void Load(sdf::ElementPtr _sdf);
59 public:
void Load(
const msgs::Projector &_msg);
68 public:
void Load(
const std::string &_name,
69 const ignition::math::Pose3d &_pose =
70 ignition::math::Pose3d::Zero,
71 const std::string &_textureName =
"",
72 const double _nearClip = 0.25,
73 const double _farClip = 15.0,
74 const double _fov = IGN_PI * 0.25);
85 #pragma GCC diagnostic push
86 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
88 public:
void Load(
const std::string &_name,
90 const std::string &_textureName =
"",
91 double _nearClip = 0.25,
92 double _farClip = 15.0,
95 #pragma GCC diagnostic pop
100 public:
void SetTexture(
const std::string &_textureName);
103 public:
void Toggle();
111 public:
void SetEnabled(
bool _enabled);
113 private:
void OnMsg(ConstProjectorPtr &_msg);
123 private:
class ProjectorFrameListener :
public Ogre::FrameListener
126 public: ProjectorFrameListener();
129 public:
virtual ~ProjectorFrameListener();
132 const std::string &_textureName,
135 double _fov = 0.785398163);
137 public:
virtual bool frameStarted(
const Ogre::FrameEvent &_evt);
139 public:
void SetTexture(
const std::string &_textureName);
141 public:
void SetEnabled(
bool _enabled);
142 public:
void SetUsingShaders(
bool _usingShaders);
149 public:
void SetPose(
const ignition::math::Pose3d &_pose);
151 private:
void SetSceneNode();
153 private:
void SetFrustumClipDistance(
double _near,
double _far);
154 private:
void SetFrustumFOV(
double _fov);
155 private:
void AddPassToAllMaterials();
156 private:
void AddPassToVisibleMaterials();
157 private:
void AddPassToMaterials(std::list<std::string> &_matList);
158 private:
void AddPassToMaterial(
const std::string &_matName);
159 private:
void RemovePassFromMaterials();
160 private:
void RemovePassFromMaterial(
const std::string &_matName);
162 public:
bool enabled;
163 public:
bool initialized;
164 private:
bool usingShaders;
166 private: std::string nodeName;
167 private: std::string filterNodeName;
169 private: std::string textureName;
171 private: Ogre::Frustum *frustum;
172 private: Ogre::Frustum *filterFrustum;
173 private: Ogre::PlaneBoundedVolumeListSceneQuery *projectorQuery;
177 private: Ogre::SceneNode *node;
178 private: Ogre::SceneNode *filterNode;
179 private: Ogre::SceneManager *sceneMgr;
180 private: std::map<std::string, Ogre::Pass*> projectorTargets;
185 private: ProjectorFrameListener projector;
191 private: ignition::transport::Node nodeIgn;
Encapsulates a position and rotation in three space.
Definition: Pose.hh:42
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
Projects a material onto surface, light a light projector.
Definition: Projector.hh:44
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:113
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.