eltopo3d/dynamicsurface.cpp
// ---------------------------------------------------------
///
/// Compute the AABB of a continuous triangle
///
// ---------------------------------------------------------
Compute the AABB of a continuous triangle
Compute the AABB of a continuous triangle
void DynamicSurface::triangle_continuous_bounds(size_t t, Vec3d &xmin, Vec3d &xmax) const
{
    const Vec3st& tri = m_mesh.get_triangle(t);
    if ( tri[0] == tri[1] )
    {
        xmin = Vec3d(m_aabb_padding);
        xmax = -Vec3d(m_aabb_padding);
    }
    else
    {
        minmax(get_position(tri[0]), get_newposition(tri[0]), 
               get_position(tri[1]), get_newposition(tri[1]), 
               get_position(tri[2]), get_newposition(tri[2]), 
               xmin, xmax);
        xmin -= Vec3d(m_aabb_padding);
        xmax += Vec3d(m_aabb_padding);
    }
}
void DynamicSurface :: triangle_continuous_bounds ( size_t t , Vec3d & xmin , Vec3d & xmax ) const { const Vec3st & tri = m_mesh . get_triangle ( t ) ; if ( tri [ 0 ] == tri [ 1 ] ) { xmin = Vec3d ( m_aabb_padding ) ; xmax = - Vec3d ( m_aabb_padding ) ; } else { minmax ( get_position ( tri [ 0 ] ) , get_newposition ( tri [ 0 ] ) , get_position ( tri [ 1 ] ) , get_newposition ( tri [ 1 ] ) , get_position ( tri [ 2 ] ) , get_newposition ( tri [ 2 ] ) , xmin , xmax ) ; xmin -= Vec3d ( m_aabb_padding ) ; xmax += Vec3d ( m_aabb_padding ) ; } }
Compute the AABB of a continuous triangle
Compute the AABB of a continuous triangle