void FaceInstance::testSelect(Selector& selector, SelectionTest& test) {
	SelectionIntersection best;
	testSelect(test, best);
	if (best.valid()) {
		Selector_add(selector, m_selectable, best);
	}
}
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);
		}
	}
}
Example #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);
    }
  }
Example #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);
	}
}
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());
}
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);
		}
    }
}
Example #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());
}
void FaceInstance::selectReversedPlane(Selector& selector, const SelectedPlanes& selectedPlanes) {
	if (selectedPlanes.contains(-(getFace().plane3()))) {
		Selector_add(selector, m_selectable);
	}
}