AGX Dynamics  2.35.0.1
ParticleGeometryContactEntity.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
18 // AUTOMATICALLY GENERATED ENTITY, DO NOT EDIT! //
20 
21 #ifndef GENERATED_AGX_PHYSICS_PARTICLEGEOMETRYCONTACT_H_PLUGIN
22 #define GENERATED_AGX_PHYSICS_PARTICLEGEOMETRYCONTACT_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>
40 #include <agxData/EntityStorage.h>
41 #include <agxData/EntityRef.h>
42 #include <agxData/EntityPtr.h>
43 #include <agxData/EntityInstance.h>
44 #include <agx/Integer.h>
45 #include <agx/Real.h>
46 #include <agx/macros.h>
48 #include <agx/Integer.h>
50 #include <agx/Vec3.h>
51 #include <agx/Real.h>
52 
53 namespace agx { namespace Physics { class GeometryPtr; }}
54 
55 namespace agx
56 {
57  namespace Physics
58  {
59 
60  class ParticleGeometryContactModel;
61  class ParticleGeometryContactData;
62  class ParticleGeometryContactPtr;
63  class ParticleGeometryContactInstance;
64  class ParticleGeometryContactSemantics;
65 
66 
68 
73  {
74  public:
76 
77  ParticleGeometryContactModel(const agx::String& name = "ParticleGeometryContact");
78 
81 
84 
87 
89  virtual void shutdownCleanup() override;
90 
91 
92 
93  /* Attributes */
116 
117  protected:
119  virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
120  virtual void configure(agx::TiXmlElement* eEntity) override;
121  virtual void initAttributeAccessors() override;
122  virtual void construct(agxData::EntityPtr instance) override;
124  };
125 
126 
128  #ifndef AGX_PHYSICS_PARTICLEGEOMETRYCONTACT_DATA_SET_OVERRIDE
129  #define AGX_PHYSICS_PARTICLEGEOMETRYCONTACT_DATA_SET
130  class AGXPHYSICS_EXPORT ParticleGeometryContactData : public agx::Physics::ContactData
131  {
132  public:
133  ParticleGeometryContactInstance operator[] (size_t index);
134 
135  public:
144  agxData::Array< agx::UInt8 > faceFeature;
152  agxData::Array< agx::Vec3 > localForce;
153  agxData::Array< agx::Real > impactNormalForce;
154  agxData::Array< agx::Real > contactEnergy;
155  agxData::Array< agx::Bool > isImpacting;
157  agxData::Array< agx::Real32 > charContactTime;
159 
160  public:
161  typedef agx::UInt32 particleType;
162  typedef agx::UInt32 geometryType;
163  typedef agx::UInt32 bodyType;
164  typedef agx::UInt32 particleIdType;
165  typedef agx::UInt32 geometryIdType;
166  typedef agx::Physics::GeometryPtr geometryPtrType;
167  typedef agx::UInt32 faceIndexType;
168  typedef agx::UInt8 faceFeatureType;
169  typedef agx::Bool enabledType;
170  typedef agx::Vec3 pointType;
171  typedef agx::Vec3f normalType;
172  typedef agx::Vec3f tangentUType;
173  typedef agx::Vec3f tangentVType;
174  typedef agx::Real depthType;
175  typedef agx::Vec3f velocityType;
176  typedef agx::Vec3 localForceType;
177  typedef agx::Real impactNormalForceType;
178  typedef agx::Real contactEnergyType;
179  typedef agx::Bool isImpactingType;
180  typedef agx::Real32 timeStampType;
181  typedef agx::Real32 charContactTimeType;
182  typedef agx::Int nextType;
183 
184  public:
185  ParticleGeometryContactData(agxData::EntityStorage* storage);
186  ParticleGeometryContactData();
187 
188  protected:
189  virtual ~ParticleGeometryContactData() {}
190  virtual void setNumElements(agx::Index numElements) override;
191 
192  private:
193  ParticleGeometryContactData& operator= (const ParticleGeometryContactData&) { return *this; }
194 
195  };
196  #endif
198 
199 
201  class AGXPHYSICS_EXPORT ParticleGeometryContactSemantics : public agx::Physics::ContactSemantics
202  {
203  public:
204 
205  // Automatic getters
206  agx::UInt32 const& getParticle() const;
207  agx::UInt32 const& getGeometry() const;
208  agx::UInt32 const& getBody() const;
209  agx::UInt32 const& getParticleId() const;
210  agx::UInt32 const& getGeometryId() const;
211  agx::Physics::GeometryPtr const& getGeometryPtr() const;
212  agx::UInt32 const& getFaceIndex() const;
213  agx::UInt8 const& getFaceFeature() const;
214  agx::Bool const& getEnabled() const;
215  agx::Vec3 const& getPoint() const;
216  agx::Vec3f const& getNormal() const;
217  agx::Vec3f const& getTangentU() const;
218  agx::Vec3f const& getTangentV() const;
219  agx::Real const& getDepth() const;
220  agx::Vec3f const& getVelocity() const;
221  agx::Vec3 const& getLocalForce() const;
222  agx::Real const& getImpactNormalForce() const;
223  agx::Real const& getContactEnergy() const;
224  agx::Bool const& getIsImpacting() const;
225  agx::Real32 const& getTimeStamp() const;
226  agx::Real32 const& getCharContactTime() const;
227  agx::Int const& getNext() const;
228 
229  // Semantics defined by explicit kernels
230 
231  // Automatic setters
232  void setParticle(agx::UInt32 const& value);
233  void setGeometry(agx::UInt32 const& value);
234  void setBody(agx::UInt32 const& value);
235  void setParticleId(agx::UInt32 const& value);
236  void setGeometryId(agx::UInt32 const& value);
237  void setGeometryPtr(agx::Physics::GeometryPtr const& value);
238  void setFaceIndex(agx::UInt32 const& value);
239  void setFaceFeature(agx::UInt8 const& value);
240  void setEnabled(agx::Bool const& value);
241  void setPoint(agx::Vec3 const& value);
242  void setNormal(agx::Vec3f const& value);
243  void setTangentU(agx::Vec3f const& value);
244  void setTangentV(agx::Vec3f const& value);
245  void setDepth(agx::Real const& value);
246  void setVelocity(agx::Vec3f const& value);
247  void setLocalForce(agx::Vec3 const& value);
248  void setImpactNormalForce(agx::Real const& value);
249  void setContactEnergy(agx::Real const& value);
250  void setIsImpacting(agx::Bool const& value);
251  void setTimeStamp(agx::Real32 const& value);
252  void setCharContactTime(agx::Real32 const& value);
253  void setNext(agx::Int const& value);
254 
255 
256  protected:
257  friend class ParticleGeometryContactPtr;
258  friend class ParticleGeometryContactInstance;
259  ParticleGeometryContactSemantics();
260  };
262 
263 
264 
268  {
269  public:
271  typedef ParticleGeometryContactData DataType;
272  typedef ParticleGeometryContactInstance InstanceType;
273 
274  public:
281  AGXPHYSICS_EXPORT ParticleGeometryContactInstance instance();
282  AGXPHYSICS_EXPORT const ParticleGeometryContactInstance instance() const;
283 
284  AGXPHYSICS_EXPORT ParticleGeometryContactSemantics* operator->();
285  AGXPHYSICS_EXPORT const ParticleGeometryContactSemantics* operator->() const;
286 
287  ParticleGeometryContactData* getData();
288  const ParticleGeometryContactData* getData() const;
289 
290 
295 
300 
305 
310 
315 
320 
325 
330 
335 
340 
345 
350 
355 
360 
365 
370 
375 
380 
385 
390 
395 
400 
402  // Only used by tolua!
403  #ifdef AGX_GENERATED_TOLUA_WRAPPER
404  inline agx::UInt32 const& getParticle() const { return (*this)->getParticle(); }
405  inline agx::UInt32 const& getGeometry() const { return (*this)->getGeometry(); }
406  inline agx::UInt32 const& getBody() const { return (*this)->getBody(); }
407  inline agx::UInt32 const& getParticleId() const { return (*this)->getParticleId(); }
408  inline agx::UInt32 const& getGeometryId() const { return (*this)->getGeometryId(); }
409  inline agx::Physics::GeometryPtr const& getGeometryPtr() const { return (*this)->getGeometryPtr(); }
410  inline agx::UInt32 const& getFaceIndex() const { return (*this)->getFaceIndex(); }
411  inline agx::UInt8 const& getFaceFeature() const { return (*this)->getFaceFeature(); }
412  inline agx::Bool const& getEnabled() const { return (*this)->getEnabled(); }
413  inline agx::Vec3 const& getPoint() const { return (*this)->getPoint(); }
414  inline agx::Vec3f const& getNormal() const { return (*this)->getNormal(); }
415  inline agx::Vec3f const& getTangentU() const { return (*this)->getTangentU(); }
416  inline agx::Vec3f const& getTangentV() const { return (*this)->getTangentV(); }
417  inline agx::Real const& getDepth() const { return (*this)->getDepth(); }
418  inline agx::Vec3f const& getVelocity() const { return (*this)->getVelocity(); }
419  inline agx::Vec3 const& getLocalForce() const { return (*this)->getLocalForce(); }
420  inline agx::Real const& getImpactNormalForce() const { return (*this)->getImpactNormalForce(); }
421  inline agx::Real const& getContactEnergy() const { return (*this)->getContactEnergy(); }
422  inline agx::Bool const& getIsImpacting() const { return (*this)->getIsImpacting(); }
423  inline agx::Real32 const& getTimeStamp() const { return (*this)->getTimeStamp(); }
424  inline agx::Real32 const& getCharContactTime() const { return (*this)->getCharContactTime(); }
425  inline agx::Int const& getNext() const { return (*this)->getNext(); }
426 
427 
428  inline void setParticle(agx::UInt32 const& value) { (*this)->setParticle(value); }
429  inline void setGeometry(agx::UInt32 const& value) { (*this)->setGeometry(value); }
430  inline void setBody(agx::UInt32 const& value) { (*this)->setBody(value); }
431  inline void setParticleId(agx::UInt32 const& value) { (*this)->setParticleId(value); }
432  inline void setGeometryId(agx::UInt32 const& value) { (*this)->setGeometryId(value); }
433  inline void setGeometryPtr(agx::Physics::GeometryPtr const& value) { (*this)->setGeometryPtr(value); }
434  inline void setFaceIndex(agx::UInt32 const& value) { (*this)->setFaceIndex(value); }
435  inline void setFaceFeature(agx::UInt8 const& value) { (*this)->setFaceFeature(value); }
436  inline void setEnabled(agx::Bool const& value) { (*this)->setEnabled(value); }
437  inline void setPoint(agx::Vec3 const& value) { (*this)->setPoint(value); }
438  inline void setNormal(agx::Vec3f const& value) { (*this)->setNormal(value); }
439  inline void setTangentU(agx::Vec3f const& value) { (*this)->setTangentU(value); }
440  inline void setTangentV(agx::Vec3f const& value) { (*this)->setTangentV(value); }
441  inline void setDepth(agx::Real const& value) { (*this)->setDepth(value); }
442  inline void setVelocity(agx::Vec3f const& value) { (*this)->setVelocity(value); }
443  inline void setLocalForce(agx::Vec3 const& value) { (*this)->setLocalForce(value); }
444  inline void setImpactNormalForce(agx::Real const& value) { (*this)->setImpactNormalForce(value); }
445  inline void setContactEnergy(agx::Real const& value) { (*this)->setContactEnergy(value); }
446  inline void setIsImpacting(agx::Bool const& value) { (*this)->setIsImpacting(value); }
447  inline void setTimeStamp(agx::Real32 const& value) { (*this)->setTimeStamp(value); }
448  inline void setCharContactTime(agx::Real32 const& value) { (*this)->setCharContactTime(value); }
449  inline void setNext(agx::Int const& value) { (*this)->setNext(value); }
450  #endif
452 
453  };
454 
455 
457  class AGXPHYSICS_EXPORT ParticleGeometryContactInstance : public agx::Physics::ContactInstance
458  {
459  public:
460  ParticleGeometryContactInstance();
461  ParticleGeometryContactInstance(ParticleGeometryContactData* data, agx::Index index);
462  ParticleGeometryContactInstance(agxData::EntityStorage *storage, agx::Index index);
463  ParticleGeometryContactInstance(const agxData::EntityInstance& other);
464  ParticleGeometryContactInstance(const agxData::EntityPtr& ptr);
465 
466  ParticleGeometryContactData* getData();
467  const ParticleGeometryContactData* getData() const;
468 
469  public:
471  agx::UInt32& particle();
473  agx::UInt32 const& particle() const;
474 
476  agx::UInt32& geometry();
478  agx::UInt32 const& geometry() const;
479 
481  agx::UInt32& body();
483  agx::UInt32 const& body() const;
484 
486  agx::UInt32& particleId();
488  agx::UInt32 const& particleId() const;
489 
491  agx::UInt32& geometryId();
493  agx::UInt32 const& geometryId() const;
494 
496  agx::Physics::GeometryPtr& geometryPtr();
498  agx::Physics::GeometryPtr const& geometryPtr() const;
499 
501  agx::UInt32& faceIndex();
503  agx::UInt32 const& faceIndex() const;
504 
506  agx::UInt8& faceFeature();
508  agx::UInt8 const& faceFeature() const;
509 
511  agx::Bool& enabled();
513  agx::Bool const& enabled() const;
514 
516  agx::Vec3& point();
518  agx::Vec3 const& point() const;
519 
521  agx::Vec3f& normal();
523  agx::Vec3f const& normal() const;
524 
526  agx::Vec3f& tangentU();
528  agx::Vec3f const& tangentU() const;
529 
531  agx::Vec3f& tangentV();
533  agx::Vec3f const& tangentV() const;
534 
536  agx::Real& depth();
538  agx::Real const& depth() const;
539 
541  agx::Vec3f& velocity();
543  agx::Vec3f const& velocity() const;
544 
546  agx::Vec3& localForce();
548  agx::Vec3 const& localForce() const;
549 
551  agx::Real& impactNormalForce();
553  agx::Real const& impactNormalForce() const;
554 
556  agx::Real& contactEnergy();
558  agx::Real const& contactEnergy() const;
559 
561  agx::Bool& isImpacting();
563  agx::Bool const& isImpacting() const;
564 
566  agx::Real32& timeStamp();
568  agx::Real32 const& timeStamp() const;
569 
571  agx::Real32& charContactTime();
573  agx::Real32 const& charContactTime() const;
574 
576  agx::Int& next();
578  agx::Int const& next() const;
579 
580  };
582 
583 
584 
587 
588 
589 
591  /* Implementation */
592  //-----------------------------------------------------------------------------------------------------
593  //-----------------------------------------------------------------------------------------------------
594  inline ParticleGeometryContactInstance agx::Physics::ParticleGeometryContactData::operator[] (size_t index) { return ParticleGeometryContactInstance(this, (agx::Index)index); }
595  //-----------------------------------------------------------------------------------------------------
598  AGX_FORCE_INLINE ParticleGeometryContactPtr::ParticleGeometryContactPtr(const agxData::EntityPtr& ptr) : agx::Physics::ContactPtr(ptr)
599  {
601  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
603  }
604 
605  AGX_FORCE_INLINE ParticleGeometryContactPtr::ParticleGeometryContactPtr(const agxData::EntityInstance& instance) : agx::Physics::ContactPtr(instance)
606  {
608  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
610  }
611 
612  AGX_FORCE_INLINE ParticleGeometryContactPtr& ParticleGeometryContactPtr::operator= (const agxData::EntityPtr& ptr)
613  {
615  agxAssertN(!ptr || ptr.isInstanceOf(ParticleGeometryContactModel::instance()),
616  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
617  EntityPtr::getModel()->fullPath().c_str(), ParticleGeometryContactModel::instance()->fullPath().c_str());
618  return *this;
619  }
620 
621  AGX_FORCE_INLINE ParticleGeometryContactPtr& ParticleGeometryContactPtr::operator= (const agxData::EntityInstance& instance)
622  {
624  agxAssertN(!instance || instance.isInstanceOf(ParticleGeometryContactModel::instance()),
625  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
626  EntityPtr::getModel()->fullPath().c_str(), ParticleGeometryContactModel::instance()->fullPath().c_str());
627  return *this;
628  }
629 
630  inline ParticleGeometryContactInstance ParticleGeometryContactPtr::instance() { return agxData::EntityPtr::instance(); }
631  inline const ParticleGeometryContactInstance ParticleGeometryContactPtr::instance() const { return agxData::EntityPtr::instance(); }
632  AGX_FORCE_INLINE ParticleGeometryContactSemantics* ParticleGeometryContactPtr::operator->() { return (ParticleGeometryContactSemantics* )this; }
633  AGX_FORCE_INLINE const ParticleGeometryContactSemantics* ParticleGeometryContactPtr::operator->() const { return (const ParticleGeometryContactSemantics* )this; }
634  AGX_FORCE_INLINE ParticleGeometryContactData* ParticleGeometryContactPtr::getData() { return static_cast<ParticleGeometryContactData* >(agxData::EntityPtr::getData()); }
635  AGX_FORCE_INLINE const ParticleGeometryContactData* ParticleGeometryContactPtr::getData() const { return static_cast<const ParticleGeometryContactData* >(agxData::EntityPtr::getData()); }
636 
637  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactPtr::particle() { verifyIndex(); return getData()->particle[calculateIndex()]; }
638  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactPtr::particle() const { verifyIndex(); return getData()->particle[calculateIndex()]; }
639 
640  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactPtr::geometry() { verifyIndex(); return getData()->geometry[calculateIndex()]; }
641  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactPtr::geometry() const { verifyIndex(); return getData()->geometry[calculateIndex()]; }
642 
643  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactPtr::body() { verifyIndex(); return getData()->body[calculateIndex()]; }
644  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactPtr::body() const { verifyIndex(); return getData()->body[calculateIndex()]; }
645 
646  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactPtr::particleId() { verifyIndex(); return getData()->particleId[calculateIndex()]; }
647  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactPtr::particleId() const { verifyIndex(); return getData()->particleId[calculateIndex()]; }
648 
649  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactPtr::geometryId() { verifyIndex(); return getData()->geometryId[calculateIndex()]; }
650  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactPtr::geometryId() const { verifyIndex(); return getData()->geometryId[calculateIndex()]; }
651 
652  AGX_FORCE_INLINE agx::Physics::GeometryPtr& ParticleGeometryContactPtr::geometryPtr() { verifyIndex(); return getData()->geometryPtr[calculateIndex()]; }
653  AGX_FORCE_INLINE agx::Physics::GeometryPtr const& ParticleGeometryContactPtr::geometryPtr() const { verifyIndex(); return getData()->geometryPtr[calculateIndex()]; }
654 
655  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactPtr::faceIndex() { verifyIndex(); return getData()->faceIndex[calculateIndex()]; }
656  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactPtr::faceIndex() const { verifyIndex(); return getData()->faceIndex[calculateIndex()]; }
657 
658  AGX_FORCE_INLINE agx::UInt8& ParticleGeometryContactPtr::faceFeature() { verifyIndex(); return getData()->faceFeature[calculateIndex()]; }
659  AGX_FORCE_INLINE agx::UInt8 const& ParticleGeometryContactPtr::faceFeature() const { verifyIndex(); return getData()->faceFeature[calculateIndex()]; }
660 
661  AGX_FORCE_INLINE agx::Bool& ParticleGeometryContactPtr::enabled() { verifyIndex(); return getData()->enabled[calculateIndex()]; }
662  AGX_FORCE_INLINE agx::Bool const& ParticleGeometryContactPtr::enabled() const { verifyIndex(); return getData()->enabled[calculateIndex()]; }
663 
664  AGX_FORCE_INLINE agx::Vec3& ParticleGeometryContactPtr::point() { verifyIndex(); return getData()->point[calculateIndex()]; }
665  AGX_FORCE_INLINE agx::Vec3 const& ParticleGeometryContactPtr::point() const { verifyIndex(); return getData()->point[calculateIndex()]; }
666 
667  AGX_FORCE_INLINE agx::Vec3f& ParticleGeometryContactPtr::normal() { verifyIndex(); return getData()->normal[calculateIndex()]; }
668  AGX_FORCE_INLINE agx::Vec3f const& ParticleGeometryContactPtr::normal() const { verifyIndex(); return getData()->normal[calculateIndex()]; }
669 
670  AGX_FORCE_INLINE agx::Vec3f& ParticleGeometryContactPtr::tangentU() { verifyIndex(); return getData()->tangentU[calculateIndex()]; }
671  AGX_FORCE_INLINE agx::Vec3f const& ParticleGeometryContactPtr::tangentU() const { verifyIndex(); return getData()->tangentU[calculateIndex()]; }
672 
673  AGX_FORCE_INLINE agx::Vec3f& ParticleGeometryContactPtr::tangentV() { verifyIndex(); return getData()->tangentV[calculateIndex()]; }
674  AGX_FORCE_INLINE agx::Vec3f const& ParticleGeometryContactPtr::tangentV() const { verifyIndex(); return getData()->tangentV[calculateIndex()]; }
675 
676  AGX_FORCE_INLINE agx::Real& ParticleGeometryContactPtr::depth() { verifyIndex(); return getData()->depth[calculateIndex()]; }
677  AGX_FORCE_INLINE agx::Real const& ParticleGeometryContactPtr::depth() const { verifyIndex(); return getData()->depth[calculateIndex()]; }
678 
679  AGX_FORCE_INLINE agx::Vec3f& ParticleGeometryContactPtr::velocity() { verifyIndex(); return getData()->velocity[calculateIndex()]; }
680  AGX_FORCE_INLINE agx::Vec3f const& ParticleGeometryContactPtr::velocity() const { verifyIndex(); return getData()->velocity[calculateIndex()]; }
681 
682  AGX_FORCE_INLINE agx::Vec3& ParticleGeometryContactPtr::localForce() { verifyIndex(); return getData()->localForce[calculateIndex()]; }
683  AGX_FORCE_INLINE agx::Vec3 const& ParticleGeometryContactPtr::localForce() const { verifyIndex(); return getData()->localForce[calculateIndex()]; }
684 
685  AGX_FORCE_INLINE agx::Real& ParticleGeometryContactPtr::impactNormalForce() { verifyIndex(); return getData()->impactNormalForce[calculateIndex()]; }
686  AGX_FORCE_INLINE agx::Real const& ParticleGeometryContactPtr::impactNormalForce() const { verifyIndex(); return getData()->impactNormalForce[calculateIndex()]; }
687 
688  AGX_FORCE_INLINE agx::Real& ParticleGeometryContactPtr::contactEnergy() { verifyIndex(); return getData()->contactEnergy[calculateIndex()]; }
689  AGX_FORCE_INLINE agx::Real const& ParticleGeometryContactPtr::contactEnergy() const { verifyIndex(); return getData()->contactEnergy[calculateIndex()]; }
690 
691  AGX_FORCE_INLINE agx::Bool& ParticleGeometryContactPtr::isImpacting() { verifyIndex(); return getData()->isImpacting[calculateIndex()]; }
692  AGX_FORCE_INLINE agx::Bool const& ParticleGeometryContactPtr::isImpacting() const { verifyIndex(); return getData()->isImpacting[calculateIndex()]; }
693 
694  AGX_FORCE_INLINE agx::Real32& ParticleGeometryContactPtr::timeStamp() { verifyIndex(); return getData()->timeStamp[calculateIndex()]; }
695  AGX_FORCE_INLINE agx::Real32 const& ParticleGeometryContactPtr::timeStamp() const { verifyIndex(); return getData()->timeStamp[calculateIndex()]; }
696 
697  AGX_FORCE_INLINE agx::Real32& ParticleGeometryContactPtr::charContactTime() { verifyIndex(); return getData()->charContactTime[calculateIndex()]; }
698  AGX_FORCE_INLINE agx::Real32 const& ParticleGeometryContactPtr::charContactTime() const { verifyIndex(); return getData()->charContactTime[calculateIndex()]; }
699 
700  AGX_FORCE_INLINE agx::Int& ParticleGeometryContactPtr::next() { verifyIndex(); return getData()->next[calculateIndex()]; }
701  AGX_FORCE_INLINE agx::Int const& ParticleGeometryContactPtr::next() const { verifyIndex(); return getData()->next[calculateIndex()]; }
702 
703  //-----------------------------------------------------------------------------------------------------
704  AGX_FORCE_INLINE ParticleGeometryContactInstance::ParticleGeometryContactInstance() {}
705  AGX_FORCE_INLINE ParticleGeometryContactInstance::ParticleGeometryContactInstance(ParticleGeometryContactData* data, agx::Index index) : agx::Physics::ContactInstance(data, index) {}
706  AGX_FORCE_INLINE ParticleGeometryContactInstance::ParticleGeometryContactInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::ContactInstance(storage, index) {}
707  AGX_FORCE_INLINE ParticleGeometryContactInstance::ParticleGeometryContactInstance(const agxData::EntityInstance& other) : agx::Physics::ContactInstance(other)
708  {
710  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
712  }
713 
714  AGX_FORCE_INLINE ParticleGeometryContactInstance::ParticleGeometryContactInstance(const agxData::EntityPtr& ptr) : agx::Physics::ContactInstance(ptr)
715  {
717  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
719  }
720 
721 
722  AGX_FORCE_INLINE ParticleGeometryContactData* ParticleGeometryContactInstance::getData() { return static_cast<ParticleGeometryContactData* >(agxData::EntityInstance::getData()); }
723  AGX_FORCE_INLINE const ParticleGeometryContactData* ParticleGeometryContactInstance::getData() const { return static_cast<const ParticleGeometryContactData* >(agxData::EntityInstance::getData()); }
724 
725  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactInstance::particle() { verifyIndex(); return getData()->particle[getIndex()]; }
726  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactInstance::particle() const { verifyIndex(); return getData()->particle[getIndex()]; }
727 
728  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactInstance::geometry() { verifyIndex(); return getData()->geometry[getIndex()]; }
729  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactInstance::geometry() const { verifyIndex(); return getData()->geometry[getIndex()]; }
730 
731  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactInstance::body() { verifyIndex(); return getData()->body[getIndex()]; }
732  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactInstance::body() const { verifyIndex(); return getData()->body[getIndex()]; }
733 
734  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactInstance::particleId() { verifyIndex(); return getData()->particleId[getIndex()]; }
735  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactInstance::particleId() const { verifyIndex(); return getData()->particleId[getIndex()]; }
736 
737  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactInstance::geometryId() { verifyIndex(); return getData()->geometryId[getIndex()]; }
738  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactInstance::geometryId() const { verifyIndex(); return getData()->geometryId[getIndex()]; }
739 
740  AGX_FORCE_INLINE agx::Physics::GeometryPtr& ParticleGeometryContactInstance::geometryPtr() { verifyIndex(); return getData()->geometryPtr[getIndex()]; }
741  AGX_FORCE_INLINE agx::Physics::GeometryPtr const& ParticleGeometryContactInstance::geometryPtr() const { verifyIndex(); return getData()->geometryPtr[getIndex()]; }
742 
743  AGX_FORCE_INLINE agx::UInt32& ParticleGeometryContactInstance::faceIndex() { verifyIndex(); return getData()->faceIndex[getIndex()]; }
744  AGX_FORCE_INLINE agx::UInt32 const& ParticleGeometryContactInstance::faceIndex() const { verifyIndex(); return getData()->faceIndex[getIndex()]; }
745 
746  AGX_FORCE_INLINE agx::UInt8& ParticleGeometryContactInstance::faceFeature() { verifyIndex(); return getData()->faceFeature[getIndex()]; }
747  AGX_FORCE_INLINE agx::UInt8 const& ParticleGeometryContactInstance::faceFeature() const { verifyIndex(); return getData()->faceFeature[getIndex()]; }
748 
749  AGX_FORCE_INLINE agx::Bool& ParticleGeometryContactInstance::enabled() { verifyIndex(); return getData()->enabled[getIndex()]; }
750  AGX_FORCE_INLINE agx::Bool const& ParticleGeometryContactInstance::enabled() const { verifyIndex(); return getData()->enabled[getIndex()]; }
751 
752  AGX_FORCE_INLINE agx::Vec3& ParticleGeometryContactInstance::point() { verifyIndex(); return getData()->point[getIndex()]; }
753  AGX_FORCE_INLINE agx::Vec3 const& ParticleGeometryContactInstance::point() const { verifyIndex(); return getData()->point[getIndex()]; }
754 
755  AGX_FORCE_INLINE agx::Vec3f& ParticleGeometryContactInstance::normal() { verifyIndex(); return getData()->normal[getIndex()]; }
756  AGX_FORCE_INLINE agx::Vec3f const& ParticleGeometryContactInstance::normal() const { verifyIndex(); return getData()->normal[getIndex()]; }
757 
758  AGX_FORCE_INLINE agx::Vec3f& ParticleGeometryContactInstance::tangentU() { verifyIndex(); return getData()->tangentU[getIndex()]; }
759  AGX_FORCE_INLINE agx::Vec3f const& ParticleGeometryContactInstance::tangentU() const { verifyIndex(); return getData()->tangentU[getIndex()]; }
760 
761  AGX_FORCE_INLINE agx::Vec3f& ParticleGeometryContactInstance::tangentV() { verifyIndex(); return getData()->tangentV[getIndex()]; }
762  AGX_FORCE_INLINE agx::Vec3f const& ParticleGeometryContactInstance::tangentV() const { verifyIndex(); return getData()->tangentV[getIndex()]; }
763 
764  AGX_FORCE_INLINE agx::Real& ParticleGeometryContactInstance::depth() { verifyIndex(); return getData()->depth[getIndex()]; }
765  AGX_FORCE_INLINE agx::Real const& ParticleGeometryContactInstance::depth() const { verifyIndex(); return getData()->depth[getIndex()]; }
766 
767  AGX_FORCE_INLINE agx::Vec3f& ParticleGeometryContactInstance::velocity() { verifyIndex(); return getData()->velocity[getIndex()]; }
768  AGX_FORCE_INLINE agx::Vec3f const& ParticleGeometryContactInstance::velocity() const { verifyIndex(); return getData()->velocity[getIndex()]; }
769 
770  AGX_FORCE_INLINE agx::Vec3& ParticleGeometryContactInstance::localForce() { verifyIndex(); return getData()->localForce[getIndex()]; }
771  AGX_FORCE_INLINE agx::Vec3 const& ParticleGeometryContactInstance::localForce() const { verifyIndex(); return getData()->localForce[getIndex()]; }
772 
773  AGX_FORCE_INLINE agx::Real& ParticleGeometryContactInstance::impactNormalForce() { verifyIndex(); return getData()->impactNormalForce[getIndex()]; }
774  AGX_FORCE_INLINE agx::Real const& ParticleGeometryContactInstance::impactNormalForce() const { verifyIndex(); return getData()->impactNormalForce[getIndex()]; }
775 
776  AGX_FORCE_INLINE agx::Real& ParticleGeometryContactInstance::contactEnergy() { verifyIndex(); return getData()->contactEnergy[getIndex()]; }
777  AGX_FORCE_INLINE agx::Real const& ParticleGeometryContactInstance::contactEnergy() const { verifyIndex(); return getData()->contactEnergy[getIndex()]; }
778 
779  AGX_FORCE_INLINE agx::Bool& ParticleGeometryContactInstance::isImpacting() { verifyIndex(); return getData()->isImpacting[getIndex()]; }
780  AGX_FORCE_INLINE agx::Bool const& ParticleGeometryContactInstance::isImpacting() const { verifyIndex(); return getData()->isImpacting[getIndex()]; }
781 
782  AGX_FORCE_INLINE agx::Real32& ParticleGeometryContactInstance::timeStamp() { verifyIndex(); return getData()->timeStamp[getIndex()]; }
783  AGX_FORCE_INLINE agx::Real32 const& ParticleGeometryContactInstance::timeStamp() const { verifyIndex(); return getData()->timeStamp[getIndex()]; }
784 
785  AGX_FORCE_INLINE agx::Real32& ParticleGeometryContactInstance::charContactTime() { verifyIndex(); return getData()->charContactTime[getIndex()]; }
786  AGX_FORCE_INLINE agx::Real32 const& ParticleGeometryContactInstance::charContactTime() const { verifyIndex(); return getData()->charContactTime[getIndex()]; }
787 
788  AGX_FORCE_INLINE agx::Int& ParticleGeometryContactInstance::next() { verifyIndex(); return getData()->next[getIndex()]; }
789  AGX_FORCE_INLINE agx::Int const& ParticleGeometryContactInstance::next() const { verifyIndex(); return getData()->next[getIndex()]; }
790 
791  //-----------------------------------------------------------------------------------------------------
792  AGX_FORCE_INLINE ParticleGeometryContactSemantics::ParticleGeometryContactSemantics() {}
793  //-----------------------------------------------------------------------------------------------------
795  }
796 }
797 
798 AGX_TYPE_BINDING(agx::Physics::ParticleGeometryContactPtr, "Physics.ParticleGeometryContactPtr")
799 AGX_TYPE_BINDING(agx::Physics::ParticleGeometryContactInstance, "Physics.ParticleGeometryContactInstance")
800 
801 #ifdef _MSC_VER
802 # pragma warning(pop)
803 #endif
804 
805 #undef AGX_ENTITY_WRAPPER
806 #undef AGX_ENTITY_NAMESPACE
807 #endif
808 
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
EntityPtr & operator=(const EntityPtr &other)=default
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:73
agx::String fullPath() const
Abstract description of the data attributes for the Physics.Contact entity.
Definition: ContactEntity.h:71
Pointer to a entity instance of type Physics.Contact.
Pointer to a entity instance of type Physics.Geometry.
Abstract description of the data attributes for the Physics.ParticleGeometryContact entity.
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static ParticleGeometryContactPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
void construct(agx::Physics::ParticleGeometryContactPtr particleGeometryContact)
static agxData::ScalarAttributeT< agx::Vec3 > * pointAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * geometryIdAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * bodyAttribute
static agxData::ScalarAttributeT< agx::Vec3f > * velocityAttribute
static agxData::ScalarAttributeT< agx::Int > * nextAttribute
static agxData::ScalarAttributeT< agx::Real32 > * timeStampAttribute
static agxData::ScalarAttributeT< agx::Vec3f > * normalAttribute
static agxData::ScalarAttributeT< agx::Vec3f > * tangentVAttribute
static agxData::ScalarAttributeT< agx::Physics::GeometryPtr > * geometryPtrAttribute
static agxData::ScalarAttributeT< agx::Real32 > * charContactTimeAttribute
static agxData::ScalarAttributeT< agx::Real > * depthAttribute
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
ParticleGeometryContactModel(const agx::String &name="ParticleGeometryContact")
static agxData::ScalarAttributeT< agx::UInt32 > * particleIdAttribute
static agxData::ScalarAttributeT< agx::Bool > * isImpactingAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * particleAttribute
static agxData::ScalarAttributeT< agx::Bool > * enabledAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * faceIndexAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * localForceAttribute
virtual void construct(agxData::EntityPtr instance) override
static ParticleGeometryContactModel * instance()
static agxData::EntityStorage * defaultStorage()
virtual void configure(agx::TiXmlElement *eEntity) override
static agxData::ScalarAttributeT< agx::Real > * impactNormalForceAttribute
virtual void initAttributeAccessors() override
static agxData::ScalarAttributeT< agx::UInt8 > * faceFeatureAttribute
static agxData::ScalarAttributeT< agx::Real > * contactEnergyAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * geometryAttribute
static agxData::ScalarAttributeT< agx::Vec3f > * tangentUAttribute
Pointer to a entity instance of type Physics.ParticleGeometryContact.
AGXPHYSICS_EXPORT agx::Vec3 const & point() const
const ParticleGeometryContactData * getData() const
AGXPHYSICS_EXPORT agx::Vec3f const & normal() const
AGXPHYSICS_EXPORT ParticleGeometryContactSemantics * operator->()
AGXPHYSICS_EXPORT agx::UInt32 const & particle() const
AGXPHYSICS_EXPORT ParticleGeometryContactPtr()
AGXPHYSICS_EXPORT agx::Vec3f & normal()
AGXPHYSICS_EXPORT agx::Real32 & timeStamp()
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & geometryPtr()
AGXPHYSICS_EXPORT agx::Vec3f & velocity()
AGXPHYSICS_EXPORT agx::Vec3f & tangentU()
AGXPHYSICS_EXPORT agx::Real & impactNormalForce()
AGXPHYSICS_EXPORT agx::Int const & next() const
AGXPHYSICS_EXPORT agx::Vec3 & localForce()
AGXPHYSICS_EXPORT ParticleGeometryContactPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Bool & isImpacting()
AGXPHYSICS_EXPORT agx::Real32 const & timeStamp() const
AGXPHYSICS_EXPORT agx::Real & depth()
AGXPHYSICS_EXPORT agx::Real const & depth() const
AGXPHYSICS_EXPORT agx::UInt32 const & faceIndex() const
The face index of shape 2 in contact (e.g. index of triangle for trimesh).
AGXPHYSICS_EXPORT ParticleGeometryContactPtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT agx::Vec3f & tangentV()
AGXPHYSICS_EXPORT agx::UInt32 const & particleId() const
AGXPHYSICS_EXPORT agx::Bool const & isImpacting() const
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr const & geometryPtr() const
AGXPHYSICS_EXPORT agx::Vec3f const & tangentU() const
AGXPHYSICS_EXPORT agx::Bool & enabled()
ParticleGeometryContactData * getData()
AGXPHYSICS_EXPORT agx::UInt32 & geometryId()
AGXPHYSICS_EXPORT agx::Real const & impactNormalForce() const
AGXPHYSICS_EXPORT agx::UInt32 const & geometryId() const
AGXPHYSICS_EXPORT agx::Int & next()
AGXPHYSICS_EXPORT agx::UInt32 & particleId()
AGXPHYSICS_EXPORT agx::Vec3 const & localForce() const
AGXPHYSICS_EXPORT agx::UInt32 & particle()
AGXPHYSICS_EXPORT agx::Real const & contactEnergy() const
AGXPHYSICS_EXPORT agx::UInt32 & geometry()
AGXPHYSICS_EXPORT agx::UInt32 & faceIndex()
The face index of shape 2 in contact (e.g. index of triangle for trimesh).
AGXPHYSICS_EXPORT agx::Real32 & charContactTime()
AGXPHYSICS_EXPORT agx::Real & contactEnergy()
AGXPHYSICS_EXPORT ParticleGeometryContactPtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT const ParticleGeometryContactSemantics * operator->() const
AGXPHYSICS_EXPORT agx::UInt8 & faceFeature()
The face feature of shape 2 in contact (e.g. voronoi region on triangle for trimesh).
AGXPHYSICS_EXPORT agx::Vec3f const & velocity() const
AGXPHYSICS_EXPORT agx::Real32 const & charContactTime() const
AGXPHYSICS_EXPORT agx::Vec3 & point()
AGXPHYSICS_EXPORT agx::UInt8 const & faceFeature() const
The face feature of shape 2 in contact (e.g. voronoi region on triangle for trimesh).
AGXPHYSICS_EXPORT agx::UInt32 & body()
AGXPHYSICS_EXPORT agx::Bool const & enabled() const
AGXPHYSICS_EXPORT agx::UInt32 const & geometry() const
AGXPHYSICS_EXPORT ParticleGeometryContactInstance instance()
AGXPHYSICS_EXPORT const ParticleGeometryContactInstance instance() const
AGXPHYSICS_EXPORT agx::Vec3f const & tangentV() const
AGXPHYSICS_EXPORT agx::UInt32 const & body() const
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:97
#define CALLABLE
Definition: macros.h:72
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
#define AGX_FORCE_INLINE
Definition: macros.h:58
Contains classes for low level data storage for AGX.
Definition: Container.h:23
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint32_t UInt32
Definition: Integer.h:40
bool Bool
Definition: Integer.h:48
int32_t Int
Definition: Integer.h:35
double Real
Definition: Real.h:42
uint8_t UInt8
Definition: Integer.h:38
float Real32
Definition: Real.h:44
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
Definition: Object.h:364
UInt32 Index
Definition: Integer.h:52