Gorgon Game Engine
Common.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 namespace Gorgon { namespace Widgets {
5 
7 
8  template<class T_>
9  float FloatDivider(T_ left, T_ min, T_ max) {
10  if(min == max) return 0.f;
11 
12  return float(left - min) / float(max - min);
13  }
14 
15  template<class T_>
16  T_ FloatToValue(float value, T_ min, T_ max) {
17  return T_((max - min) * value + min);
18  }
19 
21 
22 } }
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19