Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
transformutils.cc File Reference
#include "ion/math/transformutils.h"
#include <cmath>
#include "ion/base/logging.h"
#include "ion/base/static_assert.h"
#include "ion/math/angleutils.h"
#include "ion/math/matrixutils.h"
#include "ion/math/utils.h"
#include "ion/math/vectorutils.h"
Include dependency graph for transformutils.cc:

Go to the source code of this file.

Namespaces

 ion
 Copyright 2016 Google Inc.
 
 ion::math
 

Macros

#define ION_INSTANTIATE_FUNCTIONS(type)
 Instantiate functions for supported types. More...
 

Functions

template<typename T >
const Matrix< 4, Tion::math::OrthoInverseH (const Matrix< 4, T > &m)
 Public functions. More...
 
template<typename T >
ION_API const Matrix< 4, Tion::math::RotationMatrixH (const Rotation< T > &r)
 Returns a 4x4 Matrix representing a 3D rotation. More...
 
template<typename T >
ION_API const Matrix< 3, Tion::math::RotationMatrixNH (const Rotation< T > &r)
 Returns a 3x3 Matrix representing a 3D rotation. More...
 
template<typename T >
ION_API const Matrix< 4, Tion::math::LookAtMatrixFromCenter (const Point< 3, T > &eye, const Point< 3, T > &center, const Vector< 3, T > &up)
 View matrices. More...
 
template<typename T >
ION_API const Matrix< 4, Tion::math::LookAtMatrixFromDir (const Point< 3, T > &eye, const Vector< 3, T > &dir, const Vector< 3, T > &up)
 Returns a 4x4 viewing matrix based on the given camera parameters, which use a view direction rather than look at center point. More...
 
template<typename T >
ION_API const Matrix< 4, Tion::math::OrthographicMatrixFromFrustum (T x_left, T x_right, T y_bottom, T y_top, T z_near, T z_far)
 Projection matrices. More...
 
template<typename T >
ION_API const Matrix< 4, Tion::math::PerspectiveMatrixFromFrustum (T x_left, T x_right, T y_bottom, T y_top, T z_near, T z_far)
 Returns a 4x4 perspective projection matrix based on the given parameters, which follow the conventions of the old glFrustum() function. More...
 
template<typename T >
ION_API const Matrix< 4, Tion::math::PerspectiveMatrixFromView (const Angle< T > &fovy, T aspect, T z_near, T z_far)
 Returns a 4x4 perspective projection matrix based on the given parameters, which follow the conventions of the gluPerspective() function. More...
 
template<typename T >
ION_API const Matrix< 4, Tion::math::PerspectiveMatrixInverse (const Matrix< 4, T > &m)
 Returns the inverse of m iff m is a perspective projection matrix, i.e., iff it has the following form:

[X 0 A 0]
[0 Y B 0]
[0 0 C D]
[0 0 -1 0]

Triggers a DCHECK otherwise. More...

 
 ion::math::ION_INSTANTIATE_FUNCTIONS (double)
 
 ion::math::ION_INSTANTIATE_FUNCTIONS (float)
 

Macro Definition Documentation

#define ION_INSTANTIATE_FUNCTIONS (   type)
Value:
template const Matrix<4, type> ION_API OrthoInverseH( \
const Matrix<4, type>& r); \
template const Matrix<4, type> ION_API RotationMatrixH( \
const Rotation<type>& r); \
template const Matrix<3, type> ION_API RotationMatrixNH( \
const Rotation<type>& r); \
template const Matrix<4, type> ION_API LookAtMatrixFromCenter( \
const Point<3, type>& eye, const Point<3, type>& center, \
const Vector<3, type>& up); \
template const Matrix<4, type> ION_API LookAtMatrixFromDir( \
const Point<3, type>& eye, const Vector<3, type>& dir, \
const Vector<3, type>& up); \
template const Matrix<4, type> ION_API OrthographicMatrixFromFrustum( \
type x_left, type x_right, type y_bottom, type y_top, \
type z_near, type z_far); \
template const Matrix<4, type> ION_API PerspectiveMatrixFromFrustum( \
type x_left, type x_right, type y_bottom, type y_top, \
type z_near, type z_far); \
template const Matrix<4, type> ION_API PerspectiveMatrixFromView( \
const Angle<type>& fovy, type aspect, type z_near, type z_far); \
template const Matrix<4, type> ION_API PerspectiveMatrixInverse( \
const Matrix<4, type>& m)
std::string type
Definition: printer.cc:353
ION_API const Matrix< 4, T > RotationMatrixH(const Rotation< T > &r)
Returns a 4x4 Matrix representing a 3D rotation.
ION_API const Matrix< 4, T > LookAtMatrixFromDir(const Point< 3, T > &eye, const Vector< 3, T > &dir, const Vector< 3, T > &up)
Returns a 4x4 viewing matrix based on the given camera parameters, which use a view direction rather ...
ION_API const Matrix< 4, T > LookAtMatrixFromCenter(const Point< 3, T > &eye, const Point< 3, T > &center, const Vector< 3, T > &up)
View matrices.
ION_API const Matrix< 4, T > PerspectiveMatrixFromFrustum(T x_left, T x_right, T y_bottom, T y_top, T z_near, T z_far)
Returns a 4x4 perspective projection matrix based on the given parameters, which follow the conventio...
ION_API const Matrix< 3, T > RotationMatrixNH(const Rotation< T > &r)
Returns a 3x3 Matrix representing a 3D rotation.
ION_API const Matrix< 4, T > PerspectiveMatrixFromView(const Angle< T > &fovy, T aspect, T z_near, T z_far)
Returns a 4x4 perspective projection matrix based on the given parameters, which follow the conventio...
const Matrix< 4, T > OrthoInverseH(const Matrix< 4, T > &m)
Public functions.
ION_API const Matrix< 4, T > OrthographicMatrixFromFrustum(T x_left, T x_right, T y_bottom, T y_top, T z_near, T z_far)
Projection matrices.
ION_API const Matrix< 4, T > PerspectiveMatrixInverse(const Matrix< 4, T > &m)
Returns the inverse of m iff m is a perspective projection matrix, i.e., iff it has the following for...

Instantiate functions for supported types.

Definition at line 271 of file transformutils.cc.