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

Method getFingerprint

radiantcore/patch/PatchNode.cpp:49–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49std::string PatchNode::getFingerprint()
50{
51 constexpr std::size_t SignificantDigits = scene::SignificantFingerprintDoubleDigits;
52
53 if (m_patch.getHeight() * m_patch.getWidth() == 0)
54 {
55 return std::string(); // empty patches produce an empty fingerprint
56 }
57
58 math::Hash hash;
59
60 // Width & Height
61 hash.addSizet(m_patch.getHeight());
62 hash.addSizet(m_patch.getWidth());
63
64 // Subdivision Settings
65 if (m_patch.subdivisionsFixed())
66 {
67 hash.addSizet(static_cast<std::size_t>(m_patch.getSubdivisions().x()));
68 hash.addSizet(static_cast<std::size_t>(m_patch.getSubdivisions().y()));
69 }
70
71 // Material Name
72 hash.addString(m_patch.getShader());
73
74 // Combine all control point data
75 for (const auto& ctrl : m_patch.getControlPoints())
76 {
77 hash.addVector3(ctrl.vertex, SignificantDigits);
78 hash.addDouble(ctrl.texcoord.x(), SignificantDigits);
79 hash.addDouble(ctrl.texcoord.y(), SignificantDigits);
80 }
81
82 return hash;
83}
84
85void PatchNode::updateSelectableControls()
86{

Callers

nothing calls this directly

Calls 11

addSizetMethod · 0.80
xMethod · 0.80
getSubdivisionsMethod · 0.80
yMethod · 0.80
addStringMethod · 0.80
getShaderMethod · 0.80
addVector3Method · 0.80
addDoubleMethod · 0.80
getHeightMethod · 0.45
getWidthMethod · 0.45
subdivisionsFixedMethod · 0.45

Tested by

no test coverage detected