46 class AutoParamDataSource;
75 public:
GpuLaser(
const std::string &_namePrefix,
76 Scene *_scene,
bool _autoRender =
true);
109 public:
template<
typename T>
111 {
return newLaserFrame.
Connect(_subscriber); }
121 public:
void SetRangeCount(
unsigned int _w,
unsigned int _h = 1);
130 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
131 const Ogre::LightList *_ll,
bool _supp);
134 private:
virtual void RenderImpl();
136 private:
void UpdateRenderTarget(Ogre::RenderTarget *target,
137 Ogre::Material *material,
139 bool updateTex =
false);
141 private:
void CreateOrthoCam();
143 private:
void CreateMesh();
145 private:
void CreateCanvas();
147 private: Ogre::Matrix4 BuildScaledOrthoMatrix(
float left,
float right,
148 float bottom,
float top,
float near,
float far);
150 private:
virtual void Set1stPassTarget(Ogre::RenderTarget *target,
153 private:
virtual void Set2ndPassTarget(Ogre::RenderTarget *target);
155 private:
event::EventT<void(
const float *,
unsigned int,
unsigned int,
156 unsigned int,
const std::string &)> newLaserFrame;
158 private:
float *laserBuffer;
159 private:
float *laserScan;
160 private: Ogre::Material *mat_1st_pass;
161 private: Ogre::Material *mat_2nd_pass;
163 private: Ogre::Texture *_1stPassTextures[3];
164 private: Ogre::Texture *_2ndPassTexture;
165 private: Ogre::RenderTarget *_1stPassTargets[3];
166 private: Ogre::RenderTarget *_2ndPassTarget;
167 private: Ogre::Viewport *_1stPassViewports[3];
168 private: Ogre::Viewport *_2ndPassViewport;
170 private:
unsigned int _textureCount;
171 private:
double cameraYaws[4];
173 private: Ogre::RenderTarget *current_target;
174 private: Ogre::Material *current_mat;
176 private: Ogre::Camera *orthoCam;
178 private: Ogre::SceneNode *origParentNode_ortho;
179 private: Ogre::SceneNode *pitchNode_ortho;
183 private: Ogre::MovableObject *object;
187 private:
unsigned int w2nd;
188 private:
unsigned int h2nd;
191 private:
double lastRenderDuration;
193 private: std::vector<int> texIdx;
194 private:
static int texCount;