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


C++ Wvec::is_null方法代码示例

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


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

示例1: Wvec

inline Wvec
kernel_vec(const WMat3& M)
{
   // return a vector perpendicular to all 3 rows

   // only supposed to call this on a singular matrix
   if (fabs(M.det()) > 1e-5) {
      cerr << "kernel_vec: warning: matrix is not singular:"
           << endl
           << M
           << endl
           << "determinant: "
           << M.det()
           << endl;
      return Wvec();
   }

   // get row vectors, changed to unit length or null:
   Wvec r0 = M.row(0).normalized();
   Wvec r1 = M.row(1).normalized();
   Wvec r2 = M.row(2).normalized();

   // re-order to push null ones to the end:
   if (r0.is_null()) swap(r0,r1);
   if (r0.is_null()) swap(r0,r2);
   if (r1.is_null()) swap(r1,r2);

   Wvec ret = cross(r0,r1).normalized();
   if (ret.is_null())
      ret = cross(r0,r2).normalized();
   if (ret.is_null())
      ret = Wvec::X();
   assert(isZero(ret*r0) && isZero(ret*r1) && isZero(ret*r2));
   return ret;
}
开发者ID:ArnaudGastinel,项目名称:jot-lib,代码行数:35,代码来源:align.C

示例2: norm

void 
Bpoint::remove_constraining_surface()
{
  if ( !(constraining_surface()) ){
    cerr << "Bpoint::remove_constraining_surface() "
         << "has no surface constraint" << endl;
    return;
  }

  // save the normal
  Wvec n = norm();

  // remove the shadow, if any 
  remove_shadow();
  set_map(new WptMap(loc()), false);

  if (!n.is_null())
    _map->set_norm(n);
}
开发者ID:ArnaudGastinel,项目名称:jot-lib,代码行数:19,代码来源:bpoint.C

示例3: loc

CWpt& 
SkinMeme::compute_update()
{
   static bool debug = ::debug || Config::get_var_bool("DEBUG_SKIN_UPDATE",false);

   // compute 3D vertex location WRT track simplex

   if (_is_sticky) {
      // this meme is supposed to follow the skeleton surface
      if (is_tracking()) {
         // it actually is following it
         return _update = skin_loc(track_simplex(), _bc, _h);
      }
      // supposed to follow, but has no track point: do nothing
      return _update = loc();
   }

   // this meme is not following the skeleton surface;
   // it computes its location via smooth subdivision.
   // but it may still track the closest point on the skeleton
   // surface to avoid penetrating inside the skeleton surface.

   if (vert()->parent() == 0)
      _update = loc();
   else
      _update = vert()->detail_loc_from_parent();
   track_to_target(_update);
   if (_non_penetrate && is_tracking()) {
      Wvec d = penetration_correction(_update, track_simplex(), _bc, _stay_out);
      if (debug && !d.is_null())
         err_msg("SkinMeme::compute_update: correcting penetration, level %d",
                 bbase()->subdiv_level());
      _update += d;
               
   }
   return _update;
}
开发者ID:ArnaudGastinel,项目名称:jot-lib,代码行数:37,代码来源:skin_meme.C


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