Files
NazaraEngine/include/Nazara/Math/PidController.hpp
Jérôme Leclercq 1a55b550fb Improve math module (#396)
* Improve math module

- Mark almost everything constexpr
- Equality (a == b) is now exact, down to the bit level. If you want approximate equality use the new ApproxEqual method/static method
- Rename Nz::Extend to Nz::Extent
- Removed Make[] and Set[] methods in favor of their static counterpart and operator=
2023-06-02 22:30:51 +02:00

32 lines
685 B
C++

// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Math module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_MATH_PIDCONTROLLER_HPP
#define NAZARA_MATH_PIDCONTROLLER_HPP
namespace Nz
{
template<typename T>
class PidController
{
public:
constexpr PidController(float p, float i, float d);
constexpr T Update(const T& currentError, float elapsedTime);
private:
T m_lastError;
T m_integral;
float m_dFactor;
float m_iFactor;
float m_pFactor;
};
}
#include <Nazara/Math/PidController.inl>
#endif // NAZARA_MATH_PIDCONTROLLER_HPP