1#ifndef MECACELL_BASIS_H
2#define MECACELL_BASIS_H
7template <
typename V>
struct Basis {
8 V
X = V(1, 0, 0),
Y = V(0, 1, 0);
10 Basis(
const V &x,
const V &y) :
X(x),
Y(y) {}
12 V
getZ() {
return X.cross(
Y).normalized(); }
15 X = V(1, 0, 0).rotated(r).normalized();
16 Y = V(0, 1, 0).rotated(r).normalized();
31 return Basis(
X.rotated(r).normalized(),
Y.rotated(r).normalized());
39 out <<
"[ " << b.
X <<
", " << b.
Y <<
", "<<b.Z<<
" ]";
this file contains various miscellanious utility functions & helpers *
std::ostream & operator<<(std::ostream &out, const Basis< T > &b)
void updateWithRotation(const Rotation< V > &r)
friend std::ostream & operator<<(std::ostream &out, const Basis< T > &b)
Basis(const V &x, const V &y)
Basis rotated(const Rotation< V > &r)
void rotate(const Rotation< V > &r)