本文整理汇总了C++中SimulationModel::getClothNormalizeStretch方法的典型用法代码示例。如果您正苦于以下问题:C++ SimulationModel::getClothNormalizeStretch方法的具体用法?C++ SimulationModel::getClothNormalizeStretch怎么用?C++ SimulationModel::getClothNormalizeStretch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimulationModel
的用法示例。
在下文中一共展示了SimulationModel::getClothNormalizeStretch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: solvePositionConstraint
bool StrainTriangleConstraint::solvePositionConstraint(SimulationModel &model)
{
ParticleData &pd = model.getParticles();
const unsigned i1 = m_bodies[0];
const unsigned i2 = m_bodies[1];
const unsigned i3 = m_bodies[2];
Eigen::Vector3f &x1 = pd.getPosition(i1);
Eigen::Vector3f &x2 = pd.getPosition(i2);
Eigen::Vector3f &x3 = pd.getPosition(i3);
const float invMass1 = pd.getInvMass(i1);
const float invMass2 = pd.getInvMass(i2);
const float invMass3 = pd.getInvMass(i3);
Eigen::Vector3f corr1, corr2, corr3;
const bool res = PositionBasedDynamics::solve_StrainTriangleConstraint(
x1, invMass1,
x2, invMass2,
x3, invMass3,
m_invRestMat,
model.getClothXXStiffness(),
model.getClothYYStiffness(),
model.getClothXYStiffness(),
model.getClothNormalizeStretch(),
model.getClothNormalizeShear(),
corr1, corr2, corr3);
if (res)
{
if (invMass1 != 0.0f)
x1 += corr1;
if (invMass2 != 0.0f)
x2 += corr2;
if (invMass3 != 0.0f)
x3 += corr3;
}
return res;
}