void FaceInstance::update_move_planepts_vertex2 (std::size_t index, std::size_t other) { const std::size_t numpoints = m_face->getWinding().size(); ASSERT_MESSAGE(index < numpoints, "select_vertex: invalid index"); const std::size_t opposite = Winding_Opposite(m_face->getWinding(), index, other); if (triangle_reversed(index, other, opposite)) { std::swap(index, other); } ASSERT_MESSAGE( triangles_same_winding( m_face->getWinding()[opposite].vertex, m_face->getWinding()[index].vertex, m_face->getWinding()[other].vertex, m_face->getWinding()[0].vertex, m_face->getWinding()[1].vertex, m_face->getWinding()[2].vertex ), "update_move_planepts_vertex2: error" ); m_face->m_move_planepts[0] = m_face->getWinding()[opposite].vertex; m_face->m_move_planepts[1] = m_face->getWinding()[index].vertex; m_face->m_move_planepts[2] = m_face->getWinding()[other].vertex; planepts_quantise(m_face->m_move_planepts, GRID_MIN); // winding points are very inaccurate }
void FaceInstance::update_move_planepts_edge (std::size_t index) { const Winding& winding = m_face->getWinding(); const std::size_t numpoints = winding.size(); ASSERT_MESSAGE(index < numpoints, "select_edge: invalid index"); const std::size_t adjacent = winding.next(index); const std::size_t opposite = Winding_Opposite(winding, index); m_face->m_move_planepts[0] = winding[index].vertex; m_face->m_move_planepts[1] = winding[adjacent].vertex; m_face->m_move_planepts[2] = winding[opposite].vertex; planepts_quantise(m_face->m_move_planepts, GRID_MIN); // winding points are very inaccurate }
std::size_t Winding_Opposite(const Winding& winding, const std::size_t index) { return Winding_Opposite(winding, index, Winding_next(winding, index)); }