 |
Gorgon Game Engine
|
Go to the documentation of this file.
10 namespace Gorgon {
namespace Geometry {
21 for(
int j=0; j<4; j++) {
30 std::memset(&
mat[0], 0, 4*4*
sizeof(T_));
32 for(
int i=0; i<4; i++) {
37 T_
Get(
int row,
int col)
const {
return mat[row][col]; }
42 auto f = p.
X *
mat[3][0] + p.
Y *
mat[3][1] + p.
Z *
mat[3][2] +
mat[3][3];
52 auto f = p.
X *
mat[3][0] + p.
Y *
mat[3][1] +
mat[3][3];
55 (p.
X *
mat[0][0] + p.
Y *
mat[0][1] +
mat[0][3]) / f,
62 for(
int i=0; i<4; i++)
63 for(
int j=0; j<4; j++)
91 void Scale(T_ x, T_ y, T_ z = 1) {
114 T_ ca = std::cos(z), sa = std::sin(z);
115 T_ cb = std::cos(y), sb = std::sin(y);
116 T_ cc = std::cos(x), sc = std::sin(x);
119 {ca*cb, ca*sb*sc - sa*cc, ca*sb*cc + sa*sc, 0},
120 {sa*cb, sa*cb*sc + ca*cc, sa*sb*cc - ca*sc, 0},
121 {-sb , cb*sc , cb*cc , 0},
130 T_ c = std::cos(ang), s = std::sin(ang);
166 for(
int i=0; i<4; i++) {
167 for(
int j=0; j<4; j++) {
168 out<<transform.
Get(i, j)<<
"\t";
T_ Y
Definition: Point3D.h:67
T_ Z
Definition: Point3D.h:68
T_ X
X coordinate.
Definition: Point.h:368
void init()
Definition: X11.cpp:143
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
T_ X
Definition: Point3D.h:66
This class represents a 2D point.
Definition: Point.h:32
T_ Y
Y coordinate.
Definition: Point.h:371
std::ostream & operator<<(std::ostream &out, const basic_Bounds< T_ > &bounds)
Allows streaming of bounds.
Definition: Bounds.h:415