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


C++ Vec::projectOnPlane方法代码示例

本文整理汇总了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;
    }
}
开发者ID:SoumyajitG,项目名称:VolRoverN,代码行数:33,代码来源:constraint.cpp

示例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;
	}
}
开发者ID:1062054548,项目名称:extend-mesh,代码行数:13,代码来源:Plane.cpp

示例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);
   }
}
开发者ID:baneofblabs,项目名称:IQmol,代码行数:21,代码来源:ManipulatedFrameSetConstraint.C


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