本文整理汇总了C++中DyLink::constraintForces方法的典型用法代码示例。如果您正苦于以下问题:C++ DyLink::constraintForces方法的具体用法?C++ DyLink::constraintForces怎么用?C++ DyLink::constraintForces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DyLink
的用法示例。
在下文中一共展示了DyLink::constraintForces方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extractBodyContactPoints
void ContactForceExtractorItem::extractBodyContactPoints(DyBody* body, ostream& os)
{
bool put = false;
for(int i=0; i < body->numLinks(); ++i){
DyLink* link = body->link(i);
DyLink::ConstraintForceArray& forces = link->constraintForces();
if(!forces.empty()){
if(!put){
os << body->name() << ":\n";
put = true;
}
os << " " << link->name() << ":\n";
for(size_t i=0; i < forces.size(); ++i){
const DyLink::ConstraintForce& force = forces[i];
const Vector3& p = force.point;
const Vector3& f = force.force;
os << " point(" << p.x() << ", " << p.y() << ", " << p.z()
<< "), force(" << f.x() << ", " << f.y() << ", " << f.z() << ")\n";
}
}
}
}