MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetVector3FromXml

Function GetVector3FromXml

Source/Editor/ProjectInfo.cpp:53–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53Vector3 GetVector3FromXml(const xml_node& parent, const PUGIXML_CHAR* name, const Vector3& defaultValue)
54{
55 const auto node = parent.child(name);
56 if (!node.empty())
57 {
58 const auto x = node.child_value(PUGIXML_TEXT("X"));
59 const auto y = node.child_value(PUGIXML_TEXT("Y"));
60 const auto z = node.child_value(PUGIXML_TEXT("Z"));
61 if (x && y && z)
62 {
63 XmlCharAsChar xs(x), ys(y), zs(z);
64 Float3 v;
65 if (!StringUtils::Parse(xs.Str, &v.X) && !StringUtils::Parse(ys.Str, &v.Y) && !StringUtils::Parse(zs.Str, &v.Z))
66 {
67 return (Vector3)v;
68 }
69 }
70 }
71 return defaultValue;
72}
73
74int32 GetIntFromXml(const xml_node& parent, const PUGIXML_CHAR* name, const int32 defaultValue)
75{

Callers 1

LoadOldProjectMethod · 0.85

Calls 4

childMethod · 0.80
child_valueMethod · 0.80
ParseFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected