本文整理汇总了C++中Vec3d::isZero方法的典型用法代码示例。如果您正苦于以下问题:C++ Vec3d::isZero方法的具体用法?C++ Vec3d::isZero怎么用?C++ Vec3d::isZero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vec3d
的用法示例。
在下文中一共展示了Vec3d::isZero方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: normal
//--------------------------------------------------------------------------------------------------
/// Get the normal of the plane
///
/// The normal may not be normalized
//--------------------------------------------------------------------------------------------------
Vec3d Plane::normal() const
{
Vec3d normal = Vec3d(m_A, m_B, m_C);
CVF_ASSERT(!normal.isZero());
return normal;
}
示例2: setFromPointAndNormal
//--------------------------------------------------------------------------------------------------
/// Compute the plane equation from the given point and normal
///
/// \param point Point on the plane
/// \param normal The plane's normal
//--------------------------------------------------------------------------------------------------
bool Plane::setFromPointAndNormal(const Vec3d& point, const Vec3d& normal)
{
if (normal.isZero()) return false;
m_A = normal.x();
m_B = normal.y();
m_C = normal.z();
m_D = -(normal*point);
return true;
}
示例3: setFromPoints
//--------------------------------------------------------------------------------------------------
/// Compute the plane equation from the given three points
///
/// \param p1 First point on the plane
/// \param p2 Second point on the plane
/// \param p3 Third point on the plane
///
/// \return true if successfully set. false if points are on the same line.
///
/// The three points must be different from each other and cannot be on the same line in space
//--------------------------------------------------------------------------------------------------
bool Plane::setFromPoints(const Vec3d& p1, const Vec3d& p2, const Vec3d& p3)
{
Vec3d v1 = p2 - p1;
Vec3d v2 = p3 - p1;
Vec3d normal = v1 ^ v2;
if (normal.isZero()) return false;
setFromPointAndNormal(p1, normal);
return true;
}