istereo

view 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
line source
1 #ifndef VMATH_BASIS_H_
2 #define VMATH_BASIS_H_
4 #include "vector.h"
5 #include "matrix.h"
7 enum {
8 LEFT_HANDED,
9 RIGHT_HANDED
10 };
12 #ifdef __cplusplus
13 extern "C" {
14 #endif /* __cplusplus */
16 void basis_matrix(mat4_t res, vec3_t i, vec3_t j, vec3_t k);
17 void basis_matrix_dir(mat4_t res, vec3_t dir);
19 #ifdef __cplusplus
20 } /* extern "C" */
22 class Basis {
23 public:
24 Vector3 i, j, k;
26 Basis();
27 Basis(const Vector3 &i, const Vector3 &j, const Vector3 &k);
28 Basis(const Vector3 &dir, bool left_handed = true);
30 void rotate(scalar_t x, scalar_t y, scalar_t z);
31 void rotate(const Vector3 &axis, scalar_t angle);
32 void rotate(const Matrix4x4 &mat);
33 void rotate(const Quaternion &quat);
35 Matrix3x3 create_rotation_matrix() const;
36 };
37 #endif /* __cplusplus */
39 #endif /* VMATH_BASIS_H_ */