Ravelin
SingleBody.h
1 /****************************************************************************
2  * Copyright 2010 Evan Drumwright
3  * This library is distributed under the terms of the Apache V2.0
4  * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5  ****************************************************************************/
6 
7 #ifndef SINGLE_BODY
8 #error This class is not to be included by the user directly. Use SingleBodyd.h or SingleBodyf.h instead.
9 #endif
10 
11 class ARTICULATED_BODY;
12 
14 class SINGLE_BODY : public virtual DYNAMIC_BODY
15 {
16  public:
17  virtual ~SINGLE_BODY() {}
18  virtual boost::shared_ptr<DYNAMIC_BODY> get_super_body() const;
19 
21  virtual boost::shared_ptr<const POSE3> get_computation_frame() const = 0;
22 
24  virtual REAL get_mass() const = 0;
25 
27  virtual boost::shared_ptr<const POSE3> get_pose() const = 0;
28 
30  virtual const SACCEL& get_accel() = 0;
31 
33  virtual const SVELOCITY& get_velocity() = 0;
34 
36  virtual void apply_impulse(const SMOMENTUM& w) = 0;
37 
39  virtual REAL calc_mass() const = 0;
40 
42  virtual boost::shared_ptr<ARTICULATED_BODY> get_articulated_body() const = 0;
43 
45  virtual bool is_enabled() const = 0;
46 
48  virtual VECTOR3 calc_point_vel(const VECTOR3& point) const = 0;
49 
51  REAL calc_point_vel(const VECTOR3& point, const VECTOR3& dir);
52 
53 }; // end class
54 
virtual const SACCEL & get_accel()=0
Gets the acceleration of the body.
virtual REAL get_mass() const =0
Gets the mass of the body (for gravity calculation)
virtual boost::shared_ptr< ARTICULATED_BODY > get_articulated_body() const =0
Gets the articulated body that this body is a part of (if any)
Abstract class for articulated bodies.
Definition: ArticulatedBody.h:15
virtual void apply_impulse(const SMOMENTUM &w)=0
Applies an impulse at a point on the body.
virtual VECTOR3 calc_point_vel(const VECTOR3 &point) const =0
Calculates the velocity at a point on the body in the body frame
virtual boost::shared_ptr< DYNAMIC_BODY > get_super_body() const
Gets the "super" body.
Definition: SingleBody.cpp:10
virtual boost::shared_ptr< const POSE3 > get_pose() const =0
Gets the pose of the body.
A spatial (six dimensional) momentum.
Definition: SMomentum.h:12
virtual REAL calc_mass() const =0
Calculates the mass of the body.
Superclass for both rigid and deformable bodies.
Definition: SingleBody.h:14
A spatial velocity (a twist)
Definition: SVelocity.h:15
Superclass for deformable bodies and single and multi-rigid bodies.
Definition: DynamicBody.h:14
A spatial (six dimensional) acceleration.
Definition: SAccel.h:14
virtual bool is_enabled() const =0
Determines whether the body is enabled.
A three-dimensional floating point vector used for representing points and vectors in 3D with associa...
Definition: Vector3.h:15
virtual const SVELOCITY & get_velocity()=0
Gets the velocity of the body.
virtual boost::shared_ptr< const POSE3 > get_computation_frame() const =0
Gets the computation frame for the body.