~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to intern/iksolver/intern/IK_QJacobian.cpp

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * $Id: IK_QJacobian.cpp 26841 2010-02-12 13:34:04Z campbellbarton $
 
1
/*
3
2
 * ***** BEGIN GPL LICENSE BLOCK *****
4
3
 *
5
4
 * This program is free software; you can redistribute it and/or
27
26
 * ***** END GPL LICENSE BLOCK *****
28
27
 */
29
28
 
 
29
/** \file iksolver/intern/IK_QJacobian.cpp
 
30
 *  \ingroup iksolver
 
31
 */
 
32
 
 
33
 
30
34
#include "IK_QJacobian.h"
31
35
#include "TNT/svd.h"
32
36
 
54
58
 
55
59
        m_d_theta.newsize(dof);
56
60
        m_d_theta_tmp.newsize(dof);
 
61
        m_d_norm_weight.newsize(dof);
57
62
 
58
63
        m_norm.newsize(dof);
59
64
        m_norm = 0.0;
106
111
        m_beta[id+2] = v.z();
107
112
}
108
113
 
109
 
void IK_QJacobian::SetDerivatives(int id, int dof_id, const MT_Vector3& v)
 
114
void IK_QJacobian::SetDerivatives(int id, int dof_id, const MT_Vector3& v, MT_Scalar norm_weight)
110
115
{
111
116
        m_jacobian[id][dof_id] = v.x()*m_weight_sqrt[dof_id];
112
117
        m_jacobian[id+1][dof_id] = v.y()*m_weight_sqrt[dof_id];
113
118
        m_jacobian[id+2][dof_id] = v.z()*m_weight_sqrt[dof_id];
 
119
 
 
120
        m_d_norm_weight[dof_id] = norm_weight;
114
121
}
115
122
 
116
123
void IK_QJacobian::Invert()
424
431
        MT_Scalar mx = 0.0, dtheta_abs;
425
432
 
426
433
        for (i = 0; i < m_d_theta.size(); i++) {
427
 
                dtheta_abs = MT_abs(m_d_theta[i]);
 
434
                dtheta_abs = MT_abs(m_d_theta[i]*m_d_norm_weight[i]);
428
435
                if (dtheta_abs > mx)
429
436
                        mx = dtheta_abs;
430
437
        }