本文整理汇总了C++中SelectionTest类的典型用法代码示例。如果您正苦于以下问题:C++ SelectionTest类的具体用法?C++ SelectionTest怎么用?C++ SelectionTest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SelectionTest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testSelectComponents
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;
}
}
示例2: selectPlanes
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);
}
}
示例3: IndexPointer
// 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);
}
}
示例4: PointVertexArray_testSelect
inline void PointVertexArray_testSelect(VertexCb* first, std::size_t count,
SelectionTest& test, SelectionIntersection& best)
{
test.TestLineStrip(
VertexPointer(&first->vertex, sizeof(VertexCb)),
IndexPointer::index_type(count),
best
);
}
示例5: testSelectComponents
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);
}
}
示例6: testSelect
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);
}
}
示例7: testSelect
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);
}
}
示例8: PointVertexArray_testSelect
inline void PointVertexArray_testSelect(PointVertex* first, std::size_t count, SelectionTest& test, SelectionIntersection& best)
{
test.TestLineStrip(
VertexPointer(
reinterpret_cast<VertexPointer::pointer>(&first->vertex),
sizeof(PointVertex)
),
IndexPointer::index_type(count),
best
);
}
示例9:
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);
}
}
示例10: testSelect
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);
}
}
示例11: testSelect
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);
}
}
示例12: testSelect
// Perform selection test
void RenderablePicoModel::testSelect (Selector& selector, SelectionTest& test, const Matrix4& localToWorld)
{
// Perform a volume intersection (AABB) check on each surface. For those
// that intersect, call the surface's own testSelection method to perform
// a proper selection test.
for (SurfaceList::iterator i = _surfVec.begin(); i != _surfVec.end(); ++i) {
// Check volume intersection
if (test.getVolume().TestAABB(i->localAABB(), localToWorld) != VOLUME_OUTSIDE) {
// Volume intersection passed, delegate the selection test
i->testSelect(selector, test, localToWorld);
}
}
}
示例13: testSelect
// 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);
}
}
}
示例14: testSelect
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);
}
}
}
示例15: testSelectComponents
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);
}
}
}