Blender  V2.59
UncontrolledObject.cpp
Go to the documentation of this file.
00001 
00004 /* $Id: UncontrolledObject.cpp 35155 2011-02-25 11:45:16Z jesterking $
00005  * UncontrolledObject.cpp
00006  *
00007  *  Created on: Jan 5, 2009
00008  *      Author: rubensmits
00009  */
00010 
00011 #include "UncontrolledObject.hpp"
00012 
00013 namespace iTaSC{
00014 
00015 UncontrolledObject::UncontrolledObject():Object(UnControlled),
00016         m_nu(0), m_nf(0), m_xudot()
00017 {
00018 }
00019 
00020 UncontrolledObject::~UncontrolledObject() 
00021 {
00022 }
00023 
00024 void UncontrolledObject::initialize(unsigned int _nu, unsigned int _nf)
00025 {
00026         assert (_nf >= 1);
00027         m_nu = _nu;
00028         m_nf = _nf;
00029         if (_nu > 0)
00030                 m_xudot = e_zero_vector(_nu);
00031         // clear all Jacobian if any
00032         m_JuArray.clear();
00033         // reserve one more to have an zero matrix handy
00034         if (m_nu > 0)
00035                 m_JuArray.resize(m_nf+1, e_zero_matrix(6,m_nu));
00036 }
00037 
00038 const e_matrix& UncontrolledObject::getJu(unsigned int frameIndex) const
00039 {
00040         assert (m_nu > 0);
00041         return m_JuArray[(frameIndex>m_nf)?m_nf:frameIndex];
00042 }
00043 
00044 
00045 
00046 }