Welcome to mirror list, hosted at ThFree Co, Russian Federation.

UncontrolledObject.cpp « itasc « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4db44aaf7dc56b8ff2699402e95f51baa78af4f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* $Id$
 * UncontrolledObject.cpp
 *
 *  Created on: Jan 5, 2009
 *      Author: rubensmits
 */

#include "UncontrolledObject.hpp"

namespace iTaSC{

UncontrolledObject::UncontrolledObject():Object(UnControlled),
	m_nu(0), m_nf(0), m_xudot()
{
}

UncontrolledObject::~UncontrolledObject() 
{
}

void UncontrolledObject::initialize(unsigned int _nu, unsigned int _nf)
{
	assert (_nf >= 1);
	m_nu = _nu;
	m_nf = _nf;
	if (_nu > 0)
		m_xudot = e_zero_vector(_nu);
	// clear all Jacobian if any
	m_JuArray.clear();
	// reserve one more to have an zero matrix handy
	if (m_nu > 0)
		m_JuArray.resize(m_nf+1, e_zero_matrix(6,m_nu));
}

const e_matrix& UncontrolledObject::getJu(unsigned int frameIndex) const
{
	assert (m_nu > 0);
	return m_JuArray[(frameIndex>m_nf)?m_nf:frameIndex];
}



}