Mercurial > fife-parpg
comparison engine/core/util/math/matrix.h @ 646:07b1cf8e92b5
* Major improvements to fife_math.h and added corresponding Python bindings. Users now have access to FIFE's internal math functions. These functions are recommended to be used by all clients if required. Note: this may cause some problems with certain compilers. I hope this wont have to be reverted. TODO: remove the static constant globals somehow.
* Adopted the new math functions for all subsystems
* Improvements to DeviceCaps. It now detects all possible screen modes.
* User can now select 0 for their bpp and it will attempt to initialize SDL with the current screen bpp.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Wed, 13 Oct 2010 20:24:48 +0000 |
parents | 356634098bd9 |
children |
comparison
equal
deleted
inserted
replaced
645:291ba2946c73 | 646:07b1cf8e92b5 |
---|---|
116 register T mag = sqrt(magSqr); | 116 register T mag = sqrt(magSqr); |
117 x/=mag; | 117 x/=mag; |
118 y/=mag; | 118 y/=mag; |
119 z/=mag; | 119 z/=mag; |
120 } | 120 } |
121 T c = cos(angle*DBL_PI/180); | 121 T c = Math<T>::Cos(angle*Math<T>::pi()/180); |
122 T s = sin(angle*DBL_PI/180); | 122 T s = Math<T>::Sin(angle*Math<T>::pi()/180); |
123 m0 = x*x*(1-c)+c; | 123 m0 = x*x*(1-c)+c; |
124 m1 = y*x*(1-c)+z*s; | 124 m1 = y*x*(1-c)+z*s; |
125 m2 = z*x*(1-c)-y*s; | 125 m2 = z*x*(1-c)-y*s; |
126 m3 = 0; | 126 m3 = 0; |
127 | 127 |