Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OgreVisibleObject.h
Go to the documentation of this file.
1 // Copyright (C) 2004-2014 Dylan Blair
3 //
4 // email: dblair@alumni.cs.utexas.edu
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 
21 #ifndef OGRE_VISIBLE_OBJECT_H
22 #define OGRE_VISIBLE_OBJECT_H
23 
24 #include "OgreCoreDLL.h"
25 
26 #include "../Core_LIB/CVisibleObject.h"
27 #include "../Graphics_LIB/GUtils.h"
28 #include "../Graphics_LIB/GObjectTextDisplay.h"
29 
30 namespace OpenSkyNet {
31  namespace OgreCore {
34  private:
35  static Ogre::Vector3 _camSpaceOffset;
36  static Ogre::Vector3 _worldSpaceOffset;
37  protected:
38  Ogre::SceneNode* _renderNode;
40  std::vector<std::string> _materialNames;
41  public:
42  static inline void setCamSpaceOffset(const Ogre::Vector3 &camSpaceOffset_) {
43  _camSpaceOffset = camSpaceOffset_;
44  _worldSpaceOffset = _camSpaceOffset*-1.0;
45  }
46 
47  static inline const Ogre::Vector3& getCamSpaceOffset() { return _camSpaceOffset; }
48 
49  static inline const Ogre::Vector3& getWorldSpaceOffset() { return _worldSpaceOffset; }
50 
51  OgreVisibleObject(Ogre::SceneNode* renderNode_);
52 
53  OgreVisibleObject(Ogre::SceneNode* renderNode_, const Math::Point<>& pos_, const Math::Matrix3x3& rot_);
54 
55  OgreVisibleObject(Ogre::SceneNode* renderNode_, const Ogre::Vector3& pos_, const Ogre::Quaternion& rot_);
56 
57  virtual ~OgreVisibleObject();
58 
59  inline const Ogre::SceneNode* getRenderNode() const { return _renderNode; }
60  inline Ogre::SceneNode* getRenderNode() { return _renderNode; }
61 
62  virtual Math::Point<> getPos() const;
63  virtual void getPos(Math::Point<>& pos_) const;
64  virtual void setPos(const Math::Point<>& pos_);
65 
66  virtual Ogre::Vector3 getVec3() const;
67  virtual void getVec3(Ogre::Vector3& vec3_) const;
68  virtual void setVec3(const Ogre::Vector3& vec3_);
69 
70  virtual Math::Matrix3x3 getRot() const;
71  virtual void getRot(Math::Matrix3x3& rot_) const;
72  virtual void setRot(const Math::Matrix3x3& rot_);
73 
74  virtual Ogre::Quaternion getQuat() const;
75  virtual void getQuat(Ogre::Quaternion& quat_) const;
76  virtual void setQuat(const Ogre::Quaternion& quat_);
77 
78  virtual void setVisible(bool val_) { _renderNode->setVisible(val_); }
79 
80  void setRenderNameEnabled(const std::string& name_, const Ogre::Camera* cam_, const Ogre::ColourValue& color_);
81  inline void setRenderNameText(const std::string& name_) { if (_renderName) _renderName->setText(name_); }
82  inline void updateRenderNameTransform() { if (_renderName) _renderName->update(); }
83 
85  virtual void saveMaterials();
87  virtual void loadMaterials();
88  };
89  }
90 }
91 
92 #endif //OGRE_VISIBLE_OBJECT_H
#define OGRECORE_DLL
Definition: OgreCoreDLL.h:57
Definition: CVisibleObject.h:28
Definition: GObjectTextDisplay.h:31
std::vector< std::string > _materialNames
Definition: OgreVisibleObject.h:40
Definition: OgreVisibleObject.h:33
const Ogre::SceneNode * getRenderNode() const
Definition: OgreVisibleObject.h:59
void updateRenderNameTransform()
Definition: OgreVisibleObject.h:82
static const Ogre::Vector3 & getCamSpaceOffset()
Definition: OgreVisibleObject.h:47
void setRenderNameText(const std::string &name_)
Definition: OgreVisibleObject.h:81
Definition: MPoint.h:33
Ogre::SceneNode * getRenderNode()
Definition: OgreVisibleObject.h:60
virtual void setVisible(bool val_)
Definition: OgreVisibleObject.h:78
static const Ogre::Vector3 & getWorldSpaceOffset()
Definition: OgreVisibleObject.h:49
static void setCamSpaceOffset(const Ogre::Vector3 &camSpaceOffset_)
Definition: OgreVisibleObject.h:42
Graphics::ObjectTextDisplay * _renderName
Definition: OgreVisibleObject.h:39
Definition: MMatrix3x3.h:32
Ogre::SceneNode * _renderNode
Definition: OgreVisibleObject.h:38
float float rot_[3]
Definition: ViewerApp.h:31
float pos_[3]
Definition: ViewerApp.h:31