Math.hh 2.3 KB
Newer Older
1
2
3
4
5
/***********************************************************************
 * Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
 * All rights reserved.                                                *
 * Distributed under the terms of the MIT License (see LICENSE.TXT).   *
 **********************************************************************/
Robert Menzel's avatar
Robert Menzel committed
6
7
8
9

#ifndef ACGL_MATH_HH
#define ACGL_MATH_HH

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

Robert Menzel's avatar
Robert Menzel committed
12
13
14
15
16
/*
 * 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.
17
18
19
 *
 * 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
20
 */
21

22
23
24
/////////////////////////////////////////////////////////////////////////////////////
// ignore compiler warnings from GLM:
//
Robert Menzel's avatar
Robert Menzel committed
25
#ifdef _MSC_VER
26
27
28
29
30
#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
31
32
#endif

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#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
55
56
#include <glm/glm.hpp>
#include <glm/ext.hpp>
57

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

/////////////////////////////////////////////////////////////////////////////////////
// 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
71
72
#pragma warning( pop )
#endif
73
74
//
/////////////////////////////////////////////////////////////////////////////////////
Robert Menzel's avatar
Robert Menzel committed
75

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

79
#endif // ACGL_MATH_HH