当前位置: 首页>>代码示例>>C++>>正文


C++ SimulationModel::getClothYYStiffness方法代码示例

本文整理汇总了C++中SimulationModel::getClothYYStiffness方法的典型用法代码示例。如果您正苦于以下问题:C++ SimulationModel::getClothYYStiffness方法的具体用法?C++ SimulationModel::getClothYYStiffness怎么用?C++ SimulationModel::getClothYYStiffness使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimulationModel的用法示例。


在下文中一共展示了SimulationModel::getClothYYStiffness方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: solvePositionConstraint

bool FEMTriangleConstraint::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_FEMTriangleConstraint(
		x1, invMass1,
		x2, invMass2,
		x3, invMass3,
		m_area,
		m_invRestMat,
		model.getClothXXStiffness(),
		model.getClothYYStiffness(),
		model.getClothXYStiffness(),
		model.getClothXYPoissonRatio(),
		model.getClothYXPoissonRatio(),
		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;
}
开发者ID:mmmovania,项目名称:PositionBasedDynamics-ElasticRod,代码行数:41,代码来源:Constraints.cpp

示例2: 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];

	Vector3r &x1 = pd.getPosition(i1);
	Vector3r &x2 = pd.getPosition(i2);
	Vector3r &x3 = pd.getPosition(i3);

	const Real invMass1 = pd.getInvMass(i1);
	const Real invMass2 = pd.getInvMass(i2);
	const Real invMass3 = pd.getInvMass(i3);

	Vector3r 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.0)
			x1 += corr1;
		if (invMass2 != 0.0)
			x2 += corr2;
		if (invMass3 != 0.0)
			x3 += corr3;
	}
	return res;
}
开发者ID:PeterZs,项目名称:PositionBasedDynamics,代码行数:40,代码来源:Constraints.cpp


注:本文中的SimulationModel::getClothYYStiffness方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。