本文整理汇总了C++中Vec::projectOnPlane方法的典型用法代码示例。如果您正苦于以下问题:C++ Vec::projectOnPlane方法的具体用法?C++ Vec::projectOnPlane怎么用?C++ Vec::projectOnPlane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vec
的用法示例。
在下文中一共展示了Vec::projectOnPlane方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: constrainTranslation
/*! Depending on translationConstraintType(), constrain \p translation to be along an axis or
limited to a plane defined in the world coordinate system by
translationConstraintDirection(). */
void WorldConstraint::constrainTranslation(Vec& translation, Frame* const frame)
{
Vec proj;
switch (translationConstraintType())
{
case AxisPlaneConstraint::FREE:
break;
case AxisPlaneConstraint::PLANE:
if (frame->referenceFrame())
{
proj = frame->referenceFrame()->transformOf(translationConstraintDirection());
translation.projectOnPlane(proj);
}
else
translation.projectOnPlane(translationConstraintDirection());
break;
case AxisPlaneConstraint::AXIS:
if (frame->referenceFrame())
{
proj = frame->referenceFrame()->transformOf(translationConstraintDirection());
translation.projectOnAxis(proj);
}
else
translation.projectOnAxis(translationConstraintDirection());
break;
case AxisPlaneConstraint::FORBIDDEN:
translation = Vec(0.0, 0.0, 0.0);
break;
}
}
示例2: projectionOf
Vec Plane::projectionOf(const Vec &point)
{
if(IsOn(point))
return point;
else
{
Vec proj = point - this->center;
proj.projectOnPlane(n);
return proj + this->center;
}
}
示例3: constrainTranslation
void ManipulatedFrameSetConstraint::constrainTranslation(Vec& translation, Frame* const)
{
// Filter the translation
switch (translationConstraintType()) {
case AXIS:
translation.projectOnAxis(translationConstraintDirection());
break;
case PLANE:
translation.projectOnPlane(translationConstraintDirection());
break;
default:
break;
}
QList<GLObject*>::iterator iter, end;
for (iter = m_primitives.begin(), end = m_primitives.end(); iter != end; ++iter) {
(*iter)->m_frame.translate(translation);
}
}