本文整理汇总了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;
}
示例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);
}
示例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;
}