vmmlib  1.13.0
Templatized C++ vector and matrix math library
types.hpp
1 /*
2  * Copyright (c) 2016 Stefan.Eilemann@epfl.ch
3  *
4  * This file is part of VMMLib <https://github.com/VMML/vmmlib/>
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * Redistributions of source code must retain the above copyright notice, this
10  * list of conditions and the following disclaimer. Redistributions in binary
11  * form must reproduce the above copyright notice, this list of conditions and
12  * the following disclaimer in the documentation and/or other materials provided
13  * with the distribution. Neither the name of the Visualization and Multimedia
14  * Lab, University of Zurich nor the names of its contributors may be used to
15  * endorse or promote products derived from this software without specific prior
16  * written permission.
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 #ifndef __VMML__VMMLIB_TYPES__HPP__
30 #define __VMML__VMMLIB_TYPES__HPP__
31 
32 #include <sys/types.h>
33 #ifdef _MSC_VER
34 #include <basetsd.h>
35 typedef UINT8 uint8_t;
36 #else
37 #include <stdint.h>
38 #endif
39 
40 namespace vmml
41 {
42 template <size_t M, size_t N, typename T>
43 class Matrix;
44 template <size_t M, typename T>
45 class vector;
46 template <typename T>
47 class AABB;
48 template <typename T>
49 class Frustum;
50 template <typename T>
51 class FrustumCuller;
52 template <typename T>
53 class Quaternion;
54 template <typename T>
55 class Ray;
56 
63 
64 typedef vector<2, float> Vector2f;
66 typedef vector<2, int> Vector2i;
69 typedef vector<3, float> Vector3f;
70 typedef vector<3, int> Vector3i;
74 typedef vector<4, float> Vector4f;
75 typedef vector<4, int> Vector4i;
78 
81 
82 typedef Frustum<double> Frustumd;
83 typedef Frustum<float> Frustumf;
84 
87 
88 typedef AABB<double> AABBd;
89 typedef AABB<float> AABBf;
90 
91 typedef Ray<double> Rayd;
92 typedef Ray<float> Rayf;
93 }
94 
95 #endif
Represents a frustum, following OpenGL conventions.
Definition: frustum.hpp:56
Helper class to perform OpenGL view frustum culling.
Definition: aabb.hpp:44
An axis-aligned bounding box.
Definition: aabb.hpp:47
Matrix with R rows and C columns of element type T.
Definition: matrix.hpp:52