diff options
author | chai <chaifix@163.com> | 2018-11-25 00:11:28 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-25 00:11:28 +0800 |
commit | e8e12b11db220160eb63727fb03548410bf3afd2 (patch) | |
tree | a36d62b783e97af9047469955b1aa0ddae6b4627 /src/libjin/math/je_ranged_value.h | |
parent | 42421575d2e17b5c57ff0034c037b651bd6d1119 (diff) |
*misc
Diffstat (limited to 'src/libjin/math/je_ranged_value.h')
-rw-r--r-- | src/libjin/math/je_ranged_value.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/libjin/math/je_ranged_value.h b/src/libjin/math/je_ranged_value.h new file mode 100644 index 0000000..4749e91 --- /dev/null +++ b/src/libjin/math/je_ranged_value.h @@ -0,0 +1,57 @@ +#ifndef __JE_RANGED_VALUE_H__ +#define __JE_RANGED_VALUE_H__ + +#include "../common/je_types.h" + +#include <vector> + +namespace JinEngine +{ + namespace Math + { + /* + * y ^ + * |-------- _ + * | \ / \ + * | --- \ + * | \ + * | \ + * +----------------------> x + */ + class RangedValue + { + public: + RangedValue(); + + /// + /// Points of ranged value. + /// + /// @param points Points. + /// @param n Number of points. + /// + RangedValue(float* points, uint n); + + virtual ~RangedValue() {} + + virtual void addPoint(float x, float y); + + virtual void removePoint(uint i); + + virtual void insertPoint(uint i, float x, float y); + + virtual float getValue(float x); + + virtual void clear(); + + private: + std::vector<float> mXAxis; + std::vector<float> mYAxis; + + uint mCount; + + }; + + } +} + +#endif
\ No newline at end of file |