AGX Dynamics  2.37.3.2
ContactPointEntity.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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_CONTACTPOINT_H_PLUGIN
22 #define GENERATED_AGX_PHYSICS_CONTACTPOINT_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>
47 #include <agx/Vec3.h>
48 #include <agx/Real.h>
49 #include <agx/Integer.h>
50 #include <agx/Vec4.h>
52 
53 namespace agx { namespace Physics { namespace Geometry { class ShapePtr; }}}
54 namespace agx { namespace Physics { namespace Geometry { class ShapePtr; }}}
55 
56 namespace agx
57 {
58  namespace Physics
59  {
60 
61  class ContactPointModel;
62  class ContactPointData;
63  class ContactPointPtr;
64  class ContactPointInstance;
65  class ContactPointSemantics;
66 
67 
69 
74  {
75  public:
77 
78  ContactPointModel(const agx::String& name = "ContactPoint");
79 
81  static ContactPointModel* instance();
82 
84  static ContactPointPtr createInstance();
85 
87  static agxData::EntityStorage* defaultStorage();
88 
90  virtual void shutdownCleanup() override;
91 
92 
93 
94  /* Attributes */
115 
116  protected:
117  virtual ~ContactPointModel();
118  virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
119  virtual void configure(agx::TiXmlElement* eEntity) override;
120  virtual void initAttributeAccessors() override;
121  virtual void construct(agxData::EntityPtr instance) override;
122  void construct(agx::Physics::ContactPointPtr contactPoint);
123  };
124 
125 
127  #ifndef AGX_PHYSICS_CONTACTPOINT_DATA_SET_OVERRIDE
128  #define AGX_PHYSICS_CONTACTPOINT_DATA_SET
129  class AGXPHYSICS_EXPORT ContactPointData : public agxData::EntityData
130  {
131  public:
132  ContactPointInstance operator[] (size_t index);
133 
134  public:
143  agxData::Array< agx::Vec3 > localForce;
145  agxData::Array< agx::Real > maxNormalForce;
149  agxData::Array< agx::UInt8 > faceFeature1;
150  agxData::Array< agx::UInt8 > faceFeature2;
154  agxData::Array< agx::Real > elasticRestLengthShape1;
155  agxData::Array< agx::Real > elasticRestLengthShape2;
156 
157  public:
158  typedef agx::Vec3 pointType;
159  typedef agx::Vec3f normalType;
160  typedef agx::Vec3f tangentUType;
161  typedef agx::Vec3f tangentVType;
162  typedef agx::Real depthType;
163  typedef agx::UInt8 stateType;
164  typedef agx::Vec3f velocityType;
165  typedef agx::Vec3 localForceType;
166  typedef agx::Vec4i8 indexSetType;
167  typedef agx::Real maxNormalForceType;
168  typedef agx::Bool enabledType;
169  typedef agx::UInt32 faceIndex1Type;
170  typedef agx::UInt32 faceIndex2Type;
171  typedef agx::UInt8 faceFeature1Type;
172  typedef agx::UInt8 faceFeature2Type;
173  typedef agx::Physics::Geometry::ShapePtr shape1Type;
174  typedef agx::Physics::Geometry::ShapePtr shape2Type;
175  typedef agx::Real areaType;
176  typedef agx::Real elasticRestLengthShape1Type;
177  typedef agx::Real elasticRestLengthShape2Type;
178 
179  public:
180  ContactPointData(agxData::EntityStorage* storage);
181  ContactPointData();
182 
183  protected:
184  virtual ~ContactPointData() {}
185  virtual void setNumElements(agx::Index numElements) override;
186 
187  private:
188  ContactPointData& operator= (const ContactPointData&) { return *this; }
189 
190  };
191  #endif
193 
194 
196  class AGXPHYSICS_EXPORT ContactPointSemantics : protected agxData::EntityPtr
197  {
198  public:
199 
200  // Automatic getters
201  agx::Vec3 const& getPoint() const;
202  agx::Vec3f const& getNormal() const;
203  agx::Vec3f const& getTangentU() const;
204  agx::Vec3f const& getTangentV() const;
205  agx::Real const& getDepth() const;
206  agx::UInt8 const& getState() const;
207  agx::Vec3f const& getVelocity() const;
208  agx::Vec3 const& getLocalForce() const;
209  agx::Vec4i8 const& getIndexSet() const;
210  agx::Real const& getMaxNormalForce() const;
211  agx::Bool const& getEnabled() const;
212  agx::UInt32 const& getFaceIndex1() const;
213  agx::UInt32 const& getFaceIndex2() const;
214  agx::UInt8 const& getFaceFeature1() const;
215  agx::UInt8 const& getFaceFeature2() const;
216  agx::Physics::Geometry::ShapePtr const& getShape1() const;
217  agx::Physics::Geometry::ShapePtr const& getShape2() const;
218  agx::Real const& getArea() const;
219  agx::Real const& getElasticRestLengthShape1() const;
220  agx::Real const& getElasticRestLengthShape2() const;
221 
222  // Semantics defined by explicit kernels
223 
224  // Automatic setters
225  void setPoint(agx::Vec3 const& value);
226  void setNormal(agx::Vec3f const& value);
227  void setTangentU(agx::Vec3f const& value);
228  void setTangentV(agx::Vec3f const& value);
229  void setDepth(agx::Real const& value);
230  void setState(agx::UInt8 const& value);
231  void setVelocity(agx::Vec3f const& value);
232  void setLocalForce(agx::Vec3 const& value);
233  void setIndexSet(agx::Vec4i8 const& value);
234  void setMaxNormalForce(agx::Real const& value);
235  void setEnabled(agx::Bool const& value);
236  void setFaceIndex1(agx::UInt32 const& value);
237  void setFaceIndex2(agx::UInt32 const& value);
238  void setFaceFeature1(agx::UInt8 const& value);
239  void setFaceFeature2(agx::UInt8 const& value);
240  void setShape1(agx::Physics::Geometry::ShapePtr const& value);
241  void setShape2(agx::Physics::Geometry::ShapePtr const& value);
242  void setArea(agx::Real const& value);
243  void setElasticRestLengthShape1(agx::Real const& value);
244  void setElasticRestLengthShape2(agx::Real const& value);
245 
246 
247  protected:
248  friend class ContactPointPtr;
249  friend class ContactPointInstance;
250  ContactPointSemantics();
251  };
253 
254 
255 
258  class CALLABLE ContactPointPtr : public agxData::EntityPtr
259  {
260  public:
262  typedef ContactPointData DataType;
263  typedef ContactPointInstance InstanceType;
264 
265  public:
270  AGXPHYSICS_EXPORT ContactPointPtr& operator= (const agxData::EntityPtr& ptr);
271  AGXPHYSICS_EXPORT ContactPointPtr& operator= (const agxData::EntityInstance& instance);
272  AGXPHYSICS_EXPORT ContactPointInstance instance();
273  AGXPHYSICS_EXPORT const ContactPointInstance instance() const;
274 
275  AGXPHYSICS_EXPORT ContactPointSemantics* operator->();
276  AGXPHYSICS_EXPORT const ContactPointSemantics* operator->() const;
277 
278  ContactPointData* getData();
279  const ContactPointData* getData() const;
280 
281 
283  AGXPHYSICS_EXPORT agx::Vec3& point();
285  AGXPHYSICS_EXPORT agx::Vec3 const& point() const;
286 
288  AGXPHYSICS_EXPORT agx::Vec3f& normal();
290  AGXPHYSICS_EXPORT agx::Vec3f const& normal() const;
291 
293  AGXPHYSICS_EXPORT agx::Vec3f& tangentU();
295  AGXPHYSICS_EXPORT agx::Vec3f const& tangentU() const;
296 
298  AGXPHYSICS_EXPORT agx::Vec3f& tangentV();
300  AGXPHYSICS_EXPORT agx::Vec3f const& tangentV() const;
301 
303  AGXPHYSICS_EXPORT agx::Real& depth();
305  AGXPHYSICS_EXPORT agx::Real const& depth() const;
306 
308  AGXPHYSICS_EXPORT agx::UInt8& state();
310  AGXPHYSICS_EXPORT agx::UInt8 const& state() const;
311 
313  AGXPHYSICS_EXPORT agx::Vec3f& velocity();
315  AGXPHYSICS_EXPORT agx::Vec3f const& velocity() const;
316 
318  AGXPHYSICS_EXPORT agx::Vec3& localForce();
320  AGXPHYSICS_EXPORT agx::Vec3 const& localForce() const;
321 
323  AGXPHYSICS_EXPORT agx::Vec4i8& indexSet();
325  AGXPHYSICS_EXPORT agx::Vec4i8 const& indexSet() const;
326 
328  AGXPHYSICS_EXPORT agx::Real& maxNormalForce();
330  AGXPHYSICS_EXPORT agx::Real const& maxNormalForce() const;
331 
333  AGXPHYSICS_EXPORT agx::Bool& enabled();
335  AGXPHYSICS_EXPORT agx::Bool const& enabled() const;
336 
338  AGXPHYSICS_EXPORT agx::UInt32& faceIndex1();
340  AGXPHYSICS_EXPORT agx::UInt32 const& faceIndex1() const;
341 
343  AGXPHYSICS_EXPORT agx::UInt32& faceIndex2();
345  AGXPHYSICS_EXPORT agx::UInt32 const& faceIndex2() const;
346 
348  AGXPHYSICS_EXPORT agx::UInt8& faceFeature1();
350  AGXPHYSICS_EXPORT agx::UInt8 const& faceFeature1() const;
351 
353  AGXPHYSICS_EXPORT agx::UInt8& faceFeature2();
355  AGXPHYSICS_EXPORT agx::UInt8 const& faceFeature2() const;
356 
361 
366 
370  AGXPHYSICS_EXPORT agx::Real const& area() const;
371 
373  AGXPHYSICS_EXPORT agx::Real& elasticRestLengthShape1();
375  AGXPHYSICS_EXPORT agx::Real const& elasticRestLengthShape1() const;
376 
378  AGXPHYSICS_EXPORT agx::Real& elasticRestLengthShape2();
380  AGXPHYSICS_EXPORT agx::Real const& elasticRestLengthShape2() const;
381 
382  };
383 
384 
386  class AGXPHYSICS_EXPORT ContactPointInstance : public agxData::EntityInstance
387  {
388  public:
389  ContactPointInstance();
390  ContactPointInstance(ContactPointData* data, agx::Index index);
391  ContactPointInstance(agxData::EntityStorage *storage, agx::Index index);
392  ContactPointInstance(const agxData::EntityInstance& other);
393  ContactPointInstance(const agxData::EntityPtr& ptr);
394 
395  ContactPointData* getData();
396  const ContactPointData* getData() const;
397 
398  public:
400  agx::Vec3& point();
402  agx::Vec3 const& point() const;
403 
405  agx::Vec3f& normal();
407  agx::Vec3f const& normal() const;
408 
410  agx::Vec3f& tangentU();
412  agx::Vec3f const& tangentU() const;
413 
415  agx::Vec3f& tangentV();
417  agx::Vec3f const& tangentV() const;
418 
420  agx::Real& depth();
422  agx::Real const& depth() const;
423 
425  agx::UInt8& state();
427  agx::UInt8 const& state() const;
428 
430  agx::Vec3f& velocity();
432  agx::Vec3f const& velocity() const;
433 
435  agx::Vec3& localForce();
437  agx::Vec3 const& localForce() const;
438 
440  agx::Vec4i8& indexSet();
442  agx::Vec4i8 const& indexSet() const;
443 
445  agx::Real& maxNormalForce();
447  agx::Real const& maxNormalForce() const;
448 
450  agx::Bool& enabled();
452  agx::Bool const& enabled() const;
453 
455  agx::UInt32& faceIndex1();
457  agx::UInt32 const& faceIndex1() const;
458 
460  agx::UInt32& faceIndex2();
462  agx::UInt32 const& faceIndex2() const;
463 
465  agx::UInt8& faceFeature1();
467  agx::UInt8 const& faceFeature1() const;
468 
470  agx::UInt8& faceFeature2();
472  agx::UInt8 const& faceFeature2() const;
473 
477  agx::Physics::Geometry::ShapePtr const& shape1() const;
478 
482  agx::Physics::Geometry::ShapePtr const& shape2() const;
483 
485  agx::Real& area();
487  agx::Real const& area() const;
488 
490  agx::Real& elasticRestLengthShape1();
492  agx::Real const& elasticRestLengthShape1() const;
493 
495  agx::Real& elasticRestLengthShape2();
497  agx::Real const& elasticRestLengthShape2() const;
498 
499  };
501 
502 
503 
506 
507 
508 
510  /* Implementation */
511  //-----------------------------------------------------------------------------------------------------
512  //-----------------------------------------------------------------------------------------------------
513  inline ContactPointInstance agx::Physics::ContactPointData::operator[] (size_t index) { return ContactPointInstance(this, (agx::Index)index); }
514  //-----------------------------------------------------------------------------------------------------
518  {
520  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
522  }
523 
525  {
526  agxAssertN(!instance || instance.isInstanceOf(ContactPointModel::instance()),
527  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
529  }
530 
532  {
535  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
537  return *this;
538  }
539 
541  {
543  agxAssertN(!instance || instance.isInstanceOf(ContactPointModel::instance()),
544  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
546  return *this;
547  }
548 
549  inline ContactPointInstance ContactPointPtr::instance() { return agxData::EntityPtr::instance(); }
550  inline const ContactPointInstance ContactPointPtr::instance() const { return agxData::EntityPtr::instance(); }
551  AGX_FORCE_INLINE ContactPointSemantics* ContactPointPtr::operator->() { return (ContactPointSemantics* )this; }
552  AGX_FORCE_INLINE const ContactPointSemantics* ContactPointPtr::operator->() const { return (const ContactPointSemantics* )this; }
553  AGX_FORCE_INLINE ContactPointData* ContactPointPtr::getData() { return static_cast<ContactPointData* >(agxData::EntityPtr::getData()); }
554  AGX_FORCE_INLINE const ContactPointData* ContactPointPtr::getData() const { return static_cast<const ContactPointData* >(agxData::EntityPtr::getData()); }
555 
556  AGX_FORCE_INLINE agx::Vec3& ContactPointPtr::point() { verifyIndex(); return getData()->point[calculateIndex()]; }
557  AGX_FORCE_INLINE agx::Vec3 const& ContactPointPtr::point() const { verifyIndex(); return getData()->point[calculateIndex()]; }
558 
559  AGX_FORCE_INLINE agx::Vec3f& ContactPointPtr::normal() { verifyIndex(); return getData()->normal[calculateIndex()]; }
560  AGX_FORCE_INLINE agx::Vec3f const& ContactPointPtr::normal() const { verifyIndex(); return getData()->normal[calculateIndex()]; }
561 
562  AGX_FORCE_INLINE agx::Vec3f& ContactPointPtr::tangentU() { verifyIndex(); return getData()->tangentU[calculateIndex()]; }
563  AGX_FORCE_INLINE agx::Vec3f const& ContactPointPtr::tangentU() const { verifyIndex(); return getData()->tangentU[calculateIndex()]; }
564 
565  AGX_FORCE_INLINE agx::Vec3f& ContactPointPtr::tangentV() { verifyIndex(); return getData()->tangentV[calculateIndex()]; }
566  AGX_FORCE_INLINE agx::Vec3f const& ContactPointPtr::tangentV() const { verifyIndex(); return getData()->tangentV[calculateIndex()]; }
567 
568  AGX_FORCE_INLINE agx::Real& ContactPointPtr::depth() { verifyIndex(); return getData()->depth[calculateIndex()]; }
569  AGX_FORCE_INLINE agx::Real const& ContactPointPtr::depth() const { verifyIndex(); return getData()->depth[calculateIndex()]; }
570 
571  AGX_FORCE_INLINE agx::UInt8& ContactPointPtr::state() { verifyIndex(); return getData()->state[calculateIndex()]; }
572  AGX_FORCE_INLINE agx::UInt8 const& ContactPointPtr::state() const { verifyIndex(); return getData()->state[calculateIndex()]; }
573 
574  AGX_FORCE_INLINE agx::Vec3f& ContactPointPtr::velocity() { verifyIndex(); return getData()->velocity[calculateIndex()]; }
575  AGX_FORCE_INLINE agx::Vec3f const& ContactPointPtr::velocity() const { verifyIndex(); return getData()->velocity[calculateIndex()]; }
576 
577  AGX_FORCE_INLINE agx::Vec3& ContactPointPtr::localForce() { verifyIndex(); return getData()->localForce[calculateIndex()]; }
578  AGX_FORCE_INLINE agx::Vec3 const& ContactPointPtr::localForce() const { verifyIndex(); return getData()->localForce[calculateIndex()]; }
579 
580  AGX_FORCE_INLINE agx::Vec4i8& ContactPointPtr::indexSet() { verifyIndex(); return getData()->indexSet[calculateIndex()]; }
581  AGX_FORCE_INLINE agx::Vec4i8 const& ContactPointPtr::indexSet() const { verifyIndex(); return getData()->indexSet[calculateIndex()]; }
582 
583  AGX_FORCE_INLINE agx::Real& ContactPointPtr::maxNormalForce() { verifyIndex(); return getData()->maxNormalForce[calculateIndex()]; }
584  AGX_FORCE_INLINE agx::Real const& ContactPointPtr::maxNormalForce() const { verifyIndex(); return getData()->maxNormalForce[calculateIndex()]; }
585 
586  AGX_FORCE_INLINE agx::Bool& ContactPointPtr::enabled() { verifyIndex(); return getData()->enabled[calculateIndex()]; }
587  AGX_FORCE_INLINE agx::Bool const& ContactPointPtr::enabled() const { verifyIndex(); return getData()->enabled[calculateIndex()]; }
588 
589  AGX_FORCE_INLINE agx::UInt32& ContactPointPtr::faceIndex1() { verifyIndex(); return getData()->faceIndex1[calculateIndex()]; }
590  AGX_FORCE_INLINE agx::UInt32 const& ContactPointPtr::faceIndex1() const { verifyIndex(); return getData()->faceIndex1[calculateIndex()]; }
591 
592  AGX_FORCE_INLINE agx::UInt32& ContactPointPtr::faceIndex2() { verifyIndex(); return getData()->faceIndex2[calculateIndex()]; }
593  AGX_FORCE_INLINE agx::UInt32 const& ContactPointPtr::faceIndex2() const { verifyIndex(); return getData()->faceIndex2[calculateIndex()]; }
594 
595  AGX_FORCE_INLINE agx::UInt8& ContactPointPtr::faceFeature1() { verifyIndex(); return getData()->faceFeature1[calculateIndex()]; }
596  AGX_FORCE_INLINE agx::UInt8 const& ContactPointPtr::faceFeature1() const { verifyIndex(); return getData()->faceFeature1[calculateIndex()]; }
597 
598  AGX_FORCE_INLINE agx::UInt8& ContactPointPtr::faceFeature2() { verifyIndex(); return getData()->faceFeature2[calculateIndex()]; }
599  AGX_FORCE_INLINE agx::UInt8 const& ContactPointPtr::faceFeature2() const { verifyIndex(); return getData()->faceFeature2[calculateIndex()]; }
600 
601  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr& ContactPointPtr::shape1() { verifyIndex(); return getData()->shape1[calculateIndex()]; }
602  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr const& ContactPointPtr::shape1() const { verifyIndex(); return getData()->shape1[calculateIndex()]; }
603 
604  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr& ContactPointPtr::shape2() { verifyIndex(); return getData()->shape2[calculateIndex()]; }
605  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr const& ContactPointPtr::shape2() const { verifyIndex(); return getData()->shape2[calculateIndex()]; }
606 
607  AGX_FORCE_INLINE agx::Real& ContactPointPtr::area() { verifyIndex(); return getData()->area[calculateIndex()]; }
608  AGX_FORCE_INLINE agx::Real const& ContactPointPtr::area() const { verifyIndex(); return getData()->area[calculateIndex()]; }
609 
610  AGX_FORCE_INLINE agx::Real& ContactPointPtr::elasticRestLengthShape1() { verifyIndex(); return getData()->elasticRestLengthShape1[calculateIndex()]; }
611  AGX_FORCE_INLINE agx::Real const& ContactPointPtr::elasticRestLengthShape1() const { verifyIndex(); return getData()->elasticRestLengthShape1[calculateIndex()]; }
612 
613  AGX_FORCE_INLINE agx::Real& ContactPointPtr::elasticRestLengthShape2() { verifyIndex(); return getData()->elasticRestLengthShape2[calculateIndex()]; }
614  AGX_FORCE_INLINE agx::Real const& ContactPointPtr::elasticRestLengthShape2() const { verifyIndex(); return getData()->elasticRestLengthShape2[calculateIndex()]; }
615 
616  //-----------------------------------------------------------------------------------------------------
617  AGX_FORCE_INLINE ContactPointInstance::ContactPointInstance() {}
618  AGX_FORCE_INLINE ContactPointInstance::ContactPointInstance(ContactPointData* data, agx::Index index) : agxData::EntityInstance(data, index) {}
619  AGX_FORCE_INLINE ContactPointInstance::ContactPointInstance(agxData::EntityStorage* storage, agx::Index index) : agxData::EntityInstance(storage, index) {}
620  AGX_FORCE_INLINE ContactPointInstance::ContactPointInstance(const agxData::EntityInstance& other) : agxData::EntityInstance(other)
621  {
623  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
625  }
626 
627  AGX_FORCE_INLINE ContactPointInstance::ContactPointInstance(const agxData::EntityPtr& ptr) : agxData::EntityInstance(ptr)
628  {
630  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
632  }
633 
634 
635  AGX_FORCE_INLINE ContactPointData* ContactPointInstance::getData() { return static_cast<ContactPointData* >(agxData::EntityInstance::getData()); }
636  AGX_FORCE_INLINE const ContactPointData* ContactPointInstance::getData() const { return static_cast<const ContactPointData* >(agxData::EntityInstance::getData()); }
637 
638  AGX_FORCE_INLINE agx::Vec3& ContactPointInstance::point() { verifyIndex(); return getData()->point[getIndex()]; }
639  AGX_FORCE_INLINE agx::Vec3 const& ContactPointInstance::point() const { verifyIndex(); return getData()->point[getIndex()]; }
640 
641  AGX_FORCE_INLINE agx::Vec3f& ContactPointInstance::normal() { verifyIndex(); return getData()->normal[getIndex()]; }
642  AGX_FORCE_INLINE agx::Vec3f const& ContactPointInstance::normal() const { verifyIndex(); return getData()->normal[getIndex()]; }
643 
644  AGX_FORCE_INLINE agx::Vec3f& ContactPointInstance::tangentU() { verifyIndex(); return getData()->tangentU[getIndex()]; }
645  AGX_FORCE_INLINE agx::Vec3f const& ContactPointInstance::tangentU() const { verifyIndex(); return getData()->tangentU[getIndex()]; }
646 
647  AGX_FORCE_INLINE agx::Vec3f& ContactPointInstance::tangentV() { verifyIndex(); return getData()->tangentV[getIndex()]; }
648  AGX_FORCE_INLINE agx::Vec3f const& ContactPointInstance::tangentV() const { verifyIndex(); return getData()->tangentV[getIndex()]; }
649 
650  AGX_FORCE_INLINE agx::Real& ContactPointInstance::depth() { verifyIndex(); return getData()->depth[getIndex()]; }
651  AGX_FORCE_INLINE agx::Real const& ContactPointInstance::depth() const { verifyIndex(); return getData()->depth[getIndex()]; }
652 
653  AGX_FORCE_INLINE agx::UInt8& ContactPointInstance::state() { verifyIndex(); return getData()->state[getIndex()]; }
654  AGX_FORCE_INLINE agx::UInt8 const& ContactPointInstance::state() const { verifyIndex(); return getData()->state[getIndex()]; }
655 
656  AGX_FORCE_INLINE agx::Vec3f& ContactPointInstance::velocity() { verifyIndex(); return getData()->velocity[getIndex()]; }
657  AGX_FORCE_INLINE agx::Vec3f const& ContactPointInstance::velocity() const { verifyIndex(); return getData()->velocity[getIndex()]; }
658 
659  AGX_FORCE_INLINE agx::Vec3& ContactPointInstance::localForce() { verifyIndex(); return getData()->localForce[getIndex()]; }
660  AGX_FORCE_INLINE agx::Vec3 const& ContactPointInstance::localForce() const { verifyIndex(); return getData()->localForce[getIndex()]; }
661 
662  AGX_FORCE_INLINE agx::Vec4i8& ContactPointInstance::indexSet() { verifyIndex(); return getData()->indexSet[getIndex()]; }
663  AGX_FORCE_INLINE agx::Vec4i8 const& ContactPointInstance::indexSet() const { verifyIndex(); return getData()->indexSet[getIndex()]; }
664 
665  AGX_FORCE_INLINE agx::Real& ContactPointInstance::maxNormalForce() { verifyIndex(); return getData()->maxNormalForce[getIndex()]; }
666  AGX_FORCE_INLINE agx::Real const& ContactPointInstance::maxNormalForce() const { verifyIndex(); return getData()->maxNormalForce[getIndex()]; }
667 
668  AGX_FORCE_INLINE agx::Bool& ContactPointInstance::enabled() { verifyIndex(); return getData()->enabled[getIndex()]; }
669  AGX_FORCE_INLINE agx::Bool const& ContactPointInstance::enabled() const { verifyIndex(); return getData()->enabled[getIndex()]; }
670 
671  AGX_FORCE_INLINE agx::UInt32& ContactPointInstance::faceIndex1() { verifyIndex(); return getData()->faceIndex1[getIndex()]; }
672  AGX_FORCE_INLINE agx::UInt32 const& ContactPointInstance::faceIndex1() const { verifyIndex(); return getData()->faceIndex1[getIndex()]; }
673 
674  AGX_FORCE_INLINE agx::UInt32& ContactPointInstance::faceIndex2() { verifyIndex(); return getData()->faceIndex2[getIndex()]; }
675  AGX_FORCE_INLINE agx::UInt32 const& ContactPointInstance::faceIndex2() const { verifyIndex(); return getData()->faceIndex2[getIndex()]; }
676 
677  AGX_FORCE_INLINE agx::UInt8& ContactPointInstance::faceFeature1() { verifyIndex(); return getData()->faceFeature1[getIndex()]; }
678  AGX_FORCE_INLINE agx::UInt8 const& ContactPointInstance::faceFeature1() const { verifyIndex(); return getData()->faceFeature1[getIndex()]; }
679 
680  AGX_FORCE_INLINE agx::UInt8& ContactPointInstance::faceFeature2() { verifyIndex(); return getData()->faceFeature2[getIndex()]; }
681  AGX_FORCE_INLINE agx::UInt8 const& ContactPointInstance::faceFeature2() const { verifyIndex(); return getData()->faceFeature2[getIndex()]; }
682 
683  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr& ContactPointInstance::shape1() { verifyIndex(); return getData()->shape1[getIndex()]; }
684  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr const& ContactPointInstance::shape1() const { verifyIndex(); return getData()->shape1[getIndex()]; }
685 
686  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr& ContactPointInstance::shape2() { verifyIndex(); return getData()->shape2[getIndex()]; }
687  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr const& ContactPointInstance::shape2() const { verifyIndex(); return getData()->shape2[getIndex()]; }
688 
689  AGX_FORCE_INLINE agx::Real& ContactPointInstance::area() { verifyIndex(); return getData()->area[getIndex()]; }
690  AGX_FORCE_INLINE agx::Real const& ContactPointInstance::area() const { verifyIndex(); return getData()->area[getIndex()]; }
691 
692  AGX_FORCE_INLINE agx::Real& ContactPointInstance::elasticRestLengthShape1() { verifyIndex(); return getData()->elasticRestLengthShape1[getIndex()]; }
693  AGX_FORCE_INLINE agx::Real const& ContactPointInstance::elasticRestLengthShape1() const { verifyIndex(); return getData()->elasticRestLengthShape1[getIndex()]; }
694 
695  AGX_FORCE_INLINE agx::Real& ContactPointInstance::elasticRestLengthShape2() { verifyIndex(); return getData()->elasticRestLengthShape2[getIndex()]; }
696  AGX_FORCE_INLINE agx::Real const& ContactPointInstance::elasticRestLengthShape2() const { verifyIndex(); return getData()->elasticRestLengthShape2[getIndex()]; }
697 
698  //-----------------------------------------------------------------------------------------------------
699  AGX_FORCE_INLINE ContactPointSemantics::ContactPointSemantics() {}
700  //-----------------------------------------------------------------------------------------------------
702  }
703 }
704 
705 AGX_TYPE_BINDING(agx::Physics::ContactPointPtr, "Physics.ContactPointPtr")
706 AGX_TYPE_BINDING(agx::Physics::ContactPointInstance, "Physics.ContactPointInstance")
707 
708 #ifdef _MSC_VER
709 # pragma warning(pop)
710 #endif
711 
712 #undef AGX_ENTITY_WRAPPER
713 #undef AGX_ENTITY_NAMESPACE
714 #endif
715 
static agxData::ScalarAttributeT< agx::Vec3 > * localForceAttribute
static agxData::ScalarAttributeT< agx::Physics::Geometry::ShapePtr > * shape2Attribute
agxData::EntityData * getData()
Pointer to a entity instance of type Physics.ContactPoint.
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
bool Bool
Definition: Integer.h:48
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
static agxData::ScalarAttributeT< agx::UInt32 > * faceIndex1Attribute
#define agxAssertN(expr, format,...)
Definition: debug.h:145
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
agxData::EntityData * getData()
agx::String fullPath() const
AGXPHYSICS_EXPORT agx::Vec3f & normal()
#define AGX_TYPE_BINDING(_Type, _Name)
Definition: Type.h:179
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
Definition: Object.h:363
static agxData::ScalarAttributeT< agx::Bool > * enabledAttribute
static agxData::ScalarAttributeT< agx::Real > * maxNormalForceAttribute
uint8_t UInt8
Definition: Integer.h:38
#define AGXPHYSICS_EXPORT
Pointer to a entity instance of type Physics.Geometry.Shape.
Definition: ShapeEntity.h:195
Entity instance provides access to a single instance in an EntityStorage.
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:51
AGXPHYSICS_EXPORT agx::UInt8 & faceFeature2()
The face feature of shape 2 in contact (e.g. voronoi region on triangle for trimesh).
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
AGXPHYSICS_EXPORT agx::Vec3f & tangentV()
bool isInstanceOf(agxData::EntityModel *model) const
AGXPHYSICS_EXPORT agx::Real & elasticRestLengthShape1()
#define AGX_FORCE_INLINE
Definition: Object.h:59
Abstract description of the data attributes for the Physics.ContactPoint entity.
AGXPHYSICS_EXPORT agx::Vec3f & tangentU()
ContactPointInstance InstanceType
AGXPHYSICS_EXPORT agx::Physics::Geometry::ShapePtr & shape2()
Shape number 2 in contact.
AGXPHYSICS_EXPORT agx::Vec3f & velocity()
static agxData::ScalarAttributeT< agx::Real > * areaAttribute
Type-specific Array used for fast access into the data held by a Buffer.
Definition: agxData.h:30
static agxData::ScalarAttributeT< agx::Vec3 > * pointAttribute
AGXPHYSICS_EXPORT agx::Vec4i8 & indexSet()
static agxData::ScalarAttributeT< agx::UInt8 > * stateAttribute
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
EntityPtr & operator=(const EntityPtr &other)=default
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
static agxData::ScalarAttributeT< agx::Vec3f > * normalAttribute
static agxData::ScalarAttributeT< agx::Vec3f > * tangentUAttribute
ContactPointData * getData()
Contains classes for low level data storage for AGX.
Definition: Container.h:23
UInt32 Index
Definition: Integer.h:52
static agxData::ScalarAttributeT< agx::Vec3f > * velocityAttribute
AGXPHYSICS_EXPORT agx::UInt8 & state()
Contact point state, such as impacting, resting etc.
AGXPHYSICS_EXPORT agx::Real & maxNormalForce()
AGXPHYSICS_EXPORT ContactPointSemantics * operator->()
AGXPHYSICS_EXPORT agx::Vec3 & localForce()
static agxData::ScalarAttributeT< agx::Real > * elasticRestLengthShape1Attribute
static agxData::ScalarAttributeT< agx::Real > * elasticRestLengthShape2Attribute
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Definition: EntityModel.h:63
AGXPHYSICS_EXPORT agx::Vec3 & point()
#define CALLABLE
Definition: Object.h:73
static ContactPointModel * instance()
AGXPHYSICS_EXPORT ContactPointPtr()
static agxData::ScalarAttributeT< agx::UInt8 > * faceFeature2Attribute
bool isInstanceOf(agxData::EntityModel *model) const
static agxData::ScalarAttributeT< agx::UInt32 > * faceIndex2Attribute
AGXPHYSICS_EXPORT agx::Real & depth()
AGXPHYSICS_EXPORT agx::UInt8 & faceFeature1()
The face feature of shape 1 in contact (e.g. voronoi region on triangle for trimesh).
AGXPHYSICS_EXPORT agx::Bool & enabled()
AGXPHYSICS_EXPORT agx::Physics::Geometry::ShapePtr & shape1()
Shape number 1 in contact.
double Real
Definition: Real.h:42
AGXPHYSICS_EXPORT ContactPointInstance instance()
AGXPHYSICS_EXPORT agx::Real & area()
static agxData::ScalarAttributeT< agx::Physics::Geometry::ShapePtr > * shape1Attribute
AGXPHYSICS_EXPORT agx::UInt32 & faceIndex2()
The face index of shape 2 in contact (e.g. index of triangle for trimesh).
static agxData::ScalarAttributeT< agx::UInt8 > * faceFeature1Attribute
static agxData::ScalarAttributeT< agx::Vec3f > * tangentVAttribute
AGXPHYSICS_EXPORT agx::Real & elasticRestLengthShape2()
uint32_t UInt32
Definition: Integer.h:40
AGXPHYSICS_EXPORT agx::UInt32 & faceIndex1()
The face index of shape 1 in contact (e.g. index of triangle for trimesh).
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
static agxData::ScalarAttributeT< agx::Real > * depthAttribute
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
AGXPHYSICS_EXPORT ContactPointPtr & operator=(const agxData::EntityPtr &ptr)
static agxData::ScalarAttributeT< agx::Vec4i8 > * indexSetAttribute