const Urho3D::Matrix4 ConfigManager::GetMatrix4(const Urho3D::String& section, const Urho3D::String& parameter, const Urho3D::Matrix4& defaultValue) { auto value = Get(section, parameter); if (value.GetType() == Urho3D::VAR_MATRIX4) return value.GetMatrix4(); if (value.GetType() == Urho3D::VAR_STRING) return Urho3D::ToMatrix4(value.GetString()); // Parameter doesn't exist, or is a different type if (_saveDefaultParameters) { // Set back to default Set(section, parameter, defaultValue); } return defaultValue; }
template <> Matrix4 Variant::Get<Matrix4>() const { return GetMatrix4(); }
template <> const Matrix4& Variant::Get<const Matrix4&>() const { return GetMatrix4(); }