예제 #1
0
void FaceInstance::update_move_planepts_vertex2(std::size_t index, std::size_t other)
{
	ASSERT_MESSAGE(index < m_face->getWinding().size(), "select_vertex: invalid index");

	const std::size_t opposite = m_face->getWinding().opposite(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
}
예제 #2
0
void FaceInstance::update_move_planepts_edge(std::size_t index)
{
	ASSERT_MESSAGE(index < m_face->getWinding().size(), "select_edge: invalid index");

	std::size_t adjacent = m_face->getWinding().next(index);
	std::size_t opposite = m_face->getWinding().opposite(index);
	m_face->m_move_planepts[0] = m_face->getWinding()[index].vertex;
	m_face->m_move_planepts[1] = m_face->getWinding()[adjacent].vertex;
	m_face->m_move_planepts[2] = m_face->getWinding()[opposite].vertex;
	planepts_quantise(m_face->m_move_planepts, GRID_MIN); // winding points are very inaccurate
}
예제 #3
0
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
}