Program Listing for File body_rotation.h¶
↰ Return to documentation for file (src/rlenvs/rigid_bodies/body_rotation.h)
#ifndef BODY_ROTATION_H
#define BODY_ROTATION_H
#include "rlenvs/rlenvs_types_v2.h"
#include <initializer_list>
#include <ostream>
namespace rlenvscpp{
namespace rigid_bodies{
struct RBRotation
{
real_t x;
real_t y;
real_t z;
RBRotation();
RBRotation(std::initializer_list<real_t> vals);
std::ostream& print(std::ostream& out)const noexcept;
};
inline
RBRotation::RBRotation()
:
RBRotation({0.0, 0.0, 0.0})
{}
inline
RBRotation::RBRotation(std::initializer_list<real_t> vals)
:
x(0.0),
y(0.0),
z(0.0)
{
auto v = vals.begin();
x = *v;
v++;
y = *v;
v++;
z = *v;
}
inline
std::ostream& operator<<(std::ostream& out, const RBRotation& info){
return info.print(out);
}
}
}
#endif