00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _PARTICLE_H_
00022 #define _PARTICLE_H_
00023
00024 #include <vamos/geometry/Three_Vector.h>
00025 #include <vamos/geometry/Three_Matrix.h>
00026 #include <vamos/geometry/Inertia_Tensor.h>
00027 #include <vamos/geometry/Material.h>
00028 #include <vamos/body/Frame.h>
00029 #include <vamos/body/Exerter.h>
00030
00031 namespace Vamos_Body
00032 {
00033
00034
00035
00036
00037
00038 class Particle : public Frame, public Exerter
00039 {
00040 protected:
00041
00042 double m_mass;
00043
00044
00045 Vamos_Geometry::Material_Handle m_material;
00046
00047 public:
00048
00049
00050
00051 Particle (double mass, const Vamos_Geometry::Three_Vector& position,
00052 const Vamos_Geometry::Three_Matrix& orientation);
00053
00054
00055 Particle (double mass, const Vamos_Geometry::Three_Vector& position);
00056
00057
00058 Particle (double mass = 0.0);
00059
00060
00061 virtual ~Particle () {};
00062
00063
00064 virtual Vamos_Geometry::Three_Vector force () const
00065 { return rotate_out (m_force); }
00066
00067
00068
00069 virtual Vamos_Geometry::Three_Vector impulse () const
00070 { return rotate_out (m_impulse); }
00071
00072
00073 virtual Vamos_Geometry::Three_Vector torque () const
00074 { return rotate_out (m_torque); }
00075
00076
00077
00078 virtual Vamos_Geometry::Three_Vector contact_position () const
00079 { return position (); }
00080
00081
00082 virtual Vamos_Geometry::Three_Vector force_position () const
00083 { return position (); }
00084
00085
00086 virtual Vamos_Geometry::Three_Vector torque_position () const
00087 { return position (); }
00088
00089
00090 virtual Vamos_Geometry::Three_Vector mass_position () const
00091 { return position (); }
00092
00093 virtual double contact (const Vamos_Geometry::Three_Vector& position,
00094 const Vamos_Geometry::Inertia_Tensor& inertia,
00095 const Vamos_Geometry::Three_Vector& velocity,
00096 double distance,
00097 const Vamos_Geometry::Three_Vector& normal,
00098 const Vamos_Geometry::Three_Vector& ang_velocity,
00099 Vamos_Geometry::Material_Handle)
00100 { return 0.0; }
00101
00102
00103 double mass () const { return m_mass; }
00104
00105 virtual bool single_contact () const { return true; }
00106 virtual void wind (const Vamos_Geometry::Three_Vector& wind_vector,
00107 double density)
00108 {};
00109
00110
00111 const Vamos_Geometry::Material_Handle& material () const
00112 { return m_material; }
00113 };
00114 }
00115
00116 #endif // not _PARTICLE_H_