MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / findTexToolFaceWithNormal

Function findTexToolFaceWithNormal

test/TextureTool.cpp:398–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398inline textool::IFaceNode::Ptr findTexToolFaceWithNormal(const Vector3& normal)
399{
400 textool::IFaceNode::Ptr result;
401
402 GlobalTextureToolSceneGraph().foreachNode([&](const textool::INode::Ptr& node)
403 {
404 auto faceNode = std::dynamic_pointer_cast<textool::IFaceNode>(node);
405
406 if (faceNode && math::isNear(faceNode->getFace().getPlane3().normal(), normal, 0.01))
407 {
408 result = faceNode;
409 }
410
411 return result == nullptr;
412 });
413
414 return result;
415}
416
417// Default manipulator mode should be "Drag"
418TEST_F(TextureToolTest, DefaultManipulatorMode)

Callers 1

TEST_FFunction · 0.85

Calls 3

isNearFunction · 0.50
foreachNodeMethod · 0.45
getFaceMethod · 0.45

Tested by

no test coverage detected