void BrushInstance::testSelectComponents (Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) { test.BeginMesh(localToWorld()); switch (mode) { case SelectionSystem::eVertex: { for (VertexInstances::iterator i = m_vertexInstances.begin(); i != m_vertexInstances.end(); ++i) { (*i).testSelect(selector, test); } } break; case SelectionSystem::eEdge: { for (EdgeInstances::iterator i = m_edgeInstances.begin(); i != m_edgeInstances.end(); ++i) { (*i).testSelect(selector, test); } } break; case SelectionSystem::eFace: { if (test.getVolume().fill()) { for (FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) { (*i).testSelect(selector, test); } } else { for (FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) { (*i).testSelect_centroid(selector, test); } } } break; default: break; } }
void testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) { if(mode == SelectionSystem::eVertex) { test.BeginMesh(localToWorld()); m_curveNURBS.testSelect(selector, test); m_curveCatmullRom.testSelect(selector, test); } }
void NullModel::testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) { test.BeginMesh(localToWorld); SelectionIntersection best; aabb_testselect(_aabbLocal, test, best); if(best.valid()) { selector.addIntersection(best); } }
void MiscParticle::testSelect (Selector& selector, SelectionTest& test, const Matrix4& localToWorld) { test.BeginMesh(localToWorld); SelectionIntersection best; aabb_testselect(m_aabb_local, test, best); if (best.valid()) { selector.addIntersection(best); } }
void BrushInstance::testSelect (Selector& selector, SelectionTest& test) { test.BeginMesh(localToWorld()); SelectionIntersection best; for (FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) { (*i).testSelect(test, best); } if (best.valid()) { selector.addIntersection(best); } }
void Doom3GroupNode::testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) { if (mode == SelectionSystem::eVertex) { test.BeginMesh(localToWorld()); _originInstance.testSelect(selector, test); _nurbsEditInstance.testSelect(selector, test); _catmullRomEditInstance.testSelect(selector, test); } }
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); } }
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 BrushInstance::selectPlanes (Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) { test.BeginMesh(localToWorld()); PlanePointer brushPlanes[c_brush_maxFaces]; PlanesIterator j = brushPlanes; for (Brush::const_iterator i = m_brush.begin(); i != m_brush.end(); ++i) { *j++ = &(*i)->plane3(); } for (FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) { (*i).selectPlane(selector, Line(test.getNear(), test.getFar()), brushPlanes, j, selectedPlaneCallback); } }
// Selection test void MD5Surface::testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) { test.BeginMesh(localToWorld); SelectionIntersection best; test.TestTriangles( vertexpointer_arbitrarymeshvertex(_vertices.data()), IndexPointer(_indices.data(), IndexPointer::index_type(_indices.size())), best ); if(best.valid()) { selector.addIntersection(best); } }
// Perform selection test for this surface void RenderablePicoSurface::testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) const { if (!_vertices.empty() && !_indices.empty()) { // Test for triangle selection test.BeginMesh(localToWorld); SelectionIntersection result; test.TestTriangles( VertexPointer(&_vertices[0].vertex, sizeof(ArbitraryMeshVertex)), IndexPointer(&_indices[0], IndexPointer::index_type(_indices.size())), result ); // Add the intersection to the selector if it is valid if(result.valid()) { selector.addIntersection(result); } } }
void LightNode::testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) { // Get the Origin of the Light Volume AABB (NOT the localAABB() which includes the light center) Vector3 lightOrigin = _light.lightAABB().origin; Matrix4 local2World = Matrix4::getTranslation(lightOrigin); test.BeginMesh(local2World); if (mode == SelectionSystem::eVertex) { if (_light.isProjected()) { // Test the projection components for selection _lightTargetInstance.testSelect(selector, test); _lightRightInstance.testSelect(selector, test); _lightUpInstance.testSelect(selector, test); _lightStartInstance.testSelect(selector, test); _lightEndInstance.testSelect(selector, test); } else { // Test if the light center is hit by the click _lightCenterInstance.testSelect(selector, test); } } }
void LightNode::selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) { test.BeginMesh(localToWorld()); // greebo: Make sure to use the local lightAABB() for the selection test, excluding the light center AABB localLightAABB(Vector3(0,0,0), _light.getDoom3Radius().m_radiusTransformed); m_dragPlanes.selectPlanes(localLightAABB, selector, test, selectedPlaneCallback, rotation()); }