vmmlib  1.10.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 # ifndef HAVE_SSIZE_T
35 # include <basetsd.h>
36 typedef SSIZE_T ssize_t;
37 # define HAVE_SSIZE_T
38 # endif
39 typedef UINT8 uint8_t;
40 #else
41 # include <stdint.h>
42 #endif
43 
44 namespace vmml
45 {
46 template< size_t M, size_t N, typename T > class matrix;
47 template< size_t M, typename T > class vector;
48 template < typename T > class quaternion;
49 template< typename T > class AABB;
50 template< typename T > class Frustum;
51 template< typename T > class FrustumCuller;
52 template< typename T > class Ray;
53 
58 
72 
75 
78 
81 
84 
87 
88 }
89 
90 #endif
Represents a frustum, following OpenGL conventions.
Definition: frustum.hpp:42
vector< 2, int > Vector2i
A 2-component int vector.
Definition: types.hpp:59
vector< 4, double > Vector4d
A 4-component double vector.
Definition: types.hpp:66
vector< 2, float > Vector2f
A 2-component float vector.
Definition: types.hpp:67
vector< 3, double > Vector3d
A 3-component double vector.
Definition: types.hpp:65
FrustumCuller< double > FrustumCullerd
A double frustum culler.
Definition: types.hpp:80
Helper class to perform OpenGL view frustum culling.
AABB< double > AABBd
A double bounding box.
Definition: types.hpp:83
vmml::Ray< float > Rayf
A float ray.
Definition: types.hpp:85
matrix< 4, 4, float > Matrix4f
A 4x4 float matrix.
Definition: types.hpp:57
matrix< 4, 4, double > Matrix4d
A 4x4 double matrix.
Definition: types.hpp:55
matrix< 3, 3, double > Matrix3d
A 3x3 double matrix.
Definition: types.hpp:52
vector< 3, uint8_t > Vector3ub
A 3-component byte vector.
Definition: types.hpp:70
quaternion< float > Quaternionf
A float quaternion.
Definition: types.hpp:73
vector< 4, uint8_t > Vector4ub
A 4-component byte vector.
Definition: types.hpp:71
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:62
An axis-aligned bounding box.
Definition: aabb.hpp:50
vector< 4, int > Vector4i
A 4-component int vector.
Definition: types.hpp:61
matrix< 3, 3, float > Matrix3f
A 3x3 float matrix.
Definition: types.hpp:56
vector< 3, float > Vector3f
A 3-component float vector.
Definition: types.hpp:68
vector< 4, unsigned > Vector4ui
A 4-component unsigned int vector.
Definition: types.hpp:64
vector< 4, float > Vector4f
A 4-component float vector.
Definition: types.hpp:69
Frustum< double > Frustumd
A double frustum.
Definition: types.hpp:77
Frustum< float > Frustumf
A float frustum.
Definition: types.hpp:76
vector< 3, int > Vector3i
A 3-component int vector.
Definition: types.hpp:60
AABB< float > AABBf
A float bounding box.
Definition: types.hpp:82
vmml::Ray< double > Rayd
A double ray.
Definition: types.hpp:86
quaternion< double > Quaterniond
A doubl quaternion.
Definition: types.hpp:74
vector< 3, unsigned > Vector3ui
A 3-component unsigned int vector.
Definition: types.hpp:63
FrustumCuller< float > FrustumCullerf
A float frustum culler.
Definition: types.hpp:79