AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
Material.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19
22#include <agx/FrictionModel.h>
28#include <agx/macros.h>
29#include <agx/SetVector.h>
30
31
32#ifdef _MSC_VER
33# pragma warning(push)
34# pragma warning(disable: 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y
35#endif
36
37namespace agxSDK
38{
39 class MaterialManager;
40}
41namespace agxIO
42{
43 class SceneExporter;
44}
45namespace agxCollide
46{
47 class GeometryContact;
48}
49namespace agxData
50{
51 class EntityStorage;
52}
53
54namespace agx
55{
63
64
69 {
70 public:
71
74
82 void setDensity(Real density);
83
88 Real getDensity() const;
89
94
98 Real getYoungsModulus() const;
99
104 Real getDamping() const;
105
111 void setDamping( Real damping );
112
126 bool setMinMaxElasticRestLength(Real minElasticRestLength, Real maxElasticRestLength);
127
135
143
145 void copy( const BulkMaterial* source );
146
151 void setViscosity( Real viscosity );
152
156 Real getViscosity() const;
157
161 bool isDirty() const;
162
164
165
167
169 Physics::BulkMaterialPtr& getEntity();
170
172 const Physics::BulkMaterialPtr& getEntity() const;
173
174 protected:
175
176 friend class Material;
177
178 AGX_FORCE_INLINE void setDirty( bool flag ) const;
180
182 virtual ~BulkMaterial();
183
184
185
186 private:
187 mutable Physics::BulkMaterialRef m_entity;
188 };
189
190
194 class AGXPHYSICS_EXPORT SurfaceMaterial : public Referenced, public virtual agxStream::Serializable
195 {
196 public:
197
200
205 void setRoughness( Real roughness );
206
211 Real getRoughness() const;
212
222 void setAdhesion( Real adhesion, Real adhesiveOverlap );
223
227 Real getAdhesion() const;
228
232 Real getAdhesiveOverlap() const;
233
239 void setViscosity( Real viscosity );
240
244 Real getViscosity() const;
245
250 bool getFrictionEnabled() const;
251
257 void setFrictionEnabled( bool flag );
258
260 bool isDirty() const;
261
263
265
266
270 void copy( const SurfaceMaterial* source );
271
272 Physics::SurfaceMaterialPtr& getEntity();
273
274 const Physics::SurfaceMaterialPtr& getEntity() const;
275
276 protected:
277
278 friend class Material;
279 void setDirty( bool flag ) const;
280
282
284 virtual ~SurfaceMaterial();
285
286 private:
287 mutable Physics::SurfaceMaterialRef m_entity;
288 };
289
290
294 class AGXPHYSICS_EXPORT WireMaterial : public Referenced, public virtual agxStream::Serializable
295 {
296 public:
297
300
304 Real getYoungsModulusStretch() const;
305
309 Real getDampingStretch() const;
310
314 Real getYoungsModulusBend() const;
315
319 Real getDampingBend() const;
320
325 void setYoungsModulusStretch( Real youngsStretch );
326
331 void setDampingStretch( Real dampingStretch );
332
337 void setYoungsModulusBend( Real youngsBend );
338
343 void setDampingBend( Real dampingBend );
344
346
347
349
350 bool isDirty() const;
351 void setDirty(bool flag) const;
352
354 void copy( const WireMaterial* source );
355
356 Physics::WireMaterialPtr& getEntity();
357
358 const Physics::WireMaterialPtr& getEntity() const;
359
360 protected:
361
362 friend class Material;
364
366 virtual ~WireMaterial();
367
368 private:
369 mutable Physics::WireMaterialRef m_entity;
370 };
371
372
373
375 class AGXPHYSICS_EXPORT Material : public Referenced, public virtual agxStream::Serializable
376 {
377 public:
378
384 Material( const agx::Name& name, const Material* parent = nullptr );
385
393 Material( const agx::Name& name, Real restitution, Real friction );
394
398 Material( const Material& material );
399
403 SurfaceMaterial* getSurfaceMaterial();
404
408 const SurfaceMaterial* getSurfaceMaterial() const;
409
413 BulkMaterial* getBulkMaterial();
414
418 const BulkMaterial* getBulkMaterial() const;
419
423 WireMaterial* getWireMaterial();
424
428 const WireMaterial* getWireMaterial() const;
429
433 const agx::Name& getName() const;
434
438 void setName( const agx::Name& name ) {
439 m_entity.name() = name;
440 }
441
444
446
447
450 bool isDirty() const;
451
452
458 bool loadLibraryMaterial( agx::String name );
459
460
464 static agx::StringVector getAvailableLibraryMaterials();
465
466
471 bool isLibraryMaterial() const;
472
474
475
476 Physics::MaterialPtr& getEntity();
477
478 const Physics::MaterialPtr& getEntity() const;
479
481 void copy(const Material* other);
482
484
485
486 protected:
487
490
492 virtual ~Material();
493
494 private:
495 friend class agxSDK::MaterialManager;
496 void setDirty( bool flag ) const;
497
499 void init(const Name& name);
500
501 private:
502 BulkMaterialRef m_bulkMaterial;
503 SurfaceMaterialRef m_surfaceMaterial;
504 WireMaterialRef m_wireMaterial;
505
506 mutable Physics::MaterialRef m_entity;
507 };
508
509
515 class AGXPHYSICS_EXPORT ContactMaterial : public Referenced, public virtual agxStream::Serializable
516 {
517 public:
522 BOTH_PRIMARY_AND_SECONDARY
523 };
524
529 REDUCE_ALL
530 };
531
532 public:
533
540 ContactMaterial( const Material* m1, const Material* m2, bool implicit=false );
541
547 ContactMaterial( const ContactMaterial* other, bool implicit );
548
554 void setRestitution( Real restitution );
555
563 void setTangentialRestitution( Real restitution, FrictionDirection direction = BOTH_PRIMARY_AND_SECONDARY );
564
571 void setTangentialCohesion( Real cohesion, FrictionDirection direction = BOTH_PRIMARY_AND_SECONDARY );
572
579 void setFrictionCoefficient( Real friction, FrictionDirection direction = BOTH_PRIMARY_AND_SECONDARY );
580
587 void setSurfaceViscosity( Real viscosity, FrictionDirection direction = BOTH_PRIMARY_AND_SECONDARY );
588
598 void setAdhesion( Real adhesion, Real adhesiveOverlap );
599
603 Real getAdhesion() const;
604
608 Real getAdhesiveOverlap() const;
609
613 Real getRestitution() const;
614
618 Real getTangentialRestitution( FrictionDirection direction = PRIMARY_DIRECTION ) const;
619
623 Real getFrictionCoefficient( FrictionDirection direction = PRIMARY_DIRECTION ) const;
624
628 Real getTangentialCohesion( FrictionDirection direction = PRIMARY_DIRECTION ) const;
629
633 Real getSurfaceViscosity( FrictionDirection direction = PRIMARY_DIRECTION ) const;
634
638 bool getSurfaceFrictionEnabled() const;
639
643 void setEnableSurfaceFriction( bool flag );
644
646 void setYoungsModulus( Real youngsModulus );
647
649 Real getYoungsModulus() const ;
650
656 void setDamping( Real damping );
657
671 bool setMinMaxElasticRestLength(Real minElasticRestLength, Real maxElasticRestLength);
672
680
688
693 Real getDamping() const ;
694
698 FrictionModel* getFrictionModel() const;
699
703 void setFrictionModel( FrictionModel* frictionModel );
704
708 const Material* getMaterial1() const;
709
713 const Material* getMaterial2() const;
714
718 bool isExplicit() const;
719
725
730 ContactReductionMode getContactReductionMode( ) const;
731
740
744 agx::UInt8 getContactReductionBinResolution() const;
745
751 void setUseContactAreaApproach( bool useContactAreaApproach );
752
758 bool getUseContactAreaApproach() const;
759
767
775
779 agx::Real getRollingResistanceCoefficient() const;
780
785
793
801
805 agx::Real getRollingResistanceCompliance() const;
806
810 agx::Real getTwistingResistanceCompliance() const;
811
817 void setImpactCompliance(agx::Real impactCompliance);
818
822 agx::Real getImpactCompliance() const;
823
832 void setWireFrictionCoefficient( Real friction, FrictionDirection direction = BOTH_PRIMARY_AND_SECONDARY );
833
837 Real getWireFrictionCoefficient( FrictionDirection direction = PRIMARY_DIRECTION ) const;
838
840
841
850 agx::ContactMaterial* clone( const agx::Material* material1, const agx::Material* material2 ) const;
851
852
856 void copyInto( ContactMaterial& target ) const;
857
858 void transfer( agxData::EntityStorage* storage );
859
860
862
863 Physics::ContactMaterialPtr& getEntity();
864
865 const Physics::ContactMaterialPtr& getEntity() const;
866
872 enum class RestitutionCoefficient
873 {
874 NORMAL,
875 TANGENTIAL_PRIMARY,
876 TANGENTIAL_SECONDARY
877 };
878
880
881 protected:
883 virtual ~ContactMaterial();
884
885 private:
886
888
889 ContactMaterial& operator = ( const ContactMaterial& );
890
891 void setDefaultParameters();
892
893 friend class agxSDK::MaterialManager;
894 friend class agxCollide::GeometryContact;
895 friend class agxIO::SceneExporter;
896 void setIsExplicit( bool is_explicit );
897
898
899 private:
900 ref_ptr<const Material> m_material1;
901 ref_ptr<const Material> m_material2;
902 FrictionModelRef m_frictionModel;
903
904 mutable Physics::ContactMaterialRef m_entity;
905 };
906
907
908 /* Implementation */
909
910
911 // SurfaceMaterial AGX_FORCE_INLINE implementation
912 AGX_FORCE_INLINE bool SurfaceMaterial::getFrictionEnabled() const
913 {
914 return m_entity.frictionEnabled();
915 }
916
917 AGX_FORCE_INLINE Real SurfaceMaterial::getRoughness() const
918 {
919 return m_entity.roughness();
920 }
921
922 AGX_FORCE_INLINE Real SurfaceMaterial::getAdhesion() const
923 {
924 return m_entity.adhesion();
925 }
926
927 AGX_FORCE_INLINE Real SurfaceMaterial::getAdhesiveOverlap() const
928 {
929 return m_entity.adhesiveOverlap();
930 }
931
932 AGX_FORCE_INLINE Real SurfaceMaterial::getViscosity() const
933 {
934 return m_entity.viscosity();
935 }
936
938 AGX_FORCE_INLINE bool SurfaceMaterial::isDirty() const
939 {
940 return m_entity.dirty();
941 }
942
943 AGX_FORCE_INLINE void SurfaceMaterial::setDirty( bool flag ) const
944 {
945 m_entity.dirty() = flag;
946 }
948
950 AGX_FORCE_INLINE bool WireMaterial::isDirty() const
951 {
952 return m_entity.dirty();
953 }
954
955 AGX_FORCE_INLINE void WireMaterial::setDirty( bool flag ) const
956 {
957 m_entity.dirty() = flag;
958 }
960
961 AGX_FORCE_INLINE Real WireMaterial::getYoungsModulusStretch() const
962 {
963 return m_entity.youngsModulusStretch();
964 }
965
966 AGX_FORCE_INLINE Real WireMaterial::getDampingStretch() const
967 {
968 return m_entity.dampingStretch();
969 }
970
971 AGX_FORCE_INLINE Real WireMaterial::getYoungsModulusBend() const
972 {
973 return m_entity.youngsModulusBend();
974 }
975
976 AGX_FORCE_INLINE Real WireMaterial::getDampingBend() const
977 {
978 return m_entity.dampingBend();
979 }
980
981 AGX_FORCE_INLINE void WireMaterial::setYoungsModulusStretch( Real youngsStretch )
982 {
983 setDirty( true );
984 m_entity.youngsModulusStretch() = youngsStretch;
985 }
986
987 AGX_FORCE_INLINE void WireMaterial::setDampingStretch( Real dampingStretch )
988 {
989 setDirty( true );
990 m_entity.dampingStretch() = dampingStretch;
991 }
992
993 AGX_FORCE_INLINE void WireMaterial::setYoungsModulusBend( Real youngsBend )
994 {
995 setDirty( true );
996 m_entity.youngsModulusBend() = youngsBend;
997 }
998
999 AGX_FORCE_INLINE void WireMaterial::setDampingBend( Real dampingBend )
1000 {
1001 setDirty( true );
1002 m_entity.dampingBend() = dampingBend;
1003 }
1004
1005 // BulkMaterial AGX_FORCE_INLINE implementation
1006 AGX_FORCE_INLINE Real BulkMaterial::getViscosity() const
1007 {
1008 return m_entity.viscosity();
1009 }
1010
1011 AGX_FORCE_INLINE Real BulkMaterial::getDamping() const
1012 {
1013 return m_entity.damping();
1014 }
1015
1016 AGX_FORCE_INLINE Real BulkMaterial::getYoungsModulus() const
1017 {
1018 return m_entity.youngsModulus();
1019 }
1020
1021 AGX_FORCE_INLINE Real BulkMaterial::getDensity() const
1022 {
1023 return m_entity.density();
1024 }
1025
1026 AGX_FORCE_INLINE bool BulkMaterial::isDirty() const
1027 {
1028 return m_entity.dirty();
1029 }
1030
1032 AGX_FORCE_INLINE void BulkMaterial::setDirty( bool flag ) const
1033 {
1034 m_entity.dirty() = flag;
1035 }
1037
1038 // Material AGX_FORCE_INLINE implementation
1040 {
1041 return m_surfaceMaterial;
1042 }
1043
1044 AGX_FORCE_INLINE const SurfaceMaterial* Material::getSurfaceMaterial() const
1045 {
1046 return m_surfaceMaterial;
1047 }
1048
1049 AGX_FORCE_INLINE BulkMaterial* Material::getBulkMaterial()
1050 {
1051 return m_bulkMaterial;
1052 }
1053
1054 AGX_FORCE_INLINE const BulkMaterial* Material::getBulkMaterial() const
1055 {
1056 return m_bulkMaterial;
1057 }
1058
1059 AGX_FORCE_INLINE WireMaterial* Material::getWireMaterial()
1060 {
1061 return m_wireMaterial;
1062 }
1063
1064 AGX_FORCE_INLINE const WireMaterial* Material::getWireMaterial() const
1065 {
1066 return m_wireMaterial;
1067 }
1068
1070 AGX_FORCE_INLINE bool Material::isDirty() const
1071 {
1072 return m_surfaceMaterial->isDirty() || m_bulkMaterial->isDirty() || m_wireMaterial->isDirty();
1073 }
1074
1075 AGX_FORCE_INLINE void Material::setDirty( bool flag ) const
1076 {
1077 m_surfaceMaterial->setDirty(flag);
1078 m_bulkMaterial->setDirty(flag);
1079 m_wireMaterial->setDirty(flag);
1080 }
1082
1083
1084 AGX_FORCE_INLINE const agx::Name& Material::getName() const
1085 {
1086 return m_entity.name();
1087 }
1088
1089 // ContactMaterial AGX_FORCE_INLINE implementation
1090 AGX_FORCE_INLINE Real ContactMaterial::getRestitution() const
1091 {
1092 return m_entity.restitution()[ (int)RestitutionCoefficient::NORMAL ];
1093 }
1094
1095 AGX_FORCE_INLINE Real ContactMaterial::getFrictionCoefficient(FrictionDirection direction) const
1096 {
1097 return m_entity.friction()[ agx::clamp< int >( direction, 0, 1 ) ];
1098 }
1099
1100 AGX_FORCE_INLINE Real ContactMaterial::getSurfaceViscosity( FrictionDirection direction /* = PRIMARY_DIRECTION */ ) const
1101 {
1102 return m_entity.viscosity()[ agx::clamp< int >( direction, 0, 1 ) ];
1103 }
1104
1105 AGX_FORCE_INLINE Real ContactMaterial::getAdhesion() const
1106 {
1107 return m_entity.adhesion();
1108 }
1109
1110 AGX_FORCE_INLINE Real ContactMaterial::getAdhesiveOverlap() const
1111 {
1112 return m_entity.adhesiveOverlap();
1113 }
1114
1115 AGX_FORCE_INLINE bool ContactMaterial::getSurfaceFrictionEnabled() const
1116 {
1117 return m_entity.surfaceFrictionEnabled();
1118 }
1119
1120 AGX_FORCE_INLINE Real ContactMaterial::getYoungsModulus() const
1121 {
1122 return m_entity.youngsModulus();
1123 }
1124
1125 AGX_FORCE_INLINE Real ContactMaterial::getDamping() const
1126 {
1127 return m_entity.damping();
1128 }
1129
1130 AGX_FORCE_INLINE FrictionModel* ContactMaterial::getFrictionModel() const
1131 {
1132 return m_frictionModel;
1133 }
1134
1135 AGX_FORCE_INLINE bool ContactMaterial::isExplicit() const
1136 {
1137 return m_entity.isExplicit();
1138 }
1139
1140 AGX_FORCE_INLINE const Material* ContactMaterial::getMaterial1() const
1141 {
1142 return m_material1;
1143 }
1144
1145 AGX_FORCE_INLINE const Material* ContactMaterial::getMaterial2() const
1146 {
1147 return m_material2;
1148 }
1149
1150 AGX_FORCE_INLINE ContactMaterial::ContactReductionMode ContactMaterial::getContactReductionMode( ) const
1151 {
1152 return (ContactReductionMode)m_entity.contactReductionMode();
1153 }
1154
1155 AGX_FORCE_INLINE agx::UInt8 ContactMaterial::getContactReductionBinResolution() const
1156 {
1157 return m_entity.contactReductionBinResolution();
1158 }
1159
1161
1162 AGX_FORCE_INLINE Physics::BulkMaterialPtr& BulkMaterial::getEntity()
1163 {
1164 return m_entity;
1165 }
1166 AGX_FORCE_INLINE const Physics::BulkMaterialPtr& BulkMaterial::getEntity() const
1167 {
1168 return m_entity;
1169 }
1170
1171 AGX_FORCE_INLINE Physics::SurfaceMaterialPtr& SurfaceMaterial::getEntity()
1172 {
1173 return m_entity;
1174 }
1175
1176 AGX_FORCE_INLINE const Physics::SurfaceMaterialPtr& SurfaceMaterial::getEntity() const
1177 {
1178 return m_entity;
1179 }
1180
1181
1182 AGX_FORCE_INLINE Physics::WireMaterialPtr& WireMaterial::getEntity()
1183 {
1184 return m_entity;
1185 }
1186
1187 AGX_FORCE_INLINE const Physics::WireMaterialPtr& WireMaterial::getEntity() const
1188 {
1189 return m_entity;
1190 }
1191
1192
1193 AGX_FORCE_INLINE Physics::MaterialPtr& Material::getEntity()
1194 {
1195 return m_entity;
1196 }
1197
1198 AGX_FORCE_INLINE const Physics::MaterialPtr& Material::getEntity() const
1199 {
1200 return m_entity;
1201 }
1202
1203
1204 AGX_FORCE_INLINE Physics::ContactMaterialPtr& ContactMaterial::getEntity()
1205 {
1206 return m_entity;
1207 }
1208
1209 AGX_FORCE_INLINE const Physics::ContactMaterialPtr& ContactMaterial::getEntity() const
1210 {
1211 return m_entity;
1212 }
1214
1215 AGX_FORCE_INLINE agx::Real ContactMaterial::getRollingResistanceCoefficient() const
1216 {
1217 return m_entity.rollingResistanceCoefficient();
1218 }
1219
1220 AGX_FORCE_INLINE agx::Real ContactMaterial::getRollingResistanceCompliance() const
1221 {
1222 return m_entity.rollingResistanceCompliance();
1223 }
1224
1225 AGX_FORCE_INLINE agx::Real ContactMaterial::getTwistingResistanceCompliance() const
1226 {
1227 return m_entity.twistingResistanceCompliance();
1228 }
1229
1231 {
1232 return m_entity.impactCompliance();
1233 }
1234
1236 {
1237 return m_entity.useContactAreaApproach();
1238 }
1239
1240 AGX_FORCE_INLINE Real ContactMaterial::getWireFrictionCoefficient(FrictionDirection direction) const
1241 {
1242 return m_entity.wireFriction()[ agx::clamp< int >( direction, 0, 1 ) ];
1243 }
1244} // namespace agx
1245
1246#ifdef _MSC_VER
1247# pragma warning(pop)
1248#endif
1249
1250
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:208
#define AGXPHYSICS_EXPORT
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:45
Physical properties for the bulk of geometries made up by a Material.
Definition: Material.h:69
void setYoungsModulus(Real value)
Set the Young's modulus of the material, same as spring coefficient k.
BulkMaterial()
Default constructor.
void setDamping(Real damping)
Set the damping factor used by the contact constraint.
Real getMinElasticRestLength() const
Get the minimum elastic rest length of the bulk material.
void setDensity(Real density)
Set the density of a material.
Real getMaxElasticRestLength() const
Get the maximum elastic rest length of the bulk material.
void setViscosity(Real viscosity)
Set the bulk viscosity coefficient of the material (1 - restitution coefficient).
void copy(const BulkMaterial *source)
Copy all the attributes of copy_material to this.
bool setMinMaxElasticRestLength(Real minElasticRestLength, Real maxElasticRestLength)
Set the minimum and maximum elastic rest length of the bulk material.
This class store the combine material properties between two agx::Material's.
Definition: Material.h:516
Real getTangentialRestitution(FrictionDirection direction=PRIMARY_DIRECTION) const
void setYoungsModulus(Real youngsModulus)
Set the YoungsModulus of the material, same as spring coefficient k.
FrictionDirection
Specifies the direction of friction.
Definition: Material.h:519
void setTwistingResistanceCoefficient(agx::Real twistingCoefficient)
Sets the twisting resistance coefficient of the contact material.
void setAdhesion(Real adhesion, Real adhesiveOverlap)
Set the adhesive force and allowed overlap between two colliding objects.
bool setMinMaxElasticRestLength(Real minElasticRestLength, Real maxElasticRestLength)
Set the minimum and maximum elastic rest length of the contact material.
void setTwistingResistanceCompliance(agx::Real compliance)
Sets the twisting resistance compliance in the contact material.
bool getUseContactAreaApproach() const
Should contacts using this contact material use the new approach for computing contact area?...
Definition: Material.h:1235
agx::Real getTwistingResistanceCoefficient() const
void setContactReductionBinResolution(agx::UInt8 binResolution)
Specify the resolution used when evaluating contacts for reduction between geometry contacts.
void setEnableSurfaceFriction(bool flag)
Specify if surface friction should be calculated in the solver for this contact material.
void setTangentialRestitution(Real restitution, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
Set the tangential restitution coefficient for a given tangential direction, or both.
void setRollingResistanceCompliance(agx::Real compliance)
Sets the rolling resistance compliance in the contact material.
void setContactReductionMode(ContactReductionMode mode)
Specify if contact reduction should be enabled.
ContactMaterial(const Material *m1, const Material *m2, bool implicit=false)
Constructor which associates this ContactMaterial to the two given materials m1 and m2.
ContactReductionMode
Specifies the mode for contact reduction.
Definition: Material.h:526
@ REDUCE_GEOMETRY
Default: Reduce contacts between geometries.
Definition: Material.h:528
@ REDUCE_NONE
No contact reduction enabled.
Definition: Material.h:527
void setSurfaceViscosity(Real viscosity, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
Assign the surface viscosity, i.e., how wet the friction is between the colliding materials.
void setDamping(Real damping)
Set the damping of the material.
void setImpactCompliance(agx::Real impactCompliance)
Sets the compliance used for calculating impact forces.
void setFrictionCoefficient(Real friction, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
Set the friction coefficient.
ContactMaterial(const ContactMaterial *other, bool implicit)
Create a ContactMaterial copying attributes from other.
Real getMinElasticRestLength() const
Get the minimum elastic rest length of the contact material.
void setTangentialCohesion(Real cohesion, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
Set the tangential cohesion (Pa) of the contact material.
Real getMaxElasticRestLength() const
Get the maximum elastic rest length of the contact material.
Real getTangentialCohesion(FrictionDirection direction=PRIMARY_DIRECTION) const
void setFrictionModel(FrictionModel *frictionModel)
Set friction model for this contact material.
void setRestitution(Real restitution)
Set the restitution parameter.
void setUseContactAreaApproach(bool useContactAreaApproach)
Should contacts using this contact material use the new approach for computing contact area?...
void setRollingResistanceCoefficient(agx::Real rollingCoefficient)
Sets the rolling resistance coefficient of the contact material.
agx::Real getImpactCompliance() const
Definition: Material.h:1230
void setWireFrictionCoefficient(Real friction, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
Set the friction coefficient used by the contact nodes in the wires.
Base class for all friction models with interface and some utility/necessary methods implemented.
Definition: FrictionModel.h:51
Main material class which acts as a holder of a Surface Material and a Bulk material.
Definition: Material.h:376
Material(const agx::Name &name, Real restitution, Real friction)
Construct a material from friction and restitution values.
Material(const agx::Name &name, const Material *parent=nullptr)
Constructor.
void setName(const agx::Name &name)
Set the name of the material.
Definition: Material.h:438
static Material * getDefaultMaterial()
Material(const Material &material)
Copy constructor.
Representation of a name string.
Definition: Name.h:33
Base class providing referencing counted objects.
Definition: Referenced.h:120
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: SetVector.h:38
Physical properties for the surface of a Material.
Definition: Material.h:195
void setViscosity(Real viscosity)
Set the viscosity parameter of this surface.
void setAdhesion(Real adhesion, Real adhesiveOverlap)
Set the adhesive force and allowed overlap between two colliding objects.
SurfaceMaterial()
Default constructor.
bool isDirty() const
void setRoughness(Real roughness)
Set the roughness parameter.
void setFrictionEnabled(bool flag)
Specify if the friction should be used when solving contacts for this Material.
Templated vector class.
Definition: agx/Vector.h:53
Physical properties for the contact between a Geometry and an agx::Wire.
Definition: Material.h:295
WireMaterial()
Default constructor.
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
#define AGX_FORCE_INLINE
Definition: macros.h:58
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Contains classes for low level data storage for AGX.
Definition: Container.h:23
The agxIO namespace contains classes for reading, writing and finding files.
Definition: Material.h:42
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::Vector< agx::ref_ptr< agx::ContactMaterial > > ContactMaterialRefVector
Definition: Material.h:62
double Real
Definition: Real.h:42
uint8_t UInt8
Definition: Integer.h:30
agx::SetVector< agx::ref_ptr< agx::ContactMaterial > > ContactMaterialRefSetVector
Definition: Material.h:61