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);
101 private:
class ProjectorFrameListener :
public Ogre::FrameListener
103 public: ProjectorFrameListener();
104 public:
virtual ~ProjectorFrameListener();
106 const std::string &_textureName,
109 double _fov = 0.785398163);
111 public:
bool frameStarted(
const Ogre::FrameEvent &_evt);
113 public:
void SetTexture(
const std::string &_textureName);
116 public:
void SetUsingShaders(
bool _usingShaders);
118 public:
void SetPose(
const math::Pose &_pose);
120 private:
void SetSceneNode();
122 private:
void SetFrustumClipDistance(
double _near,
double _far);
123 private:
void SetFrustumFOV(
double _fov);
124 private:
void AddPassToAllMaterials();
125 private:
void AddPassToVisibleMaterials();
126 private:
void AddPassToMaterials(std::list<std::string> &_matList);
127 private:
void AddPassToMaterial(
const std::string &_matName);
128 private:
void RemovePassFromMaterials();
129 private:
void RemovePassFromMaterial(
const std::string &_matName);
131 public:
bool enabled;
132 public:
bool initialized;
133 private:
bool usingShaders;
135 private: std::string nodeName;
136 private: std::string filterNodeName;
138 private: std::string textureName;
140 private: Ogre::Frustum *frustum;
141 private: Ogre::Frustum *filterFrustum;
142 private: Ogre::PlaneBoundedVolumeListSceneQuery *projectorQuery;
146 private: Ogre::SceneNode *node;
147 private: Ogre::SceneNode *filterNode;
148 private: Ogre::SceneManager *sceneMgr;
149 private: std::map<std::string, Ogre::Pass*> projectorTargets;
152 private: ProjectorFrameListener projector;