30 #ifndef _LibPhysic_BodyT_H
31 #define _LibPhysic_BodyT_H
33 #include <type_traits>
68 GRANOO_ACCESS_GET (center ,
Geom::Point , Node::get_center() );
74 virtual std::string
info()
const;
82 template<
class Archive>
void serialize(Archive&,
const unsigned int);
85 #ifndef DOXYGEN_SHOULD_SKIP_THIS
89 :
Body(*this, p,q,mass,tensor),
90 shape(
Body::local_frame()) {
95 : BodyT<shape>(Geom::global::center, Geom::global::quaternion, 0., Geom::global::tensor) {
102 template<
class shape>
106 Drawable::apply_color();
108 glMultMatrixd(local_frame().get_glMatrix());
114 template<
class shape>
118 Drawable::apply_color();
120 glMultMatrixd(local_frame().get_glMatrix());
121 shape::draw_gl_edge();
128 template<
class shape>
131 std::ostringstream os;
137 template<
class shape>
138 template<
class Archive>
141 ar & boost::serialization::base_object<Body>(*
this);
142 ar & boost::serialization::base_object<shape>(*
this);
153 GRANOO_CLASS_DECLARE_TPL(Physic::BodyT<Shape::Sphere>);
154 GRANOO_CLASS_DECLARE_TPL(Physic::BodyT<Shape::Box>);
155 GRANOO_CLASS_DECLARE_TPL(Physic::BodyT<Shape::Cylinder>);
156 GRANOO_CLASS_DECLARE_TPL(Physic::BodyT<Shape::Cone>);
157 GRANOO_CLASS_DECLARE_TPL(Physic::BodyT<Shape::Polyhedron>);
Definition: SetOf.hpp:346
Definition: Quaternion.hpp:54
Definition: Tensor.hpp:62
a class that represents a body
Definition: Body.hpp:43
std::string info() const
Display some useful info in the terminal
Definition: Body.cpp:63
virtual void draw()
util method for GL drawing the element (used by granoo-viewer)
void serialize(Archive &, const unsigned int)
complete serializing of the element in the *.gdd format
BodyT(const BodyT &)=delete
virtual std::string info() const
get some info on a given element
BodyT & operator=(const BodyT &)=delete
BodyT(const Geom::Point &p, const Geom::Quaternion &q, double mass, const Geom::Tensor &tensor)
constructor
friend class boost::serialization::access
Definition: BodyT.hpp:81
BodyT()
default constructor
virtual ~BodyT()
destructor
const Geom::Frame & local_frame() const
Definition: Node.hpp:262
Definition: Common.hpp:198