22 #ifndef _MOVABLETEXT_HH_
23 #define _MOVABLETEXT_HH_
37 class recursive_mutex;
50 :
public Ogre::MovableObject,
public Ogre::Renderable
82 public:
void Load(
const std::string &_name,
83 const std::string &_text,
84 const std::string &_fontName =
"Arial",
85 float _charHeight = 1.0,
90 public:
void SetFontName(
const std::string &_font);
94 public:
const std::string &GetFont()
const;
98 public:
void SetText(
const std::string &_text);
102 public:
const std::string &GetText()
const;
114 public:
void SetCharHeight(
float _height);
118 public:
float GetCharHeight()
const;
122 public:
void SetSpaceWidth(
float _width);
126 public:
float GetSpaceWidth()
const;
131 public:
void SetTextAlignment(
const HorizAlign &_hAlign,
132 const VertAlign &_vAlign);
136 public:
void SetBaseline(
float _height);
140 public:
float GetBaseline()
const;
145 public:
void SetShowOnTop(
bool _show);
149 public:
bool GetShowOnTop()
const;
156 public:
void Update();
163 public:
virtual void visitRenderables(Ogre::Renderable::Visitor* _visitor,
164 bool _debug =
false);
168 protected:
void _setupGeometry();
172 protected:
void _updateColors();
176 protected:
void getWorldTransforms(Ogre::Matrix4 *xform)
const;
180 protected:
float getBoundingRadius()
const;
184 protected:
float getSquaredViewDepth(
const Ogre::Camera *cam)
const;
187 private:
const Ogre::Quaternion &getWorldOrientation(
void)
const;
189 private:
const Ogre::Vector3 &getWorldPosition(
void)
const;
191 private:
const Ogre::AxisAlignedBox &getBoundingBox(
void)
const;
193 private:
const Ogre::String &getMovableType()
const;
196 private:
void _notifyCurrentCamera(Ogre::Camera *cam);
199 private:
void _updateRenderQueue(Ogre::RenderQueue* queue);
203 protected:
void getRenderOperation(Ogre::RenderOperation &op);
207 protected:
const Ogre::MaterialPtr &getMaterial(
void)
const;
211 protected:
const Ogre::LightList &getLights(
void)
const;
213 private: std::string fontName;
214 private: std::string text;
217 private: Ogre::RenderOperation renderOp;
218 private: Ogre::AxisAlignedBox *aabb;
219 private: Ogre::LightList lightList;
221 private:
float charHeight;
223 private:
bool needUpdate;
225 private:
float radius;
227 private: Ogre::Camera *camera;
228 private: Ogre::RenderWindow *renderWindow;
229 private: Ogre::Font *font;
230 private: Ogre::MaterialPtr material;
231 private: Ogre::MaterialPtr backgroundMaterial;
233 private:
float viewportAspectCoef;
234 private:
float spaceWidth;
235 private:
bool updateColors;
236 private: VertAlign vertAlign;
237 private: HorizAlign horizAlign;
239 private:
float baseline;
243 private: boost::recursive_mutex *mutex;
244 private: Ogre::SimpleRenderable *renderable;
Movable text.
Definition: MovableText.hh:49
static const Color White
(1, 1, 1)
Definition: Color.hh:39
Mathematical representation of a box and related functions.
Definition: Box.hh:35
Left alignment.
Definition: MovableText.hh:56
Align below.
Definition: MovableText.hh:65
#define GZ_RENDERING_VISIBLE
Definition: system.hh:209
VertAlign
vertical alignment
Definition: MovableText.hh:63
HorizAlign
Horizontal alignment.
Definition: MovableText.hh:54
Forward declarations for the math classes.
Defines a color.
Definition: Color.hh:36