nuclear@39: /* nuclear@39: libvmath - a vector math library nuclear@39: Copyright (C) 2004-2011 John Tsiombikas nuclear@39: nuclear@39: This program is free software: you can redistribute it and/or modify nuclear@39: it under the terms of the GNU Lesser General Public License as published nuclear@39: by the Free Software Foundation, either version 3 of the License, or nuclear@39: (at your option) any later version. nuclear@39: nuclear@39: This program is distributed in the hope that it will be useful, nuclear@39: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@39: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@39: GNU Lesser General Public License for more details. nuclear@39: nuclear@39: You should have received a copy of the GNU Lesser General Public License nuclear@39: along with this program. If not, see . nuclear@39: */ nuclear@39: nuclear@28: #ifndef VMATH_BASIS_H_ nuclear@28: #define VMATH_BASIS_H_ nuclear@28: nuclear@28: #include "vector.h" nuclear@28: #include "matrix.h" nuclear@28: nuclear@28: enum { nuclear@28: LEFT_HANDED, nuclear@28: RIGHT_HANDED nuclear@28: }; nuclear@28: nuclear@28: #ifdef __cplusplus nuclear@28: extern "C" { nuclear@28: #endif /* __cplusplus */ nuclear@28: nuclear@28: void basis_matrix(mat4_t res, vec3_t i, vec3_t j, vec3_t k); nuclear@28: void basis_matrix_dir(mat4_t res, vec3_t dir); nuclear@28: nuclear@28: #ifdef __cplusplus nuclear@28: } /* extern "C" */ nuclear@28: nuclear@28: class Basis { nuclear@28: public: nuclear@28: Vector3 i, j, k; nuclear@28: nuclear@28: Basis(); nuclear@28: Basis(const Vector3 &i, const Vector3 &j, const Vector3 &k); nuclear@28: Basis(const Vector3 &dir, bool left_handed = true); nuclear@28: nuclear@28: void rotate(scalar_t x, scalar_t y, scalar_t z); nuclear@28: void rotate(const Vector3 &axis, scalar_t angle); nuclear@28: void rotate(const Matrix4x4 &mat); nuclear@28: void rotate(const Quaternion &quat); nuclear@28: nuclear@28: Matrix3x3 create_rotation_matrix() const; nuclear@28: }; nuclear@28: #endif /* __cplusplus */ nuclear@28: nuclear@28: #endif /* VMATH_BASIS_H_ */