OMKStaticHumano.cpp

Go to the documentation of this file.
00001 #include "OMKStaticHumano.h"
00002 #include "OMKParametersAccessor.inl"
00003 #include "OMKTransform.h"
00004 #include "OMKVisBase.h"
00005 #include "OMKAddVisualObjectPrm.h"
00006 #include "OMKConversion.h"
00007 
00008 using namespace OMK ;
00009 using namespace OMK::Type ;
00010 using namespace OMK::Vis ;
00011 
00012 //=============================================================================
00013 
00014 //-----------------------------------------------------------------------------
00015 REGISTER_OBJECT_FACTORY( OMK::StaticHumano, "StaticHumano" ) ;
00016 //-----------------------------------------------------------------------------
00017 
00018 StaticHumano::StaticHumano( Controller& ctrl, const ObjectDescriptor& objectDescriptor )
00019 : BasicHumano( ctrl, objectDescriptor )
00020 { 
00021 }
00022 //-----------------------------------------------------------------------------
00023 StaticHumano::~StaticHumano() 
00024 {
00025 }
00026 //-----------------------------------------------------------------------------
00027 HBT::InitialisationSequence* StaticHumano::getInitialiseSequence()
00028 {
00029   // create the minimal HBT::InitialisationSequence
00030   const ConfigurationParameterDescriptor* node = getConfigurationParameters();
00031   bool ok = ( node != 0 ) ;
00032 
00033   std::string meshFile ;
00034   ok = ok && ParametersAccessor::get( node, "Mesh", meshFile, this ) ;
00035 
00036   bool useShadows = true ;
00037   ParametersAccessor::get( node, "UseShadows", useShadows ) ;
00038 
00039   if( ok )
00040   { // Parameter are ok => set the InitialisationSequence
00041     _initialisationSequence.humanName    = getName().getString() ;
00042     _initialisationSequence.meshFile     = meshFile ;
00043     _initialisationSequence.useShadows   = useShadows ;
00044     _initialisationSequence.generalScale = Ogre::Vector3( 1.0f/_position.get().getScale().X() );
00045     _initialisationSequence.rootQuat     = convert( _position.get().getQuaternionRotate() ) ;
00046     _initialisationSequence.rootPos      = convert( _position.get().getTranslate() ) ;
00047   }
00048   return ok ? &_initialisationSequence : 0 ;
00049 }
00050 //=============================================================================
00051 
00052 

logo OpenMask

Documentation generated on Mon Jun 9 11:45:57 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007