26 #ifndef _PROJECTOR_HH_
27 #define _PROJECTOR_HH_
37 #include "transport/transport.hh"
64 public:
void Load(
const msgs::Projector &_msg);
73 public:
void Load(
const std::string &_name,
75 const std::string &_textureName =
"",
76 double _nearClip = 0.25,
77 double _farClip = 15.0,
78 double _fov = M_PI * 0.25);
82 public:
void SetTexture(
const std::string &_textureName);
95 private:
void OnMsg(ConstProjectorPtr &_msg);
105 private:
class ProjectorFrameListener :
public Ogre::FrameListener
108 public: ProjectorFrameListener();
111 public:
virtual ~ProjectorFrameListener();
114 const std::string &_textureName,
117 double _fov = 0.785398163);
119 public:
virtual bool frameStarted(
const Ogre::FrameEvent &_evt);
121 public:
void SetTexture(
const std::string &_textureName);
124 public:
void SetUsingShaders(
bool _usingShaders);
126 public:
void SetPose(
const math::Pose &_pose);
128 private:
void SetSceneNode();
130 private:
void SetFrustumClipDistance(
double _near,
double _far);
131 private:
void SetFrustumFOV(
double _fov);
132 private:
void AddPassToAllMaterials();
133 private:
void AddPassToVisibleMaterials();
134 private:
void AddPassToMaterials(std::list<std::string> &_matList);
135 private:
void AddPassToMaterial(
const std::string &_matName);
136 private:
void RemovePassFromMaterials();
137 private:
void RemovePassFromMaterial(
const std::string &_matName);
139 public:
bool enabled;
140 public:
bool initialized;
141 private:
bool usingShaders;
143 private: std::string nodeName;
144 private: std::string filterNodeName;
146 private: std::string textureName;
148 private: Ogre::Frustum *frustum;
149 private: Ogre::Frustum *filterFrustum;
150 private: Ogre::PlaneBoundedVolumeListSceneQuery *projectorQuery;
154 private: Ogre::SceneNode *node;
155 private: Ogre::SceneNode *filterNode;
156 private: Ogre::SceneManager *sceneMgr;
157 private: std::map<std::string, Ogre::Pass*> projectorTargets;
162 private: ProjectorFrameListener projector;