Commit Graph

591 Commits

Author SHA1 Message Date
Miro Knejp
c351089e9f Dedicated extension to represent angle values
Defines a dedicated type and operations for angles taking care of the radians/degrees issue and enforcing semantically sane usage.

Applying these types consistently can prevent many problems related to conversions between degrees and radians. Furthermore it only supports operations which preserve the angle's dimension (under the assumption it is not dimensionless) allowing the compiler to detect misuses in equations. By not manually converting between degrees and radians everywhere in your program you can even gain some extra speed efficiency.

Where ever you deal with angles (regardless if class members or function arguments) always use fangle/dangle and let it deal with the calculations necessary for radians/degrees conversions. Never again use a plain `float` in interfaces to represent angles or worry about these nuisances.

The angle types should be no bigger than the datatype used for representation (if they are complain to your compiler vendor), are as efficient in copy and assignment operations as a native float or double, and can be safely passed by-value without fear of performance problems.
2015-05-11 18:02:55 +02:00
Christophe Riccio
099bef4d16 Fixed GCC build 2015-05-01 14:48:55 +02:00
Christophe Riccio
a472f50767 Fixed C++98 build 2015-05-01 14:13:48 +02:00
Christophe Riccio
042270d049 Added 'fmod' overload to GTX_common with tests, Removed integer specification for 'mod' in GTC_integer #308 2015-02-15 12:38:23 +01:00
Christophe Riccio
387df50459 Updated GTC_color 2015-02-12 21:21:50 +01:00
Christophe Riccio
40d0bc2e85 Added GTC_color, rgbToSrgb and srgbToRgb with tests 2015-02-10 23:49:49 +01:00
Christophe Riccio
4eec569f92 Disabled GTX_scalar_multiplication for GCC, failing to build tests #242 2015-01-10 13:45:41 +01:00
Christophe Riccio
d9290d7887 Fixed GTC_packing *pack*norm*x* build and added tests #292 2015-01-09 23:14:10 +01:00
Christophe Riccio
2336264f4e Added ARM instruction set detection 2014-12-20 17:16:52 +01:00
Christophe Riccio
fc8b4404f0 Fixed faceforward build #289 2014-12-19 23:54:25 +01:00
Christophe Riccio
4340f3fa6f Fixed C++ language restriction using GLM_FORCE_CXX** 2014-12-10 21:29:41 +01:00
Christophe Riccio
c556770a32 Fixed C++98 only build 2014-12-10 02:52:30 +01:00
Christophe Riccio
5331b67ad0 Clean up GLM_MESSAGES compilation log to report only detected capabilities 2014-12-10 02:27:13 +01:00
Christophe Riccio
e1a9702097 Fixed GTC_integer test 2014-12-04 22:47:30 +01:00
Christophe Riccio
bd2601f12a Removed warnings 2014-12-04 00:27:49 +01:00
Christophe Riccio
09083fef05 Added more log2 tests 2014-12-02 20:48:26 +01:00
Christophe Riccio
83ad80d6b4 Fixed clang build 2014-11-29 20:52:53 +01:00
Christophe Riccio
a42f84ed47 Removed GLM_TEST_ENABLE_PERF 2014-11-29 20:46:58 +01:00
Christophe Riccio
0b9b157e24 Fixed test return type 2014-11-29 20:44:21 +01:00
Christophe Riccio
d79b17bcd1 Fixed test compiler error in Clang 2014-11-29 20:34:34 +01:00
Christophe Riccio
98fd37bef1 Fixed build 2014-11-29 20:28:25 +01:00
Christophe Riccio
a6b31d8fa1 Fixed test build 2014-11-29 20:21:13 +01:00
Christophe Riccio
cfac6e1b06 Fixed _tzcnt_u32 build, only with Windows 2014-11-29 19:10:55 +01:00
Christophe Riccio
7e81213fdd Fixed mod function specialization #281 Fixed bitscan detection 2014-11-29 18:47:58 +01:00
Christophe Riccio
bdd723ed3b Updated deprecated compilers 2014-11-27 23:42:35 +01:00
Christophe Riccio
3f48ffefb0 Updated license 2014-11-26 00:27:12 +01:00
Christophe Riccio
c20df07879 Updated license 2014-11-25 22:25:24 +01:00
Christophe Riccio
e8fbcf76dd Optimizations of log2 for ivec4 2014-11-24 01:56:36 +01:00
Christophe Riccio
97182990a7 Move GTC_type_aligned to GTX extensions 2014-11-23 21:00:17 +01:00
Christophe Riccio
7621a735a3 Move GTC_type_aligned to GTX extensions 2014-11-23 20:58:09 +01:00
Christophe Riccio
c79394b899 More tests and comments for type_aligned 2014-11-23 20:44:54 +01:00
Christophe Riccio
9b96b31f0e Fixed alignment on Visual C++ 2014-11-23 13:20:14 +01:00
Christophe Riccio
b062bd9ff2 First step to add GTC_type_aligned 2014-11-23 01:02:03 +01:00
Christophe Riccio
0bffce4f4b Optimized findMSB and findLSB 2014-11-22 20:14:48 +01:00
Christophe Riccio
38161f01f8 Further optimized glm::sign for signed and unsigned int #271 2014-11-21 23:43:48 +01:00
Christophe Riccio
f98f2b107a Merge branch 'GTC_integer' 2014-11-21 22:50:00 +01:00
Christophe Riccio
6f8bbecbf5 Updated sign 2014-11-21 22:49:39 +01:00
Christophe Riccio
b0b84a3dc1 Optimized sign for vector types #271 2014-11-21 00:50:47 +01:00
Christophe Riccio
88894045af Added integer log2 test 2014-11-19 00:40:45 +01:00
Christophe Riccio
2d50df61c3 Initial structure for GTC_integer 2014-11-17 23:56:41 +01:00
Christophe Riccio
3adf263341 Added GLM_FORCE_EXPLICIT_CTOR to require explicit type conversions #269 2014-11-17 22:59:10 +01:00
Christophe Riccio
1a4bc0d8a5 Added more geometric function tests 2014-11-16 20:52:54 +01:00
Christophe Riccio
bc5fe52a44 Removed empty GTC_integer 2014-11-16 16:42:47 +01:00
Christophe Riccio
9c65087f90 Fixed build on VC2010 2014-11-16 01:13:01 +01:00
Christophe Riccio
2d48d922bd Updated VC support compilers list 2014-11-16 01:12:18 +01:00
Christophe Riccio
72cbc4c065 Fixed uaddCarray and updated tests #253 2014-11-15 22:31:08 +01:00
Christophe Riccio
b90c4c430e Added GLM_HAS_TRIVIAL_QUERIES define 2014-11-15 21:59:46 +01:00
Christophe Riccio
0ff773a46a Added force CXX98 test 2014-11-15 21:59:28 +01:00
Christophe Riccio
45645988e9 Fixed uaddCarray #253. Fixed GCC build errors. 2014-11-15 21:32:56 +01:00
Christophe Riccio
5960196ce8 Clean up white spaces, fix build with VC15 2014-11-15 20:36:53 +01:00