Gazebo

OgreVisual.hh

00001 /*
00002  *  Gazebo - Outdoor Multi-Robot Simulator
00003  *  Copyright (C) 2003  
00004  *     Nate Koenig & Andrew Howard
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 /* Desc: Ogre Visual Class
00022  * Author: Nate Koenig
00023  * Date: 14 Dec 2007
00024  * SVN: $Id$
00025  */
00026 
00027 #ifndef OGREVISUAL_HH
00028 #define OGREVISUAL_HH
00029 
00030 #include <Ogre.h>
00031 
00032 #include "Pose3d.hh"
00033 #include "Quatern.hh"
00034 #include "Vector3.hh"
00035 
00036 namespace gazebo
00037 { 
00038 
00039   class XMLConfigNode;
00040   
00042   class OgreVisual
00043   {
00045     public: OgreVisual (OgreVisual *node);
00046 
00048     public: virtual ~OgreVisual();
00049 
00051     public: void AttachObject( Ogre::MovableObject *obj);
00052 
00054     public: void AttachMesh( const std::string &meshName );
00055 
00057     public: void Load(XMLConfigNode *node);
00058 
00060     public: void Save();
00061 
00063     public: void SetScale( Vector3 scale );
00064 
00066     public: Vector3 GetScale();
00067 
00069     public: void SetMaterial(const std::string &materialName);
00070 
00072     public: void SetTransparency( float trans );
00073 
00075     public: void SetHighlight( bool highlight);
00076 
00078     public: void SetCastShadows(bool shadows);
00079 
00083     public: void SetVisible(bool visible, bool cascade=true);
00084 
00086     public: void SetPosition( const Vector3 &pos);
00087 
00089     public: void SetRotation( const Quatern &rot);
00090 
00092     public: void SetPose( const Pose3d &pose);
00093 
00095     public: Vector3 GetPosition();
00096 
00098     public: Quatern GetRotation();
00099 
00101     public: Pose3d GetPose();
00102 
00104     public: Ogre::SceneNode * GetSceneNode();
00105 
00107     public: void AttachBoundingBox(const Vector3 &min, const Vector3 &max);
00108 
00109     private: Ogre::MaterialPtr origMaterial;
00110     private: Ogre::MaterialPtr myMaterial;
00111     private: Ogre::SceneBlendType sceneBlendType;
00112 
00113     private: Ogre::SceneNode *parentNode;
00114     private: Ogre::SceneNode *sceneNode;
00115     private: Ogre::SceneNode *boundingBoxNode;
00116 
00117     private: float transparency;
00118 
00120     private: XMLConfigNode *xmlNode;
00121 
00122 
00123   };
00124 }
00125 
00126 #endif

Last updated Aug 04 2007