Line -... |
Line 1... |
- |
|
1 |
/* ----------------------------------------------------------------------- *
|
- |
|
2 |
* This file is part of GEL, http://www.imm.dtu.dk/GEL
|
- |
|
3 |
* Copyright (C) the authors and DTU Informatics
|
- |
|
4 |
* For license and list of authors, see ../../doc/intro.pdf
|
- |
|
5 |
* ----------------------------------------------------------------------- */
|
- |
|
6 |
|
1 |
#include "ArithSqMat4x4Float.h"
|
7 |
#include "ArithSqMat4x4Float.h"
|
2 |
#include "Mat4x4f.h"
|
8 |
#include "Mat4x4f.h"
|
3 |
#include "Mat4x4d.h"
|
9 |
#include "Mat4x4d.h"
|
4 |
|
10 |
|
5 |
namespace CGLA {
|
11 |
namespace CGLA {
|
Line 27... |
Line 33... |
27 |
template<class V, class M>
|
33 |
template<class V, class M>
|
28 |
M invert_affine(const ArithSqMat4x4Float<V,M>& this_mat)
|
34 |
M invert_affine(const ArithSqMat4x4Float<V,M>& this_mat)
|
29 |
{
|
35 |
{
|
30 |
// The following com[3]e has been copied from a gem in Graphics Gems II by
|
36 |
// The following com[3]e has been copied from a gem in Graphics Gems II by
|
31 |
// Kevin Wu.
|
37 |
// Kevin Wu.
|
- |
|
38 |
// From the EULA: "Using the code is permitted in any program, product, or
|
- |
|
39 |
// library, non-commercial or commercial. Giving credit is not required, though is a nice gesture"
|
32 |
// The function is very fast, but it can only invert affine matrices. An
|
40 |
// The function is very fast, but it can only invert affine matrices. An
|
33 |
// exception NotAffine is thrown if the matrix is not affine, and another
|
41 |
// exception NotAffine is thrown if the matrix is not affine, and another
|
34 |
// exception Singular is thrown if the matrix is singular.
|
42 |
// exception Singular is thrown if the matrix is singular.
|
35 |
|
43 |
|
36 |
typedef typename M::ScalarType ScalarType;
|
44 |
typedef typename M::ScalarType ScalarType;
|