00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2009 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU 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 | MRPT 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 General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 #ifndef opengl_C3DSScene_H 00029 #define opengl_C3DSScene_H 00030 00031 #include <mrpt/opengl/CRenderizable.h> 00032 #include <mrpt/opengl/COpenGLScene.h> 00033 #include <mrpt/utils/CMemoryChunk.h> 00034 00035 namespace mrpt 00036 { 00037 namespace opengl 00038 { 00039 class MRPTDLLIMPEXP C3DSScene; 00040 00041 // This must be added to any CSerializable derived class: 00042 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE( C3DSScene, CRenderizable ) 00043 00044 00048 class MRPTDLLIMPEXP C3DSScene : public CRenderizable 00049 { 00050 DEFINE_SERIALIZABLE( C3DSScene ) 00051 00052 public: 00053 00056 void render() const; 00057 00062 void loadFrom3DSFile( const std::string &file_name ); 00063 00065 static C3DSScenePtr Create() 00066 { 00067 return C3DSScenePtr ( new C3DSScene() ); 00068 } 00069 00072 void initializeAllTextures(); 00073 00075 void clear(); 00076 00079 void evaluateAnimation( double time_anim ); 00080 00082 void setScale( double s ) { m_scale_x = m_scale_y = m_scale_z = s; } 00083 00085 void setScale( double sx,double sy, double sz ) { m_scale_x = sx; m_scale_y = sy; m_scale_z = sz; } 00086 00088 void enableExtraAmbientLight(bool enable=true) { m_enable_extra_lighting=enable; } 00089 00090 /* Simulation of ray-trace. */ 00091 virtual bool traceRay(const mrpt::poses::CPose3D &o,float &dist) const; 00092 00093 00094 00095 00096 private: 00099 C3DSScene( ); 00100 00102 virtual ~C3DSScene(); 00103 00106 struct TImpl3DS 00107 { 00108 TImpl3DS(); 00109 ~TImpl3DS(); 00110 void *file; 00111 }; 00112 00115 stlplus::smart_ptr<TImpl3DS> m_3dsfile; 00116 00118 double m_scale_x,m_scale_y,m_scale_z; 00119 00120 bool m_enable_extra_lighting; 00121 }; 00122 00123 00124 } // end namespace 00125 00126 } // End of namespace 00127 00128 00129 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:07:47 EST 2009 |