#include <OMKMKMHeadToTaskExtension.h>
Inheritance diagram for OMK::MKMHeadToTaskExtension:
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) |
Definition at line 31 of file OMKMKMHeadToTaskExtension.h.
OMK::MKMHeadToTaskExtension::DECLARE_EXTENSION_FACTORY | ( | MKMHeadToTaskExtension | ) | [private] |
bool MKMHeadToTaskExtension::loadExtensionParameters | ( | const ConfigurationParameterDescriptor * | node | ) | [protected, virtual] |
Configuration parameters loader of Extension.
[in] | node | the root node of the configuration parameter, null if no node defined for the extension. |
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 }
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().
Documentation generated on Mon Jun 9 11:46:04 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |