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


C++ Vec3d::isZero方法代码示例

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

示例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;
}
开发者ID:CeetronAS,项目名称:CustomVisualizationCore,代码行数:17,代码来源:cvfPlane.cpp

示例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;
}
开发者ID:CeetronAS,项目名称:CustomVisualizationCore,代码行数:23,代码来源:cvfPlane.cpp


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