$search
00001 /****************************************************************************** 00002 * \file 00003 * 00004 * $Id: static_text.h 555 2012-04-11 14:32:26Z xlokaj03 $ 00005 * 00006 * Copyright (C) Brno University of Technology 00007 * 00008 * This file is part of software developed by dcgm-robotics@FIT group. 00009 * 00010 * Author: Tomas Lokaj (xlokaj03@stud.fit.vutbr.cz) 00011 * Supervised by: Michal Spanel (spanel@fit.vutbr.cz) 00012 * Date: 28/03/2012 00013 * 00014 * This file is free software: you can redistribute it and/or modify 00015 * it under the terms of the GNU Lesser General Public License as published by 00016 * the Free Software Foundation, either version 3 of the License, or 00017 * (at your option) any later version. 00018 * 00019 * This file is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 * GNU Lesser General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public License 00025 * along with this file. If not, see <http://www.gnu.org/licenses/>. 00026 */ 00027 00028 #pragma once 00029 #ifndef STATIC_TEXT_H_ 00030 #define STATIC_TEXT_H_ 00031 00032 #include <ogre_tools/movable_text.h> 00033 00034 namespace ogre_tools 00035 { 00042 class StaticText : public MovableText 00043 { 00044 public: 00052 StaticText(const Ogre::String &caption, const Ogre::String &fontName = "Arial", Ogre::Real charHeight = 1.0, 00053 const Ogre::ColourValue &color = Ogre::ColourValue::White) : 00054 MovableText(caption, fontName, charHeight, color) 00055 { 00056 } 00057 00058 protected: 00062 void getWorldTransforms(Ogre::Matrix4 *xform) const 00063 { 00064 if (this->isVisible()) 00065 { 00066 Ogre::Matrix3 rot3x3 = Ogre::Matrix3::IDENTITY; 00067 00068 // store rotation in a matrix 00069 mParentNode->_getDerivedOrientation().ToRotationMatrix(rot3x3); 00070 00071 // parent node position 00072 Ogre::Vector3 ppos = mParentNode->_getDerivedPosition() + Ogre::Vector3::UNIT_Y * mGlobalTranslation; 00073 ppos += rot3x3 * mLocalTranslation; 00074 00075 *xform = rot3x3; 00076 xform->setTrans(ppos); 00077 } 00078 } 00079 00080 }; 00081 00082 } 00083 00084 #endif /* STATIC_TEXT_H_ */