46 class AutoParamDataSource;
73 public:
GpuLaser(
const std::string &_namePrefix,
74 ScenePtr _scene,
bool _autoRender =
true);
80 public:
virtual void Load(sdf::ElementPtr &_sdf);
83 public:
virtual void Load();
86 public:
virtual void Init();
89 public:
virtual void Fini();
106 public:
template<
typename T>
108 {
return newLaserFrame.
Connect(_subscriber); }
118 public:
void SetRangeCount(
unsigned int _w,
unsigned int _h = 1);
123 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
124 const Ogre::LightList *_ll,
bool _supp);
216 private:
virtual void RenderImpl();
223 private:
void UpdateRenderTarget(Ogre::RenderTarget *_target,
224 Ogre::Material *_material,
226 bool _updateTex =
false);
229 private:
void CreateOrthoCam();
232 private:
void CreateMesh();
235 private:
void CreateCanvas();
245 private: Ogre::Matrix4 BuildScaledOrthoMatrix(
float _left,
float _right,
246 float _bottom,
float _top,
float _near,
float _far);
251 private:
virtual void Set1stPassTarget(Ogre::RenderTarget *_target,
252 unsigned int _index);
256 private:
virtual void Set2ndPassTarget(Ogre::RenderTarget *_target);
297 private:
event::EventT<void(
const float *_frame,
unsigned int _width,
298 unsigned int _height,
unsigned int _depth,
299 const std::string &_format)> newLaserFrame;
302 private:
float *laserBuffer;
305 private:
float *laserScan;
308 private: Ogre::Material *matFirstPass;
311 private: Ogre::Material *matSecondPass;
314 private: Ogre::Texture *firstPassTextures[3];
317 private: Ogre::Texture *secondPassTexture;
320 private: Ogre::RenderTarget *firstPassTargets[3];
323 private: Ogre::RenderTarget *secondPassTarget;
326 private: Ogre::Viewport *firstPassViewports[3];
329 private: Ogre::Viewport *secondPassViewport;
332 private:
unsigned int textureCount;
335 private:
double cameraYaws[4];
338 private: Ogre::RenderTarget *currentTarget;
341 private: Ogre::Material *currentMat;
345 private: Ogre::Camera *orthoCam;
348 private: Ogre::SceneNode *pitchNodeOrtho;
355 private: Ogre::MovableObject *object;
361 private:
unsigned int w2nd;
364 private:
unsigned int h2nd;
367 private:
double lastRenderDuration;
371 private: std::vector<int> texIdx;
374 private:
static int texCount;