46 class AutoParamDataSource;
73 public:
GpuLaser(
const std::string &_namePrefix,
74 Scene *_scene,
bool _autoRender =
true);
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);
127 const Ogre::Pass *_p,
const Ogre::AutoParamDataSource *_s,
128 const Ogre::LightList *_ll,
bool _supp);
131 private:
virtual void RenderImpl();
138 private:
void UpdateRenderTarget(Ogre::RenderTarget *_target,
139 Ogre::Material *_material,
141 bool _updateTex =
false);
144 private:
void CreateOrthoCam();
147 private:
void CreateMesh();
150 private:
void CreateCanvas();
160 private: Ogre::Matrix4 BuildScaledOrthoMatrix(
float _left,
float _right,
161 float _bottom,
float _top,
float _near,
float _far);
166 private:
virtual void Set1stPassTarget(Ogre::RenderTarget *_target,
167 unsigned int _index);
171 private:
virtual void Set2ndPassTarget(Ogre::RenderTarget *_target);
173 private:
event::EventT<void(
const float *,
unsigned int,
unsigned int,
174 unsigned int,
const std::string &)> newLaserFrame;
176 private:
float *laserBuffer;
177 private:
float *laserScan;
178 private: Ogre::Material *mat_1st_pass;
179 private: Ogre::Material *mat_2nd_pass;
181 private: Ogre::Texture *_1stPassTextures[3];
182 private: Ogre::Texture *_2ndPassTexture;
183 private: Ogre::RenderTarget *_1stPassTargets[3];
184 private: Ogre::RenderTarget *_2ndPassTarget;
185 private: Ogre::Viewport *_1stPassViewports[3];
186 private: Ogre::Viewport *_2ndPassViewport;
188 private:
unsigned int _textureCount;
189 private:
double cameraYaws[4];
191 private: Ogre::RenderTarget *current_target;
192 private: Ogre::Material *current_mat;
194 private: Ogre::Camera *orthoCam;
196 private: Ogre::SceneNode *origParentNode_ortho;
197 private: Ogre::SceneNode *pitchNode_ortho;
201 private: Ogre::MovableObject *object;
205 private:
unsigned int w2nd;
206 private:
unsigned int h2nd;
209 private:
double lastRenderDuration;
211 private: std::vector<int> texIdx;
212 private:
static int texCount;