Choreonoid  1.8
ContactMaterial.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_CONTACT_MATERIAL_H
7 #define CNOID_BODY_CONTACT_MATERIAL_H
8 
9 #include "Material.h"
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT ContactMaterial : public Referenced
15 {
16  public:
18  ContactMaterial(const Mapping* info);
19  ContactMaterial(const ContactMaterial& org);
20  ~ContactMaterial();
21 
22  double friction() const { return staticFriction_; }
23  void setFriction(double mu){ staticFriction_ = dynamicFriction_ = mu; }
24 
25  double staticFriction() const { return staticFriction_; }
26  void setStaticFriction(double mu) { staticFriction_ = mu; }
27 
28  double dynamicFriction() const { return dynamicFriction_; }
29  void setDynamicFriction(double mu) { dynamicFriction_ = mu; }
30 
31  double restitution() const { return restitution_; }
32  void setRestitution(double r) { restitution_ = r; }
33 
34  Mapping* info() { return info_; }
35  const Mapping* info() const { return info_; }
36  template<typename T> T info(const std::string& key, const T& defaultValue) const;
37 
38  private:
39  double staticFriction_;
40  double dynamicFriction_;
41  double restitution_;
42  MappingPtr info_;
43 
44  void init();
45 };
46 
47 template<> CNOID_EXPORT bool ContactMaterial::info(const std::string& key, const bool& defaultValue) const;
48 template<> CNOID_EXPORT int ContactMaterial::info(const std::string& key, const int& defaultValue) const;
49 template<> CNOID_EXPORT double ContactMaterial::info(const std::string& key, const double& defaultValue) const;
50 
52 
53 }
54 
55 #endif
cnoid::ContactMaterial::setRestitution
void setRestitution(double r)
Definition: ContactMaterial.h:32
cnoid::ContactMaterial::friction
double friction() const
Definition: ContactMaterial.h:22
cnoid::Mapping
Definition: ValueTree.h:253
cnoid::ContactMaterialPtr
ref_ptr< ContactMaterial > ContactMaterialPtr
Definition: ContactMaterial.h:51
cnoid::ContactMaterial::info
const Mapping * info() const
Definition: ContactMaterial.h:35
cnoid::ContactMaterial::dynamicFriction
double dynamicFriction() const
Definition: ContactMaterial.h:28
cnoid::ContactMaterial::info
Mapping * info()
Definition: ContactMaterial.h:34
cnoid::ref_ptr< Mapping >
cnoid::ContactMaterial::restitution
double restitution() const
Definition: ContactMaterial.h:31
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::ContactMaterial
Definition: ContactMaterial.h:14
cnoid::Referenced
Definition: Referenced.h:54
cnoid::ContactMaterial::setFriction
void setFriction(double mu)
Definition: ContactMaterial.h:23
cnoid::ContactMaterial::setDynamicFriction
void setDynamicFriction(double mu)
Definition: ContactMaterial.h:29
cnoid::ContactMaterial::setStaticFriction
void setStaticFriction(double mu)
Definition: ContactMaterial.h:26
Material.h
cnoid::ContactMaterial::staticFriction
double staticFriction() const
Definition: ContactMaterial.h:25