00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _SURFACE_H_
00019 #define _SURFACE_H_
00020
00021 #include <vamos/geometry/Gl_Texture_Image.h>
00022 #include <vamos/geometry/Handle.h>
00023
00024 #include <string>
00025
00026 namespace Vamos_Geometry
00027 {
00028 class Material;
00029 typedef Handle <Material> Material_Handle;
00030
00031 class Material
00032 {
00033 public:
00034 enum Material_Type
00035 {
00036 RUBBER,
00037 METAL,
00038 ASPHALT,
00039 CONCRETE,
00040 GRASS,
00041 GRAVEL,
00042 DIRT,
00043 UNKNOWN
00044 };
00045
00046 private:
00047 Material_Type m_type;
00048
00049
00050
00051 double m_friction_factor;
00052 double m_restitution_factor;
00053 double m_rolling_resistance_factor;
00054 double m_drag_factor;
00055
00056 double m_bump_amplitude;
00057 double m_bump_wavelength;
00058
00059
00060 Gl_Texture_Image* mp_texture_image;
00061
00062 public:
00063 Material (Material_Type type, double friction, double restitution,
00064 double rolling = 0.0, double drag = 0.0,
00065 double bump_amplitude = 0.0, double bump_wavelength = 0.0,
00066 Gl_Texture_Image* image = 0);
00067 Material ();
00068 Material (const Material& material);
00069 ~Material ();
00070
00071 const Material& operator = (const Material& material);
00072
00073 Gl_Texture_Image* texture_image () { return mp_texture_image; }
00074 double friction_factor () const { return m_friction_factor; }
00075 double rolling_resistance_factor () const
00076 { return m_rolling_resistance_factor; }
00077 double drag_factor () const { return m_drag_factor; }
00078 double restitution_factor () const { return m_restitution_factor; }
00079 double bump (double distance) const;
00080 Material_Type type () const { return m_type; }
00081 };
00082 }
00083
00084 #endif