OMK::MKMHeadToTaskExtension Class Reference

#include <OMKMKMHeadToTaskExtension.h>

Inheritance diagram for OMK::MKMHeadToTaskExtension:

Inheritance graph
[legend]
Collaboration diagram for OMK::MKMHeadToTaskExtension:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

virtual bool loadExtensionParameters (const ConfigurationParameterDescriptor *node)
 Configuration parameters loader of Extension.
virtual void preComputeParameters ()
 method.

Protected Attributes

AttributeT< bool_activate
AttributeT< float > _speed
AttributeT< Type::Transform_target

Private Member Functions

 DECLARE_EXTENSION_FACTORY (MKMHeadToTaskExtension)

Detailed Description

Definition at line 31 of file OMKMKMHeadToTaskExtension.h.


Member Function Documentation

OMK::MKMHeadToTaskExtension::DECLARE_EXTENSION_FACTORY ( MKMHeadToTaskExtension   )  [private]

bool MKMHeadToTaskExtension::loadExtensionParameters ( const ConfigurationParameterDescriptor node  )  [protected, virtual]

Configuration parameters loader of Extension.

Parameters:
[in] node the root node of the configuration parameter, null if no node defined for the extension.
Returns:
should return true if all the parameters are well retrieved.
Overwrite this method to initialise the extension. This method allows the extension to get parameters of its own field.
Be careful, loadObjectParameters method is called before this method.
See How to configure an extension ? for details.

Reimplemented from OMK::Extension.

Definition at line 50 of file OMKMKMHeadToTaskExtension.cpp.

References _activate, _speed, _target, and OMK::IAttributeBaseT< PrmType >::loadParameters().

00051 {
00052   // Retrieve all the parameters
00053   _activate.loadParameters( node, "Activation" ) ;
00054   _speed.loadParameters( node, "Speed" ) ;
00055   _target.loadParameters( node, "Target" ) ;
00056 
00057   return true ;
00058 }

void MKMHeadToTaskExtension::preComputeParameters (  )  [protected, virtual]

method.

This method is called by the extensible simulated object at each compute step. Its call takes place in the compute method just after the inputs were retrieved by the computeInputs method and before the output parameters will be computed by the computeParameters

Reimplemented from OMK::Extension.

Definition at line 59 of file OMKMKMHeadToTaskExtension.cpp.

References _activate, OMK::MKMHumano::_controlMesh, _speed, _target, OMK::IAttributeT< PrmType, ModelType, AccessorType >::get(), and OMK::ExtensionT< OMK::MKMHumano >::getOwner().

00060 {
00061   // Waiting for the avatar master is intialised
00062   if( getOwner()->_avatarMaster.isInitialized() && _activate.get() )
00063   {
00064     Wm4::Vector3f target( _target.get().getTranslate() ) ;  
00065     mkm::CVector3 pos( getOwner()->_controlMesh.getPosition() ) ;
00066     float deltaX = -target.X() - pos[mkm::X] ;
00067     float deltaZ = target.Z() - pos[mkm::Y] ;
00068     getOwner()->_controlMesh.setOrientationToMoveToward( deltaX, deltaZ, _speed.get(), false ) ;
00069   }
00070 }


Member Data Documentation

AttributeT< bool > OMK::MKMHeadToTaskExtension::_activate [protected]

Definition at line 37 of file OMKMKMHeadToTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

AttributeT< float > OMK::MKMHeadToTaskExtension::_speed [protected]

Definition at line 38 of file OMKMKMHeadToTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

AttributeT< Type::Transform > OMK::MKMHeadToTaskExtension::_target [protected]

Definition at line 39 of file OMKMKMHeadToTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:04 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007