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);
78 public:
void SetTexture(
const std::string &_textureName);
81 public:
void Toggle();
89 public:
void SetEnabled(
bool _enabled);
91 private:
void OnMsg(ConstProjectorPtr &_msg);
101 private:
class ProjectorFrameListener :
public Ogre::FrameListener
104 public: ProjectorFrameListener();
107 public:
virtual ~ProjectorFrameListener();
110 const std::string &_textureName,
113 double _fov = 0.785398163);
115 public:
virtual bool frameStarted(
const Ogre::FrameEvent &_evt);
117 public:
void SetTexture(
const std::string &_textureName);
119 public:
void SetEnabled(
bool _enabled);
120 public:
void SetUsingShaders(
bool _usingShaders);
124 public:
void SetPose(
const ignition::math::Pose3d &_pose);
126 private:
void SetSceneNode();
128 private:
void SetFrustumClipDistance(
double _near,
double _far);
129 private:
void SetFrustumFOV(
double _fov);
130 private:
void AddPassToAllMaterials();
131 private:
void AddPassToVisibleMaterials();
132 private:
void AddPassToMaterials(std::list<std::string> &_matList);
133 private:
void AddPassToMaterial(
const std::string &_matName);
134 private:
void RemovePassFromMaterials();
135 private:
void RemovePassFromMaterial(
const std::string &_matName);
137 public:
bool enabled;
138 public:
bool initialized;
139 private:
bool usingShaders;
141 private: std::string nodeName;
142 private: std::string filterNodeName;
144 private: std::string textureName;
146 private: Ogre::Frustum *frustum;
147 private: Ogre::Frustum *filterFrustum;
148 private: Ogre::PlaneBoundedVolumeListSceneQuery *projectorQuery;
152 private: Ogre::SceneNode *node;
153 private: Ogre::SceneNode *filterNode;
154 private: Ogre::SceneManager *sceneMgr;
155 private: std::map<std::string, Ogre::Pass*> projectorTargets;
160 private: ProjectorFrameListener projector;
166 private: ignition::transport::Node nodeIgn;
Forward declarations for the common classes.
Definition: Animation.hh:26
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
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.