istereo
annotate libs/vmath/basis.h @ 28:c0ae8e668447
added vmath library
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Thu, 08 Sep 2011 08:30:42 +0300 |
parents | |
children | ff055bff6a15 |
rev | line source |
---|---|
nuclear@28 | 1 #ifndef VMATH_BASIS_H_ |
nuclear@28 | 2 #define VMATH_BASIS_H_ |
nuclear@28 | 3 |
nuclear@28 | 4 #include "vector.h" |
nuclear@28 | 5 #include "matrix.h" |
nuclear@28 | 6 |
nuclear@28 | 7 enum { |
nuclear@28 | 8 LEFT_HANDED, |
nuclear@28 | 9 RIGHT_HANDED |
nuclear@28 | 10 }; |
nuclear@28 | 11 |
nuclear@28 | 12 #ifdef __cplusplus |
nuclear@28 | 13 extern "C" { |
nuclear@28 | 14 #endif /* __cplusplus */ |
nuclear@28 | 15 |
nuclear@28 | 16 void basis_matrix(mat4_t res, vec3_t i, vec3_t j, vec3_t k); |
nuclear@28 | 17 void basis_matrix_dir(mat4_t res, vec3_t dir); |
nuclear@28 | 18 |
nuclear@28 | 19 #ifdef __cplusplus |
nuclear@28 | 20 } /* extern "C" */ |
nuclear@28 | 21 |
nuclear@28 | 22 class Basis { |
nuclear@28 | 23 public: |
nuclear@28 | 24 Vector3 i, j, k; |
nuclear@28 | 25 |
nuclear@28 | 26 Basis(); |
nuclear@28 | 27 Basis(const Vector3 &i, const Vector3 &j, const Vector3 &k); |
nuclear@28 | 28 Basis(const Vector3 &dir, bool left_handed = true); |
nuclear@28 | 29 |
nuclear@28 | 30 void rotate(scalar_t x, scalar_t y, scalar_t z); |
nuclear@28 | 31 void rotate(const Vector3 &axis, scalar_t angle); |
nuclear@28 | 32 void rotate(const Matrix4x4 &mat); |
nuclear@28 | 33 void rotate(const Quaternion &quat); |
nuclear@28 | 34 |
nuclear@28 | 35 Matrix3x3 create_rotation_matrix() const; |
nuclear@28 | 36 }; |
nuclear@28 | 37 #endif /* __cplusplus */ |
nuclear@28 | 38 |
nuclear@28 | 39 #endif /* VMATH_BASIS_H_ */ |