vmmlib  1.11.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 > class Matrix;
43 template< size_t M, typename T > class vector;
44 template< typename T > class AABB;
45 template< typename T > class Frustum;
46 template< typename T > class FrustumCuller;
47 template< typename T > class Quaternion;
48 template< typename T > class Ray;
49 
56 
70 
73 
76 
79 
82 
84 typedef Ray< float > Rayf;
85 
86 }
87 
88 #endif
Represents a frustum, following OpenGL conventions.
Definition: frustum.hpp:42
vector< 2, int > Vector2i
A 2-component int vector.
Definition: types.hpp:58
vector< 4, double > Vector4d
A 4-component double vector.
Definition: types.hpp:65
vector< 2, float > Vector2f
A 2-component float vector.
Definition: types.hpp:57
vector< 3, double > Vector3d
A 3-component double vector.
Definition: types.hpp:60
Matrix< 2, 2, float > Matrix2f
A 2x2 float matrix.
Definition: types.hpp:51
FrustumCuller< double > FrustumCullerd
A double frustum culler.
Definition: types.hpp:77
Helper class to perform OpenGL view frustum culling.
Matrix< 4, 4, double > Matrix4d
A 4x4 double matrix.
Definition: types.hpp:54
AABB< double > AABBd
A double bounding box.
Definition: types.hpp:80
Quaternion< double > Quaterniond
A double quaternion.
Definition: types.hpp:71
Matrix< 3, 3, float > Matrix3f
A 3x3 float matrix.
Definition: types.hpp:53
vector< 3, uint8_t > Vector3ub
A 3-component byte vector.
Definition: types.hpp:63
Ray< double > Rayd
A double ray.
Definition: types.hpp:83
vector< 4, uint8_t > Vector4ub
A 4-component byte vector.
Definition: types.hpp:68
heavily inspired by boost::enable_if http://www.boost.org, file: boost/utility/enable_if.hpp, Copyright 2003 Jaakko Järvi, Jeremiah Willcock, Andrew Lumsdaine
Definition: aabb.hpp:40
vector< 2, unsigned > Vector2ui
A 2-component unsigned int vector.
Definition: types.hpp:59
An axis-aligned bounding box.
Definition: aabb.hpp:50
Ray< float > Rayf
A float ray.
Definition: types.hpp:84
vector< 4, int > Vector4i
A 4-component int vector.
Definition: types.hpp:67
Matrix< 4, 4, float > Matrix4f
A 4x4 float matrix.
Definition: types.hpp:55
vector< 3, float > Vector3f
A 3-component float vector.
Definition: types.hpp:61
vector< 4, unsigned > Vector4ui
A 4-component unsigned int vector.
Definition: types.hpp:69
vector< 4, float > Vector4f
A 4-component float vector.
Definition: types.hpp:66
Matrix< 3, 3, double > Matrix3d
A 3x3 double matrix.
Definition: types.hpp:52
Matrix< 2, 2, double > Matrix2d
A 2x2 double matrix.
Definition: types.hpp:48
Frustum< double > Frustumd
A double frustum.
Definition: types.hpp:74
Frustum< float > Frustumf
A float frustum.
Definition: types.hpp:75
vector< 3, int > Vector3i
A 3-component int vector.
Definition: types.hpp:62
AABB< float > AABBf
A float bounding box.
Definition: types.hpp:81
Matrix with R rows and C columns of element type T.
Definition: matrix.hpp:51
vector< 3, unsigned > Vector3ui
A 3-component unsigned int vector.
Definition: types.hpp:64
Quaternion< float > Quaternionf
A float quaternion.
Definition: types.hpp:72
FrustumCuller< float > FrustumCullerf
A float frustum culler.
Definition: types.hpp:78