예제 #1
0
void FaceInstance::testSelect(Selector& selector, SelectionTest& test) {
	SelectionIntersection best;
	testSelect(test, best);
	if (best.valid()) {
		Selector_add(selector, m_selectable, best);
	}
}
예제 #2
0
void FaceInstance::testSelect_centroid(Selector& selector, SelectionTest& test) {
	if (m_face->contributes()) {
		SelectionIntersection best;
		m_face->testSelect_centroid(test, best);
		if (best.valid()) {
			Selector_add(selector, m_selectable, best);
		}
	}
}
예제 #3
0
  void testSelect(Selector& selector, SelectionTest& test)
  {
    test.BeginMesh(localToWorld());
    SelectionIntersection best;

    m_contained.testSelect(selector, test, best);

    if(best.valid())
    {
      Selector_add(selector, getSelectable(), best);
    }
  }
예제 #4
0
void Doom3GroupNode::testSelect(Selector& selector, SelectionTest& test)
{
	test.BeginMesh(localToWorld());
	SelectionIntersection best;

	// Pass the selection test to the Doom3Group class
	m_contained.testSelect(selector, test, best);

	// If the selectionIntersection is non-empty, add the selectable to the SelectionPool
	if (best.valid()) {
		Selector_add(selector, getSelectable(), best);
	}
}
예제 #5
0
void FaceInstance::selectPlane(Selector& selector, const Line& line, PlanesIterator first, PlanesIterator last, const PlaneCallback& selectedPlaneCallback) {
	for (Winding::const_iterator i = getFace().getWinding().begin(); i != getFace().getWinding().end(); ++i) {
		Vector3 v(line.getClosestPoint(i->vertex) - i->vertex);
		float dot = getFace().plane3().normal().dot(v);
		if (dot <= 0) {
				return;
			}
	}

	Selector_add(selector, m_selectable);

	selectedPlaneCallback(getFace().plane3());
}
예제 #6
0
void CurveEditInstance::testSelect(Selector& selector, SelectionTest& test)
{
    ASSERT_MESSAGE(_controlPointsTransformed.size() == _selectables.size(), "curve instance mismatch");

    ControlPoints::const_iterator p = _controlPointsTransformed.begin();

    for(Selectables::iterator i = _selectables.begin(); i != _selectables.end(); ++i, ++p)
    {
    	SelectionIntersection best;
		test.TestPoint(*p, best);
		if (best.valid())
		{
			Selector_add(selector, *i, best);
		}
    }
}
예제 #7
0
void FaceInstance::selectPlane (Selector& selector, const Line& line, PlanesIterator first, PlanesIterator last,
		const PlaneCallback& selectedPlaneCallback)
{
	const Winding& winding = m_face->getWinding();
	for (Winding::const_iterator i =winding.begin(); i != winding.end(); ++i) {
		Vector3 v(line_closest_point(line, (*i).vertex) - (*i).vertex);
		double dot = m_face->plane3().normal().dot(v);
		if (dot <= 0) {
			return;
		}
	}

	Selector_add(selector, m_selectable);

	selectedPlaneCallback(m_face->plane3());
}
예제 #8
0
void FaceInstance::selectReversedPlane(Selector& selector, const SelectedPlanes& selectedPlanes) {
	if (selectedPlanes.contains(-(getFace().plane3()))) {
		Selector_add(selector, m_selectable);
	}
}