本文整理汇总了C++中Model::GetHandleCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Model::GetHandleCount方法的具体用法?C++ Model::GetHandleCount怎么用?C++ Model::GetHandleCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model::GetHandleCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Solution
void Solution(void *v)
{
Model* model = UI->mData->mSelectedModel;
C3dFileInfo* c3d = model->mOpenedC3dFile;
int numDofs = model->GetDofCount();
int numCons = model->GetHandleCount() * 3;
int frameNum = 0;
double alpha = 0.1;
cout << "The Jacobian will be " << numCons << " by " << numDofs << endl;
for (int i = 0; i < 1000; i++) {
std::vector<Vec4d*> handles = model->ComputeJacobian(frameNum);
Matd J = model->mJacobian;
Matd Jt = trans(J);
Vecd C;
C.SetSize(numCons);
for (int i = 0; i < model->GetHandleCount(); i++) {
for (int j = 0; j < 3; j++) {
// cout << "Prevec " << i << ":" << j << C << endl;
Vec4d v = *(handles[i]);
// cout << "Homogeneous " << v << endl;
double h = v[j]/v[3];
double m = c3d->GetMarkerPos(frameNum, i)[j];
// cout << "Calculated m" << endl;
C[i*3 + j] = h - m;
}
}
// cout << "Objective vector " << C << endl;
Vecd dF = 2 * Jt * C;
Vecd q;
q.SetSize(numDofs);
model->mDofList.GetDofs(&q);
Vecd qnew = q - alpha*dF;
model->SetDofs(qnew);
}
for (int i = 0; i < UI->mData->mSelectedModel->GetDofCount(); i++) {
cout << UI->mData->mSelectedModel->mDofList.mDofs[i]->GetName() << endl;
}
}