AGX Dynamics 2.42.2.1
Loading...
Searching...
No Matches
ContactMaterialEntity.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
9having been advised so by Algoryx Simulation AB for a time limited evaluation,
10or having purchased a valid 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
18// AUTOMATICALLY GENERATED ENTITY, DO NOT EDIT! //
20
21#ifndef GENERATED_AGX_PHYSICS_CONTACTMATERIAL_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_CONTACTMATERIAL_H_PLUGIN
23
24#define AGX_ENTITY_WRAPPER 1
25
26
27#ifdef _MSC_VER
28# pragma warning(push)
29// warning C4505: 'agxData::VectorAttributeT<T>::print' : unreferenced local function has been removed
30# pragma warning( disable : 4505 )
31// warning C4251: 'X' : class 'Y' needs to have dll-interface to be used by clients of class 'Z'
32# pragma warning( disable : 4251 )
33// warning C4355: 'this' : used in base member initializer list
34# pragma warning( disable : 4355 )
35// marked as __forceinline not inlined
36# pragma warning( disable: 4714 )
37#endif
38
39#include <agxData/EntityModel.h>
41#include <agxData/EntityRef.h>
42#include <agxData/EntityPtr.h>
44#include <agx/Integer.h>
45#include <agx/Real.h>
46#include <agx/macros.h>
48#include <agx/Integer.h>
50#include <agx/Vec2.h>
51#include <agx/Vec3.h>
52#include <agx/Real.h>
53namespace agx { class ContactMaterial; }
54
55namespace agx { namespace Physics { class MaterialPtr; }}
56namespace agx { namespace Physics { class MaterialPtr; }}
57
58namespace agx
59{
60 namespace Physics
61 {
62
63 class ContactMaterialModel;
64 class ContactMaterialData;
65 class ContactMaterialPtr;
66 class ContactMaterialInstance;
67 class ContactMaterialSemantics;
68
69
71
76 {
77 public:
79
80 ContactMaterialModel(const agx::String& name = "ContactMaterial");
81
84
87
90
92 virtual void shutdownCleanup() override;
93
94
95
96 /* Attributes */
121
122 protected:
124 virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
125 virtual void configure(agx::TiXmlElement* eEntity) override;
126 virtual void initAttributeAccessors() override;
127 virtual void construct(agxData::EntityPtr instance) override;
129 };
130
131
133 #ifndef AGX_PHYSICS_CONTACTMATERIAL_DATA_SET_OVERRIDE
134 #define AGX_PHYSICS_CONTACTMATERIAL_DATA_SET
135 class AGXPHYSICS_EXPORT ContactMaterialData : public agx::ReferencedData
136 {
137 public:
138 ContactMaterialInstance operator[] (size_t index);
139
140 public:
145 agxData::Array< agx::Vec2 > tangentialCohesion;
146 agxData::Array< agx::Vec3 > restitution;
149 agxData::Array< agx::Real > adhesiveOverlap;
151 agxData::Array< agx::Bool > surfaceFrictionEnabled;
152 agxData::Array< agx::UInt8 > contactReductionMode;
153 agxData::Array< agx::UInt8 > contactReductionBinResolution;
154 agxData::Array< agx::Bool > useContactAreaApproach;
155 agxData::Array< agx::Vec2 > wireFriction;
156 agxData::Array< agx::Real > youngsModulus;
158 agxData::Array< agx::Real > minElasticRestLength;
159 agxData::Array< agx::Real > maxElasticRestLength;
160 agxData::Array< agx::Real > impactCompliance;
161 agxData::Array< agx::Real > rollingResistanceCoefficient;
162 agxData::Array< agx::Real > twistingResistanceCoefficient;
163 agxData::Array< agx::Real > rollingResistanceCompliance;
164 agxData::Array< agx::Real > twistingResistanceCompliance;
166
167 public:
168 typedef agx::Bool isExplicitType;
169 typedef agx::Physics::MaterialPtr material1Type;
170 typedef agx::Physics::MaterialPtr material2Type;
171 typedef agx::Vec2 tangentialCohesionType;
172 typedef agx::Vec3 restitutionType;
173 typedef agx::Vec2 frictionType;
174 typedef agx::Real adhesionType;
175 typedef agx::Real adhesiveOverlapType;
176 typedef agx::Vec3 viscosityType;
177 typedef agx::Bool surfaceFrictionEnabledType;
178 typedef agx::UInt8 contactReductionModeType;
179 typedef agx::UInt8 contactReductionBinResolutionType;
180 typedef agx::Bool useContactAreaApproachType;
181 typedef agx::Vec2 wireFrictionType;
182 typedef agx::Real youngsModulusType;
183 typedef agx::Real dampingType;
184 typedef agx::Real minElasticRestLengthType;
185 typedef agx::Real maxElasticRestLengthType;
186 typedef agx::Real impactComplianceType;
187 typedef agx::Real rollingResistanceCoefficientType;
188 typedef agx::Real twistingResistanceCoefficientType;
189 typedef agx::Real rollingResistanceComplianceType;
190 typedef agx::Real twistingResistanceComplianceType;
191 typedef agx::ContactMaterial* modelType;
192
193 public:
194 ContactMaterialData(agxData::EntityStorage* storage);
195 ContactMaterialData();
196
197 protected:
198 virtual ~ContactMaterialData() {}
199 virtual void setNumElements(agx::Index numElements) override;
200
201 private:
202 ContactMaterialData& operator= (const ContactMaterialData&) { return *this; }
203
204 };
205 #endif
207
208
210 class AGXPHYSICS_EXPORT ContactMaterialSemantics : public agx::ReferencedSemantics
211 {
212 public:
213
214 // Automatic getters
215 agx::Bool const& getIsExplicit() const;
216 agx::Physics::MaterialPtr const& getMaterial1() const;
217 agx::Physics::MaterialPtr const& getMaterial2() const;
218 agx::Vec2 const& getTangentialCohesion() const;
219 agx::Vec3 const& getRestitution() const;
220 agx::Vec2 const& getFriction() const;
221 agx::Real const& getAdhesion() const;
222 agx::Real const& getAdhesiveOverlap() const;
223 agx::Vec3 const& getViscosity() const;
224 agx::Bool const& getSurfaceFrictionEnabled() const;
225 agx::UInt8 const& getContactReductionMode() const;
226 agx::UInt8 const& getContactReductionBinResolution() const;
227 agx::Bool const& getUseContactAreaApproach() const;
228 agx::Vec2 const& getWireFriction() const;
229 agx::Real const& getYoungsModulus() const;
230 agx::Real const& getDamping() const;
231 agx::Real const& getMinElasticRestLength() const;
232 agx::Real const& getMaxElasticRestLength() const;
233 agx::Real const& getImpactCompliance() const;
234 agx::Real const& getRollingResistanceCoefficient() const;
235 agx::Real const& getTwistingResistanceCoefficient() const;
236 agx::Real const& getRollingResistanceCompliance() const;
237 agx::Real const& getTwistingResistanceCompliance() const;
238 agx::ContactMaterial* const& getModel() const;
239
240 // Semantics defined by explicit kernels
241
242 // Automatic setters
243 void setIsExplicit(agx::Bool const& value);
244 void setMaterial1(agx::Physics::MaterialPtr const& value);
245 void setMaterial2(agx::Physics::MaterialPtr const& value);
246 void setTangentialCohesion(agx::Vec2 const& value);
247 void setRestitution(agx::Vec3 const& value);
248 void setFriction(agx::Vec2 const& value);
249 void setAdhesion(agx::Real const& value);
250 void setAdhesiveOverlap(agx::Real const& value);
251 void setViscosity(agx::Vec3 const& value);
252 void setSurfaceFrictionEnabled(agx::Bool const& value);
253 void setContactReductionMode(agx::UInt8 const& value);
254 void setContactReductionBinResolution(agx::UInt8 const& value);
255 void setUseContactAreaApproach(agx::Bool const& value);
256 void setWireFriction(agx::Vec2 const& value);
257 void setYoungsModulus(agx::Real const& value);
258 void setDamping(agx::Real const& value);
259 void setMinElasticRestLength(agx::Real const& value);
260 void setMaxElasticRestLength(agx::Real const& value);
261 void setImpactCompliance(agx::Real const& value);
262 void setRollingResistanceCoefficient(agx::Real const& value);
263 void setTwistingResistanceCoefficient(agx::Real const& value);
264 void setRollingResistanceCompliance(agx::Real const& value);
265 void setTwistingResistanceCompliance(agx::Real const& value);
266 void setModel(agx::ContactMaterial* const& value);
267
268
269 protected:
270 friend class ContactMaterialPtr;
271 friend class ContactMaterialInstance;
272 ContactMaterialSemantics();
273 };
275
276
277
281 {
282 public:
284 typedef ContactMaterialData DataType;
285 typedef ContactMaterialInstance InstanceType;
286
287 public:
294 AGXPHYSICS_EXPORT ContactMaterialInstance instance();
295 AGXPHYSICS_EXPORT const ContactMaterialInstance instance() const;
296
297 AGXPHYSICS_EXPORT ContactMaterialSemantics* operator->();
298 AGXPHYSICS_EXPORT const ContactMaterialSemantics* operator->() const;
299
300 ContactMaterialData* getData();
301 const ContactMaterialData* getData() const;
302
303
308
313
318
323
328
333
338
343
348
353
358
363
368
373
378
383
388
393
398
403
408
413
418
423
424 };
425
426 // Entity is Referenced
428
429
431 class AGXPHYSICS_EXPORT ContactMaterialInstance : public agx::ReferencedInstance
432 {
433 public:
434 ContactMaterialInstance();
435 ContactMaterialInstance(ContactMaterialData* data, agx::Index index);
436 ContactMaterialInstance(agxData::EntityStorage *storage, agx::Index index);
437 ContactMaterialInstance(const agxData::EntityInstance& other);
438 ContactMaterialInstance(const agxData::EntityPtr& ptr);
439
440 ContactMaterialData* getData();
441 const ContactMaterialData* getData() const;
442
443 public:
445 agx::Bool& isExplicit();
447 agx::Bool const& isExplicit() const;
448
450 agx::Physics::MaterialPtr& material1();
452 agx::Physics::MaterialPtr const& material1() const;
453
455 agx::Physics::MaterialPtr& material2();
457 agx::Physics::MaterialPtr const& material2() const;
458
460 agx::Vec2& tangentialCohesion();
462 agx::Vec2 const& tangentialCohesion() const;
463
465 agx::Vec3& restitution();
467 agx::Vec3 const& restitution() const;
468
470 agx::Vec2& friction();
472 agx::Vec2 const& friction() const;
473
475 agx::Real& adhesion();
477 agx::Real const& adhesion() const;
478
480 agx::Real& adhesiveOverlap();
482 agx::Real const& adhesiveOverlap() const;
483
485 agx::Vec3& viscosity();
487 agx::Vec3 const& viscosity() const;
488
490 agx::Bool& surfaceFrictionEnabled();
492 agx::Bool const& surfaceFrictionEnabled() const;
493
495 agx::UInt8& contactReductionMode();
497 agx::UInt8 const& contactReductionMode() const;
498
500 agx::UInt8& contactReductionBinResolution();
502 agx::UInt8 const& contactReductionBinResolution() const;
503
505 agx::Bool& useContactAreaApproach();
507 agx::Bool const& useContactAreaApproach() const;
508
510 agx::Vec2& wireFriction();
512 agx::Vec2 const& wireFriction() const;
513
515 agx::Real& youngsModulus();
517 agx::Real const& youngsModulus() const;
518
520 agx::Real& damping();
522 agx::Real const& damping() const;
523
525 agx::Real& minElasticRestLength();
527 agx::Real const& minElasticRestLength() const;
528
530 agx::Real& maxElasticRestLength();
532 agx::Real const& maxElasticRestLength() const;
533
535 agx::Real& impactCompliance();
537 agx::Real const& impactCompliance() const;
538
540 agx::Real& rollingResistanceCoefficient();
542 agx::Real const& rollingResistanceCoefficient() const;
543
545 agx::Real& twistingResistanceCoefficient();
547 agx::Real const& twistingResistanceCoefficient() const;
548
550 agx::Real& rollingResistanceCompliance();
552 agx::Real const& rollingResistanceCompliance() const;
553
555 agx::Real& twistingResistanceCompliance();
557 agx::Real const& twistingResistanceCompliance() const;
558
560 agx::ContactMaterial*& model();
562 agx::ContactMaterial* const& model() const;
563
564 };
566
567
568
571
572
573
575 /* Implementation */
576 //-----------------------------------------------------------------------------------------------------
577 //-----------------------------------------------------------------------------------------------------
578 inline ContactMaterialInstance agx::Physics::ContactMaterialData::operator[] (size_t index) { return ContactMaterialInstance(this, (agx::Index)index); }
579 //-----------------------------------------------------------------------------------------------------
582 AGX_FORCE_INLINE ContactMaterialPtr::ContactMaterialPtr(const agxData::EntityPtr& ptr) : agx::ReferencedPtr(ptr)
583 {
585 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
586 EntityPtr::getModel()->fullPath().c_str(), ContactMaterialModel::instance()->fullPath().c_str());
587 }
588
589 AGX_FORCE_INLINE ContactMaterialPtr::ContactMaterialPtr(const agxData::EntityInstance& instance) : agx::ReferencedPtr(instance)
590 {
592 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
593 EntityPtr::getModel()->fullPath().c_str(), ContactMaterialModel::instance()->fullPath().c_str());
594 }
595
596 AGX_FORCE_INLINE ContactMaterialPtr& ContactMaterialPtr::operator= (const agxData::EntityPtr& ptr)
597 {
599 agxAssertN(!ptr || ptr.isInstanceOf(ContactMaterialModel::instance()),
600 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
601 EntityPtr::getModel()->fullPath().c_str(), ContactMaterialModel::instance()->fullPath().c_str());
602 return *this;
603 }
604
605 AGX_FORCE_INLINE ContactMaterialPtr& ContactMaterialPtr::operator= (const agxData::EntityInstance& instance)
606 {
608 agxAssertN(!instance || instance.isInstanceOf(ContactMaterialModel::instance()),
609 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
610 EntityPtr::getModel()->fullPath().c_str(), ContactMaterialModel::instance()->fullPath().c_str());
611 return *this;
612 }
613
614 inline ContactMaterialInstance ContactMaterialPtr::instance() { return agxData::EntityPtr::instance(); }
615 inline const ContactMaterialInstance ContactMaterialPtr::instance() const { return agxData::EntityPtr::instance(); }
616 AGX_FORCE_INLINE ContactMaterialSemantics* ContactMaterialPtr::operator->() { return (ContactMaterialSemantics* )this; }
617 AGX_FORCE_INLINE const ContactMaterialSemantics* ContactMaterialPtr::operator->() const { return (const ContactMaterialSemantics* )this; }
618 AGX_FORCE_INLINE ContactMaterialData* ContactMaterialPtr::getData() { return static_cast<ContactMaterialData* >(agxData::EntityPtr::getData()); }
619 AGX_FORCE_INLINE const ContactMaterialData* ContactMaterialPtr::getData() const { return static_cast<const ContactMaterialData* >(agxData::EntityPtr::getData()); }
620
621 AGX_FORCE_INLINE agx::Bool& ContactMaterialPtr::isExplicit() { verifyIndex(); return getData()->isExplicit[calculateIndex()]; }
622 AGX_FORCE_INLINE agx::Bool const& ContactMaterialPtr::isExplicit() const { verifyIndex(); return getData()->isExplicit[calculateIndex()]; }
623
624 AGX_FORCE_INLINE agx::Physics::MaterialPtr& ContactMaterialPtr::material1() { verifyIndex(); return getData()->material1[calculateIndex()]; }
625 AGX_FORCE_INLINE agx::Physics::MaterialPtr const& ContactMaterialPtr::material1() const { verifyIndex(); return getData()->material1[calculateIndex()]; }
626
627 AGX_FORCE_INLINE agx::Physics::MaterialPtr& ContactMaterialPtr::material2() { verifyIndex(); return getData()->material2[calculateIndex()]; }
628 AGX_FORCE_INLINE agx::Physics::MaterialPtr const& ContactMaterialPtr::material2() const { verifyIndex(); return getData()->material2[calculateIndex()]; }
629
630 AGX_FORCE_INLINE agx::Vec2& ContactMaterialPtr::tangentialCohesion() { verifyIndex(); return getData()->tangentialCohesion[calculateIndex()]; }
631 AGX_FORCE_INLINE agx::Vec2 const& ContactMaterialPtr::tangentialCohesion() const { verifyIndex(); return getData()->tangentialCohesion[calculateIndex()]; }
632
633 AGX_FORCE_INLINE agx::Vec3& ContactMaterialPtr::restitution() { verifyIndex(); return getData()->restitution[calculateIndex()]; }
634 AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialPtr::restitution() const { verifyIndex(); return getData()->restitution[calculateIndex()]; }
635
636 AGX_FORCE_INLINE agx::Vec2& ContactMaterialPtr::friction() { verifyIndex(); return getData()->friction[calculateIndex()]; }
637 AGX_FORCE_INLINE agx::Vec2 const& ContactMaterialPtr::friction() const { verifyIndex(); return getData()->friction[calculateIndex()]; }
638
639 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::adhesion() { verifyIndex(); return getData()->adhesion[calculateIndex()]; }
640 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::adhesion() const { verifyIndex(); return getData()->adhesion[calculateIndex()]; }
641
642 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::adhesiveOverlap() { verifyIndex(); return getData()->adhesiveOverlap[calculateIndex()]; }
643 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::adhesiveOverlap() const { verifyIndex(); return getData()->adhesiveOverlap[calculateIndex()]; }
644
645 AGX_FORCE_INLINE agx::Vec3& ContactMaterialPtr::viscosity() { verifyIndex(); return getData()->viscosity[calculateIndex()]; }
646 AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialPtr::viscosity() const { verifyIndex(); return getData()->viscosity[calculateIndex()]; }
647
648 AGX_FORCE_INLINE agx::Bool& ContactMaterialPtr::surfaceFrictionEnabled() { verifyIndex(); return getData()->surfaceFrictionEnabled[calculateIndex()]; }
649 AGX_FORCE_INLINE agx::Bool const& ContactMaterialPtr::surfaceFrictionEnabled() const { verifyIndex(); return getData()->surfaceFrictionEnabled[calculateIndex()]; }
650
651 AGX_FORCE_INLINE agx::UInt8& ContactMaterialPtr::contactReductionMode() { verifyIndex(); return getData()->contactReductionMode[calculateIndex()]; }
652 AGX_FORCE_INLINE agx::UInt8 const& ContactMaterialPtr::contactReductionMode() const { verifyIndex(); return getData()->contactReductionMode[calculateIndex()]; }
653
654 AGX_FORCE_INLINE agx::UInt8& ContactMaterialPtr::contactReductionBinResolution() { verifyIndex(); return getData()->contactReductionBinResolution[calculateIndex()]; }
655 AGX_FORCE_INLINE agx::UInt8 const& ContactMaterialPtr::contactReductionBinResolution() const { verifyIndex(); return getData()->contactReductionBinResolution[calculateIndex()]; }
656
657 AGX_FORCE_INLINE agx::Bool& ContactMaterialPtr::useContactAreaApproach() { verifyIndex(); return getData()->useContactAreaApproach[calculateIndex()]; }
658 AGX_FORCE_INLINE agx::Bool const& ContactMaterialPtr::useContactAreaApproach() const { verifyIndex(); return getData()->useContactAreaApproach[calculateIndex()]; }
659
660 AGX_FORCE_INLINE agx::Vec2& ContactMaterialPtr::wireFriction() { verifyIndex(); return getData()->wireFriction[calculateIndex()]; }
661 AGX_FORCE_INLINE agx::Vec2 const& ContactMaterialPtr::wireFriction() const { verifyIndex(); return getData()->wireFriction[calculateIndex()]; }
662
663 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::youngsModulus() { verifyIndex(); return getData()->youngsModulus[calculateIndex()]; }
664 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::youngsModulus() const { verifyIndex(); return getData()->youngsModulus[calculateIndex()]; }
665
666 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::damping() { verifyIndex(); return getData()->damping[calculateIndex()]; }
667 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::damping() const { verifyIndex(); return getData()->damping[calculateIndex()]; }
668
669 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::minElasticRestLength() { verifyIndex(); return getData()->minElasticRestLength[calculateIndex()]; }
670 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::minElasticRestLength() const { verifyIndex(); return getData()->minElasticRestLength[calculateIndex()]; }
671
672 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::maxElasticRestLength() { verifyIndex(); return getData()->maxElasticRestLength[calculateIndex()]; }
673 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::maxElasticRestLength() const { verifyIndex(); return getData()->maxElasticRestLength[calculateIndex()]; }
674
675 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::impactCompliance() { verifyIndex(); return getData()->impactCompliance[calculateIndex()]; }
676 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::impactCompliance() const { verifyIndex(); return getData()->impactCompliance[calculateIndex()]; }
677
678 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::rollingResistanceCoefficient() { verifyIndex(); return getData()->rollingResistanceCoefficient[calculateIndex()]; }
679 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::rollingResistanceCoefficient() const { verifyIndex(); return getData()->rollingResistanceCoefficient[calculateIndex()]; }
680
681 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::twistingResistanceCoefficient() { verifyIndex(); return getData()->twistingResistanceCoefficient[calculateIndex()]; }
682 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::twistingResistanceCoefficient() const { verifyIndex(); return getData()->twistingResistanceCoefficient[calculateIndex()]; }
683
684 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::rollingResistanceCompliance() { verifyIndex(); return getData()->rollingResistanceCompliance[calculateIndex()]; }
685 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::rollingResistanceCompliance() const { verifyIndex(); return getData()->rollingResistanceCompliance[calculateIndex()]; }
686
687 AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::twistingResistanceCompliance() { verifyIndex(); return getData()->twistingResistanceCompliance[calculateIndex()]; }
688 AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::twistingResistanceCompliance() const { verifyIndex(); return getData()->twistingResistanceCompliance[calculateIndex()]; }
689
690 AGX_FORCE_INLINE agx::ContactMaterial*& ContactMaterialPtr::model() { verifyIndex(); return getData()->model[calculateIndex()]; }
691 AGX_FORCE_INLINE agx::ContactMaterial* const& ContactMaterialPtr::model() const { verifyIndex(); return getData()->model[calculateIndex()]; }
692
693 //-----------------------------------------------------------------------------------------------------
694 AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance() {}
695 AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance(ContactMaterialData* data, agx::Index index) : agx::ReferencedInstance(data, index) {}
696 AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance(agxData::EntityStorage* storage, agx::Index index) : agx::ReferencedInstance(storage, index) {}
697 AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance(const agxData::EntityInstance& other) : agx::ReferencedInstance(other)
698 {
700 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
701 EntityInstance::getModel()->fullPath().c_str(), ContactMaterialModel::instance()->fullPath().c_str());
702 }
703
704 AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance(const agxData::EntityPtr& ptr) : agx::ReferencedInstance(ptr)
705 {
707 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
708 EntityInstance::getModel()->fullPath().c_str(), ContactMaterialModel::instance()->fullPath().c_str());
709 }
710
711
712 AGX_FORCE_INLINE ContactMaterialData* ContactMaterialInstance::getData() { return static_cast<ContactMaterialData* >(agxData::EntityInstance::getData()); }
713 AGX_FORCE_INLINE const ContactMaterialData* ContactMaterialInstance::getData() const { return static_cast<const ContactMaterialData* >(agxData::EntityInstance::getData()); }
714
715 AGX_FORCE_INLINE agx::Bool& ContactMaterialInstance::isExplicit() { verifyIndex(); return getData()->isExplicit[getIndex()]; }
716 AGX_FORCE_INLINE agx::Bool const& ContactMaterialInstance::isExplicit() const { verifyIndex(); return getData()->isExplicit[getIndex()]; }
717
718 AGX_FORCE_INLINE agx::Physics::MaterialPtr& ContactMaterialInstance::material1() { verifyIndex(); return getData()->material1[getIndex()]; }
719 AGX_FORCE_INLINE agx::Physics::MaterialPtr const& ContactMaterialInstance::material1() const { verifyIndex(); return getData()->material1[getIndex()]; }
720
721 AGX_FORCE_INLINE agx::Physics::MaterialPtr& ContactMaterialInstance::material2() { verifyIndex(); return getData()->material2[getIndex()]; }
722 AGX_FORCE_INLINE agx::Physics::MaterialPtr const& ContactMaterialInstance::material2() const { verifyIndex(); return getData()->material2[getIndex()]; }
723
724 AGX_FORCE_INLINE agx::Vec2& ContactMaterialInstance::tangentialCohesion() { verifyIndex(); return getData()->tangentialCohesion[getIndex()]; }
725 AGX_FORCE_INLINE agx::Vec2 const& ContactMaterialInstance::tangentialCohesion() const { verifyIndex(); return getData()->tangentialCohesion[getIndex()]; }
726
727 AGX_FORCE_INLINE agx::Vec3& ContactMaterialInstance::restitution() { verifyIndex(); return getData()->restitution[getIndex()]; }
728 AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialInstance::restitution() const { verifyIndex(); return getData()->restitution[getIndex()]; }
729
730 AGX_FORCE_INLINE agx::Vec2& ContactMaterialInstance::friction() { verifyIndex(); return getData()->friction[getIndex()]; }
731 AGX_FORCE_INLINE agx::Vec2 const& ContactMaterialInstance::friction() const { verifyIndex(); return getData()->friction[getIndex()]; }
732
733 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::adhesion() { verifyIndex(); return getData()->adhesion[getIndex()]; }
734 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::adhesion() const { verifyIndex(); return getData()->adhesion[getIndex()]; }
735
736 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::adhesiveOverlap() { verifyIndex(); return getData()->adhesiveOverlap[getIndex()]; }
737 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::adhesiveOverlap() const { verifyIndex(); return getData()->adhesiveOverlap[getIndex()]; }
738
739 AGX_FORCE_INLINE agx::Vec3& ContactMaterialInstance::viscosity() { verifyIndex(); return getData()->viscosity[getIndex()]; }
740 AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialInstance::viscosity() const { verifyIndex(); return getData()->viscosity[getIndex()]; }
741
742 AGX_FORCE_INLINE agx::Bool& ContactMaterialInstance::surfaceFrictionEnabled() { verifyIndex(); return getData()->surfaceFrictionEnabled[getIndex()]; }
743 AGX_FORCE_INLINE agx::Bool const& ContactMaterialInstance::surfaceFrictionEnabled() const { verifyIndex(); return getData()->surfaceFrictionEnabled[getIndex()]; }
744
745 AGX_FORCE_INLINE agx::UInt8& ContactMaterialInstance::contactReductionMode() { verifyIndex(); return getData()->contactReductionMode[getIndex()]; }
746 AGX_FORCE_INLINE agx::UInt8 const& ContactMaterialInstance::contactReductionMode() const { verifyIndex(); return getData()->contactReductionMode[getIndex()]; }
747
748 AGX_FORCE_INLINE agx::UInt8& ContactMaterialInstance::contactReductionBinResolution() { verifyIndex(); return getData()->contactReductionBinResolution[getIndex()]; }
749 AGX_FORCE_INLINE agx::UInt8 const& ContactMaterialInstance::contactReductionBinResolution() const { verifyIndex(); return getData()->contactReductionBinResolution[getIndex()]; }
750
751 AGX_FORCE_INLINE agx::Bool& ContactMaterialInstance::useContactAreaApproach() { verifyIndex(); return getData()->useContactAreaApproach[getIndex()]; }
752 AGX_FORCE_INLINE agx::Bool const& ContactMaterialInstance::useContactAreaApproach() const { verifyIndex(); return getData()->useContactAreaApproach[getIndex()]; }
753
754 AGX_FORCE_INLINE agx::Vec2& ContactMaterialInstance::wireFriction() { verifyIndex(); return getData()->wireFriction[getIndex()]; }
755 AGX_FORCE_INLINE agx::Vec2 const& ContactMaterialInstance::wireFriction() const { verifyIndex(); return getData()->wireFriction[getIndex()]; }
756
757 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::youngsModulus() { verifyIndex(); return getData()->youngsModulus[getIndex()]; }
758 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::youngsModulus() const { verifyIndex(); return getData()->youngsModulus[getIndex()]; }
759
760 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::damping() { verifyIndex(); return getData()->damping[getIndex()]; }
761 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::damping() const { verifyIndex(); return getData()->damping[getIndex()]; }
762
763 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::minElasticRestLength() { verifyIndex(); return getData()->minElasticRestLength[getIndex()]; }
764 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::minElasticRestLength() const { verifyIndex(); return getData()->minElasticRestLength[getIndex()]; }
765
766 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::maxElasticRestLength() { verifyIndex(); return getData()->maxElasticRestLength[getIndex()]; }
767 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::maxElasticRestLength() const { verifyIndex(); return getData()->maxElasticRestLength[getIndex()]; }
768
769 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::impactCompliance() { verifyIndex(); return getData()->impactCompliance[getIndex()]; }
770 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::impactCompliance() const { verifyIndex(); return getData()->impactCompliance[getIndex()]; }
771
772 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::rollingResistanceCoefficient() { verifyIndex(); return getData()->rollingResistanceCoefficient[getIndex()]; }
773 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::rollingResistanceCoefficient() const { verifyIndex(); return getData()->rollingResistanceCoefficient[getIndex()]; }
774
775 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::twistingResistanceCoefficient() { verifyIndex(); return getData()->twistingResistanceCoefficient[getIndex()]; }
776 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::twistingResistanceCoefficient() const { verifyIndex(); return getData()->twistingResistanceCoefficient[getIndex()]; }
777
778 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::rollingResistanceCompliance() { verifyIndex(); return getData()->rollingResistanceCompliance[getIndex()]; }
779 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::rollingResistanceCompliance() const { verifyIndex(); return getData()->rollingResistanceCompliance[getIndex()]; }
780
781 AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::twistingResistanceCompliance() { verifyIndex(); return getData()->twistingResistanceCompliance[getIndex()]; }
782 AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::twistingResistanceCompliance() const { verifyIndex(); return getData()->twistingResistanceCompliance[getIndex()]; }
783
784 AGX_FORCE_INLINE agx::ContactMaterial*& ContactMaterialInstance::model() { verifyIndex(); return getData()->model[getIndex()]; }
785 AGX_FORCE_INLINE agx::ContactMaterial* const& ContactMaterialInstance::model() const { verifyIndex(); return getData()->model[getIndex()]; }
786
787 //-----------------------------------------------------------------------------------------------------
788 AGX_FORCE_INLINE ContactMaterialSemantics::ContactMaterialSemantics() {}
789 //-----------------------------------------------------------------------------------------------------
791 }
792}
793
794AGX_TYPE_BINDING(agx::Physics::ContactMaterialPtr, "Physics.ContactMaterialPtr")
795AGX_TYPE_BINDING(agx::Physics::ContactMaterialInstance, "Physics.ContactMaterialInstance")
796
797#ifdef _MSC_VER
798# pragma warning(pop)
799#endif
800
801#undef AGX_ENTITY_WRAPPER
802#undef AGX_ENTITY_NAMESPACE
803#endif
804
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGX_TYPE_BINDING(_Type, _Name)
Definition: Type.h:179
#define AGXPHYSICS_EXPORT
Type-specific Array used for fast access into the data held by a Buffer.
Definition: Array.h:107
Entity instance provides access to a single instance in an EntityStorage.
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:52
EntityPtr & operator=(const EntityPtr &other)=default
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:73
This class store the combine material properties between two agx::Material's.
Definition: Material.h:518
agx::String fullPath() const
Abstract description of the data attributes for the Physics.ContactMaterial entity.
static agxData::ScalarAttributeT< agx::Vec3 > * viscosityAttribute
static agxData::ScalarAttributeT< agx::Real > * adhesiveOverlapAttribute
static agxData::ScalarAttributeT< agx::Physics::MaterialPtr > * material2Attribute
static agxData::ScalarAttributeT< agx::Real > * rollingResistanceComplianceAttribute
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
virtual void configure(agx::TiXmlElement *eEntity) override
static agxData::ScalarAttributeT< agx::Vec2 > * frictionAttribute
static agxData::ScalarAttributeT< agx::Vec2 > * wireFrictionAttribute
static agxData::ScalarAttributeT< agx::Real > * minElasticRestLengthAttribute
static agxData::ScalarAttributeT< agx::Bool > * useContactAreaApproachAttribute
static agxData::ScalarAttributeT< agx::Real > * dampingAttribute
static agxData::ScalarAttributeT< agx::Bool > * surfaceFrictionEnabledAttribute
static agxData::PointerAttributeT< agx::ContactMaterial * > * modelAttribute
static agxData::ScalarAttributeT< agx::Real > * twistingResistanceComplianceAttribute
static agxData::ScalarAttributeT< agx::Real > * youngsModulusAttribute
void construct(agx::Physics::ContactMaterialPtr contactMaterial)
static agxData::ScalarAttributeT< agx::Real > * impactComplianceAttribute
static agxData::ScalarAttributeT< agx::UInt8 > * contactReductionBinResolutionAttribute
static agxData::EntityStorage * defaultStorage()
static agxData::ScalarAttributeT< agx::Real > * rollingResistanceCoefficientAttribute
virtual void initAttributeAccessors() override
static agxData::ScalarAttributeT< agx::Real > * twistingResistanceCoefficientAttribute
virtual void construct(agxData::EntityPtr instance) override
static agxData::ScalarAttributeT< agx::Vec3 > * restitutionAttribute
static ContactMaterialModel * instance()
static ContactMaterialPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::ScalarAttributeT< agx::Bool > * isExplicitAttribute
static agxData::ScalarAttributeT< agx::UInt8 > * contactReductionModeAttribute
static agxData::ScalarAttributeT< agx::Vec2 > * tangentialCohesionAttribute
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Physics::MaterialPtr > * material1Attribute
static agxData::ScalarAttributeT< agx::Real > * adhesionAttribute
static agxData::ScalarAttributeT< agx::Real > * maxElasticRestLengthAttribute
ContactMaterialModel(const agx::String &name="ContactMaterial")
Pointer to a entity instance of type Physics.ContactMaterial.
AGXPHYSICS_EXPORT agx::Bool const & surfaceFrictionEnabled() const
AGXPHYSICS_EXPORT agx::ContactMaterial *const & model() const
AGXPHYSICS_EXPORT agx::Real & adhesiveOverlap()
AGXPHYSICS_EXPORT agx::Real const & twistingResistanceCompliance() const
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const & material2() const
AGXPHYSICS_EXPORT agx::Vec3 & restitution()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & material1()
AGXPHYSICS_EXPORT agx::Real const & youngsModulus() const
AGXPHYSICS_EXPORT agx::Real const & adhesion() const
AGXPHYSICS_EXPORT agx::Vec2 const & friction() const
AGXPHYSICS_EXPORT agx::Bool & useContactAreaApproach()
const ContactMaterialData * getData() const
AGXPHYSICS_EXPORT ContactMaterialPtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT ContactMaterialInstance instance()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const & material1() const
AGXPHYSICS_EXPORT agx::Real & twistingResistanceCoefficient()
AGXPHYSICS_EXPORT agx::Vec2 & wireFriction()
AGXPHYSICS_EXPORT agx::Vec2 const & wireFriction() const
AGXPHYSICS_EXPORT agx::Real const & impactCompliance() const
AGXPHYSICS_EXPORT const ContactMaterialInstance instance() const
AGXPHYSICS_EXPORT agx::Bool const & isExplicit() const
AGXPHYSICS_EXPORT agx::Real & damping()
AGXPHYSICS_EXPORT agx::Real const & adhesiveOverlap() const
AGXPHYSICS_EXPORT ContactMaterialPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Vec2 const & tangentialCohesion() const
AGXPHYSICS_EXPORT agx::UInt8 const & contactReductionMode() const
AGXPHYSICS_EXPORT agx::UInt8 const & contactReductionBinResolution() const
AGXPHYSICS_EXPORT agx::Vec3 const & viscosity() const
AGXPHYSICS_EXPORT ContactMaterialPtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::Vec3 & viscosity()
AGXPHYSICS_EXPORT agx::ContactMaterial *& model()
AGXPHYSICS_EXPORT agx::Bool & isExplicit()
AGXPHYSICS_EXPORT agx::Real & maxElasticRestLength()
AGXPHYSICS_EXPORT agx::Vec2 & tangentialCohesion()
AGXPHYSICS_EXPORT agx::Real & twistingResistanceCompliance()
AGXPHYSICS_EXPORT agx::Real & minElasticRestLength()
AGXPHYSICS_EXPORT agx::Real const & damping() const
AGXPHYSICS_EXPORT agx::Bool & surfaceFrictionEnabled()
AGXPHYSICS_EXPORT agx::Real & rollingResistanceCoefficient()
ContactMaterialData * getData()
AGXPHYSICS_EXPORT agx::Real & adhesion()
AGXPHYSICS_EXPORT agx::Real & youngsModulus()
AGXPHYSICS_EXPORT ContactMaterialPtr()
AGXPHYSICS_EXPORT agx::Real const & rollingResistanceCoefficient() const
AGXPHYSICS_EXPORT agx::UInt8 & contactReductionMode()
AGXPHYSICS_EXPORT agx::Real & impactCompliance()
AGXPHYSICS_EXPORT agx::Real const & minElasticRestLength() const
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & material2()
AGXPHYSICS_EXPORT agx::Real & rollingResistanceCompliance()
AGXPHYSICS_EXPORT agx::UInt8 & contactReductionBinResolution()
AGXPHYSICS_EXPORT ContactMaterialSemantics * operator->()
AGXPHYSICS_EXPORT const ContactMaterialSemantics * operator->() const
AGXPHYSICS_EXPORT agx::Real const & maxElasticRestLength() const
AGXPHYSICS_EXPORT agx::Real const & rollingResistanceCompliance() const
AGXPHYSICS_EXPORT agx::Vec2 & friction()
AGXPHYSICS_EXPORT agx::Vec3 const & restitution() const
AGXPHYSICS_EXPORT agx::Real const & twistingResistanceCoefficient() const
AGXPHYSICS_EXPORT agx::Bool const & useContactAreaApproach() const
Pointer to a entity instance of type Physics.Material.
Abstract description of the data attributes for the Referenced entity.
Pointer to a entity instance of type Referenced.
Vector containing 'raw' data.
Definition: agx/Vector.h:246
#define agxAssertN(expr, format,...)
Definition: debug.h:145
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define CALLABLE
Definition: macros.h:72
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
#define AGX_FORCE_INLINE
Definition: macros.h:58
Contains classes for low level data storage for AGX.
Definition: Container.h:23
AGXFMI_EXPORT InputVariable_Real * setDamping(agx::Constraint *constraint)
agxData::EntityRef< ContactMaterialPtr > ContactMaterialRef
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:40
double Real
Definition: Real.h:41
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
uint8_t UInt8
Definition: Integer.h:30
UInt32 Index
Definition: Integer.h:44