Math.hh 2.26 KB
Newer Older
Robert Menzel's avatar
Robert Menzel committed
1
////////////////////////////////////////////////////////////////////////////////
2
// Copyright (c) 2011, 2012 Computer Graphics Group RWTH Aachen University    //
Robert Menzel's avatar
Robert Menzel committed
3
4
5
6
7
8
// All rights reserved.                                                       //
////////////////////////////////////////////////////////////////////////////////

#ifndef ACGL_MATH_HH
#define ACGL_MATH_HH

Robert Menzel's avatar
Robert Menzel committed
9
10
#include <ACGL/ACGL.hh>

Robert Menzel's avatar
Robert Menzel committed
11
12
13
14
15
/*
 * For our basic vector math we use the GLM library.
 * This library has the advantage that it was designed to mimic the
 * syntax of GLSL for datatypes (vectors, matrices etc.) as well as functions.
 * It also supports swizzling similar to GLSL.
16
17
18
 *
 * Swizzling has to be defined before the glm.hpp gets first included, no not forget
 * this, you should never include glm yourself, but include always our ACGL/Math.hh!
Robert Menzel's avatar
Robert Menzel committed
19
 */
20

21
22
23
/////////////////////////////////////////////////////////////////////////////////////
// ignore compiler warnings from GLM:
//
Robert Menzel's avatar
Robert Menzel committed
24
#ifdef _MSC_VER
25
26
27
28
29
#pragma warning( push )
#pragma warning ( disable : 4201 )
#pragma warning ( disable : 4100 )
#pragma warning ( disable : 4996 )
#pragma warning ( disable : 4244 )
Robert Menzel's avatar
Robert Menzel committed
30
31
#endif

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4))
#define COMPILER_IS_GCC_4_6_OR_NEWER
#endif

#ifdef __clang__
//   clang/llvm:
#    pragma clang diagnostic push
#    pragma clang diagnostic ignored "-Wuninitialized"
#    pragma clang diagnostic ignored "-Wunused-parameter"
#elif defined __GNUC__
#  ifdef COMPILER_IS_GCC_4_6_OR_NEWER
//    gcc >= 4.6:
#     pragma GCC diagnostic push
#     pragma GCC diagnostic ignored "-Wtype-limits"
#  endif
// gcc:
#  pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
//
/////////////////////////////////////////////////////////////////////////////////////


Robert Menzel's avatar
Robert Menzel committed
54
55
#include <glm/glm.hpp>
#include <glm/ext.hpp>
56

57
58
59
60
61
62
63
64
65
66
67
68
69

/////////////////////////////////////////////////////////////////////////////////////
// reactivate compiler warnings:
//
#ifdef __clang__
// clang/llvm:
#  pragma clang diagnostic pop
#elif defined COMPILER_IS_GCC_4_6_OR_NEWER
// gcc >= 4.6:
#  pragma GCC diagnostic pop
#endif

#ifdef _MSC_VER
Robert Menzel's avatar
Robert Menzel committed
70
71
#pragma warning( pop )
#endif
72
73
//
/////////////////////////////////////////////////////////////////////////////////////
Robert Menzel's avatar
Robert Menzel committed
74

Robert Menzel's avatar
Robert Menzel committed
75
76
77
#include <ACGL/Math/Constants.hh>
#include <ACGL/Math/Functions.hh>

78
#endif // ACGL_MATH_HH