AGX Dynamics  2.35.0.1
GeometryEntity.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_GEOMETRY_H_PLUGIN
22 #define GENERATED_AGX_PHYSICS_GEOMETRY_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/ReferencedEntity.h>
48 #include <agx/Name.h>
51 #include <agx/AffineMatrix4x4.h>
53 #include <agx/Real.h>
54 #include <agx/Vec3.h>
55 #include <agx/Integer.h>
59 namespace agxCollide { class Geometry; }
60 
61 namespace agx { namespace Physics { namespace Geometry { class ShapePtr; }}}
62 namespace agx { namespace Physics { class CollisionGroupSetPtr; }}
63 namespace agx { namespace Physics { class RigidBodyPtr; }}
64 namespace agx { namespace Physics { class MaterialPtr; }}
65 namespace agx { namespace Physics { class GeometryPtr; }}
66 
67 namespace agx
68 {
69  namespace Physics
70  {
71 
72  class GeometryModel;
73  class GeometryData;
74  class GeometryPtr;
75  class GeometryInstance;
76  class GeometrySemantics;
77 
78 
80 
85  {
86  public:
87  typedef GeometryPtr PtrT;
88 
89  GeometryModel(const agx::String& name = "Geometry");
90 
93 
96 
99 
101  virtual void shutdownCleanup() override;
102 
103 
104 
105  /* Attributes */
126 
127  protected:
128  virtual ~GeometryModel();
129  virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
130  virtual void configure(agx::TiXmlElement* eEntity) override;
131  virtual void initAttributeAccessors() override;
132  virtual void construct(agxData::EntityPtr instance) override;
134  };
135 
136 
138  #ifndef AGX_PHYSICS_GEOMETRY_DATA_SET_OVERRIDE
139  #define AGX_PHYSICS_GEOMETRY_DATA_SET
140  class AGXPHYSICS_EXPORT GeometryData : public agx::ReferencedData
141  {
142  public:
143  GeometryInstance operator[] (size_t index);
144 
145  public:
153  agxData::Array< agx::Real > boundingRadius;
154  agxData::Array< agx::Vec3 > localBoundCenter;
159  agxData::Array< agx::UInt > orientedBoundId;
161  agxData::Array< agx::UInt32 > sweepAndPruneIndex;
163  agxData::Array< agx::Vec3f > surfaceVelocity;
167 
168  public:
169  typedef agx::Name nameType;
170  typedef agxCollide::GeometryState stateType;
171  typedef agx::Physics::Geometry::ShapePtr shapeType;
172  typedef agx::AffineMatrix4x4 transformType;
173  typedef agx::AffineMatrix4x4 localTransformType;
174  typedef agxCollide::BoundingAABB boundingAABBType;
175  typedef agx::Real boundingRadiusType;
176  typedef agx::Vec3 localBoundCenterType;
177  typedef agx::UInt8 tierType;
178  typedef agx::UInt32 cellIndexType;
179  typedef agx::UInt16 cellSlotType;
180  typedef agx::UInt32 oldCellType;
181  typedef agx::UInt orientedBoundIdType;
182  typedef agx::Physics::CollisionGroupSetPtr collisionGroupSetType;
183  typedef agx::UInt32 sweepAndPruneIndexType;
184  typedef agx::Physics::RigidBodyPtr bodyType;
185  typedef agx::Vec3f surfaceVelocityType;
186  typedef agx::Physics::MaterialPtr materialType;
187  typedef agxCollide::Geometry* modelType;
188  typedef agx::Physics::GeometryPtr nextType;
189 
190  public:
191  GeometryData(agxData::EntityStorage* storage);
192  GeometryData();
193 
194  protected:
195  virtual ~GeometryData() {}
196  virtual void setNumElements(agx::Index numElements) override;
197 
198  private:
199  GeometryData& operator= (const GeometryData&) { return *this; }
200 
201  };
202  #endif
204 
205 
207  class AGXPHYSICS_EXPORT GeometrySemantics : public agx::ReferencedSemantics
208  {
209  public:
210 
211  // Automatic getters
212  agx::Name const& getName() const;
213  agxCollide::GeometryState const& getState() const;
214  agx::Physics::Geometry::ShapePtr const& getShape() const;
215  agx::AffineMatrix4x4 const& getTransform() const;
216  agx::AffineMatrix4x4 const& getLocalTransform() const;
217  agxCollide::BoundingAABB const& getBoundingAABB() const;
218  agx::Real const& getBoundingRadius() const;
219  agx::Vec3 const& getLocalBoundCenter() const;
220  agx::UInt8 const& getTier() const;
221  agx::UInt32 const& getCellIndex() const;
222  agx::UInt16 const& getCellSlot() const;
223  agx::UInt32 const& getOldCell() const;
224  agx::UInt const& getOrientedBoundId() const;
225  agx::Physics::CollisionGroupSetPtr const& getCollisionGroupSet() const;
226  agx::UInt32 const& getSweepAndPruneIndex() const;
227  agx::Physics::RigidBodyPtr const& getBody() const;
228  agx::Vec3f const& getSurfaceVelocity() const;
229  agx::Physics::MaterialPtr const& getMaterial() const;
230  agxCollide::Geometry* const& getModel() const;
231  agx::Physics::GeometryPtr const& getNext() const;
232 
233  // Semantics defined by explicit kernels
234 
235  // Automatic setters
236  void setName(agx::Name const& value);
237  void setState(agxCollide::GeometryState const& value);
238  void setShape(agx::Physics::Geometry::ShapePtr const& value);
239  void setTransform(agx::AffineMatrix4x4 const& value);
240  void setLocalTransform(agx::AffineMatrix4x4 const& value);
241  void setBoundingAABB(agxCollide::BoundingAABB const& value);
242  void setBoundingRadius(agx::Real const& value);
243  void setLocalBoundCenter(agx::Vec3 const& value);
244  void setTier(agx::UInt8 const& value);
245  void setCellIndex(agx::UInt32 const& value);
246  void setCellSlot(agx::UInt16 const& value);
247  void setOldCell(agx::UInt32 const& value);
248  void setOrientedBoundId(agx::UInt const& value);
249  void setCollisionGroupSet(agx::Physics::CollisionGroupSetPtr const& value);
250  void setSweepAndPruneIndex(agx::UInt32 const& value);
251  void setBody(agx::Physics::RigidBodyPtr const& value);
252  void setSurfaceVelocity(agx::Vec3f const& value);
253  void setMaterial(agx::Physics::MaterialPtr const& value);
254  void setModel(agxCollide::Geometry* const& value);
255  void setNext(agx::Physics::GeometryPtr const& value);
256 
257 
258  protected:
259  friend class GeometryPtr;
260  friend class GeometryInstance;
261  GeometrySemantics();
262  };
264 
265 
266 
270  {
271  public:
273  typedef GeometryData DataType;
274  typedef GeometryInstance InstanceType;
275 
276  public:
283  AGXPHYSICS_EXPORT GeometryInstance instance();
284  AGXPHYSICS_EXPORT const GeometryInstance instance() const;
285 
286  AGXPHYSICS_EXPORT GeometrySemantics* operator->();
287  AGXPHYSICS_EXPORT const GeometrySemantics* operator->() const;
288 
289  GeometryData* getData();
290  const GeometryData* getData() const;
291 
292 
297 
299  AGXPHYSICS_EXPORT agxCollide::GeometryState& state();
301  AGXPHYSICS_EXPORT agxCollide::GeometryState const& state() const;
302 
307 
312 
317 
322 
327 
332 
337 
342 
347 
352 
357 
362 
367 
372 
377 
382 
387 
392 
394  // Only used by tolua!
395  #ifdef AGX_GENERATED_TOLUA_WRAPPER
396  inline agx::Name const& getName() const { return (*this)->getName(); }
397  inline agxCollide::GeometryState const& getState() const { return (*this)->getState(); }
398  inline agx::Physics::Geometry::ShapePtr const& getShape() const { return (*this)->getShape(); }
399  inline agx::AffineMatrix4x4 const& getTransform() const { return (*this)->getTransform(); }
400  inline agx::AffineMatrix4x4 const& getLocalTransform() const { return (*this)->getLocalTransform(); }
401  inline agxCollide::BoundingAABB const& getBoundingAABB() const { return (*this)->getBoundingAABB(); }
402  inline agx::Real const& getBoundingRadius() const { return (*this)->getBoundingRadius(); }
403  inline agx::Vec3 const& getLocalBoundCenter() const { return (*this)->getLocalBoundCenter(); }
404  inline agx::UInt8 const& getTier() const { return (*this)->getTier(); }
405  inline agx::UInt32 const& getCellIndex() const { return (*this)->getCellIndex(); }
406  inline agx::UInt16 const& getCellSlot() const { return (*this)->getCellSlot(); }
407  inline agx::UInt32 const& getOldCell() const { return (*this)->getOldCell(); }
408  inline agx::UInt const& getOrientedBoundId() const { return (*this)->getOrientedBoundId(); }
409  inline agx::Physics::CollisionGroupSetPtr const& getCollisionGroupSet() const { return (*this)->getCollisionGroupSet(); }
410  inline agx::UInt32 const& getSweepAndPruneIndex() const { return (*this)->getSweepAndPruneIndex(); }
411  inline agx::Physics::RigidBodyPtr const& getBody() const { return (*this)->getBody(); }
412  inline agx::Vec3f const& getSurfaceVelocity() const { return (*this)->getSurfaceVelocity(); }
413  inline agx::Physics::MaterialPtr const& getMaterial() const { return (*this)->getMaterial(); }
414  inline agxCollide::Geometry* const& getModel() const { return (*this)->getModel(); }
415  inline agx::Physics::GeometryPtr const& getNext() const { return (*this)->getNext(); }
416 
417 
418  inline void setName(agx::Name const& value) { (*this)->setName(value); }
419  inline void setState(agxCollide::GeometryState const& value) { (*this)->setState(value); }
420  inline void setShape(agx::Physics::Geometry::ShapePtr const& value) { (*this)->setShape(value); }
421  inline void setTransform(agx::AffineMatrix4x4 const& value) { (*this)->setTransform(value); }
422  inline void setLocalTransform(agx::AffineMatrix4x4 const& value) { (*this)->setLocalTransform(value); }
423  inline void setBoundingAABB(agxCollide::BoundingAABB const& value) { (*this)->setBoundingAABB(value); }
424  inline void setBoundingRadius(agx::Real const& value) { (*this)->setBoundingRadius(value); }
425  inline void setLocalBoundCenter(agx::Vec3 const& value) { (*this)->setLocalBoundCenter(value); }
426  inline void setTier(agx::UInt8 const& value) { (*this)->setTier(value); }
427  inline void setCellIndex(agx::UInt32 const& value) { (*this)->setCellIndex(value); }
428  inline void setCellSlot(agx::UInt16 const& value) { (*this)->setCellSlot(value); }
429  inline void setOldCell(agx::UInt32 const& value) { (*this)->setOldCell(value); }
430  inline void setOrientedBoundId(agx::UInt const& value) { (*this)->setOrientedBoundId(value); }
431  inline void setCollisionGroupSet(agx::Physics::CollisionGroupSetPtr const& value) { (*this)->setCollisionGroupSet(value); }
432  inline void setSweepAndPruneIndex(agx::UInt32 const& value) { (*this)->setSweepAndPruneIndex(value); }
433  inline void setBody(agx::Physics::RigidBodyPtr const& value) { (*this)->setBody(value); }
434  inline void setSurfaceVelocity(agx::Vec3f const& value) { (*this)->setSurfaceVelocity(value); }
435  inline void setMaterial(agx::Physics::MaterialPtr const& value) { (*this)->setMaterial(value); }
436  inline void setModel(agxCollide::Geometry* const& value) { (*this)->setModel(value); }
437  inline void setNext(agx::Physics::GeometryPtr const& value) { (*this)->setNext(value); }
438  #endif
440 
441  };
442 
443  // Entity is Referenced
445 
446 
448  class AGXPHYSICS_EXPORT GeometryInstance : public agx::ReferencedInstance
449  {
450  public:
451  GeometryInstance();
452  GeometryInstance(GeometryData* data, agx::Index index);
453  GeometryInstance(agxData::EntityStorage *storage, agx::Index index);
454  GeometryInstance(const agxData::EntityInstance& other);
455  GeometryInstance(const agxData::EntityPtr& ptr);
456 
457  GeometryData* getData();
458  const GeometryData* getData() const;
459 
460  public:
462  agx::Name& name();
464  agx::Name const& name() const;
465 
467  agxCollide::GeometryState& state();
469  agxCollide::GeometryState const& state() const;
470 
474  agx::Physics::Geometry::ShapePtr const& shape() const;
475 
479  agx::AffineMatrix4x4 const& transform() const;
480 
482  agx::AffineMatrix4x4& localTransform();
484  agx::AffineMatrix4x4 const& localTransform() const;
485 
487  agxCollide::BoundingAABB& boundingAABB();
489  agxCollide::BoundingAABB const& boundingAABB() const;
490 
492  agx::Real& boundingRadius();
494  agx::Real const& boundingRadius() const;
495 
497  agx::Vec3& localBoundCenter();
499  agx::Vec3 const& localBoundCenter() const;
500 
502  agx::UInt8& tier();
504  agx::UInt8 const& tier() const;
505 
507  agx::UInt32& cellIndex();
509  agx::UInt32 const& cellIndex() const;
510 
512  agx::UInt16& cellSlot();
514  agx::UInt16 const& cellSlot() const;
515 
517  agx::UInt32& oldCell();
519  agx::UInt32 const& oldCell() const;
520 
522  agx::UInt& orientedBoundId();
524  agx::UInt const& orientedBoundId() const;
525 
527  agx::Physics::CollisionGroupSetPtr& collisionGroupSet();
529  agx::Physics::CollisionGroupSetPtr const& collisionGroupSet() const;
530 
532  agx::UInt32& sweepAndPruneIndex();
534  agx::UInt32 const& sweepAndPruneIndex() const;
535 
539  agx::Physics::RigidBodyPtr const& body() const;
540 
542  agx::Vec3f& surfaceVelocity();
544  agx::Vec3f const& surfaceVelocity() const;
545 
547  agx::Physics::MaterialPtr& material();
549  agx::Physics::MaterialPtr const& material() const;
550 
552  agxCollide::Geometry*& model();
554  agxCollide::Geometry* const& model() const;
555 
559  agx::Physics::GeometryPtr const& next() const;
560 
561  };
563 
564 
565 
568 
569 
570 
572  /* Implementation */
573  //-----------------------------------------------------------------------------------------------------
574  //-----------------------------------------------------------------------------------------------------
575  inline GeometryInstance agx::Physics::GeometryData::operator[] (size_t index) { return GeometryInstance(this, (agx::Index)index); }
576  //-----------------------------------------------------------------------------------------------------
578  AGX_FORCE_INLINE GeometryPtr::GeometryPtr(agxData::EntityStorage* storage, agx::Index id) : agx::ReferencedPtr(storage, id) {}
579  AGX_FORCE_INLINE GeometryPtr::GeometryPtr(const agxData::EntityPtr& ptr) : agx::ReferencedPtr(ptr)
580  {
582  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
583  EntityPtr::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
584  }
585 
586  AGX_FORCE_INLINE GeometryPtr::GeometryPtr(const agxData::EntityInstance& instance) : agx::ReferencedPtr(instance)
587  {
588  agxAssertN(!instance || instance.isInstanceOf(GeometryModel::instance()),
589  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
590  EntityPtr::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
591  }
592 
593  AGX_FORCE_INLINE GeometryPtr& GeometryPtr::operator= (const agxData::EntityPtr& ptr)
594  {
596  agxAssertN(!ptr || ptr.isInstanceOf(GeometryModel::instance()),
597  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
598  EntityPtr::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
599  return *this;
600  }
601 
602  AGX_FORCE_INLINE GeometryPtr& GeometryPtr::operator= (const agxData::EntityInstance& instance)
603  {
605  agxAssertN(!instance || instance.isInstanceOf(GeometryModel::instance()),
606  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
607  EntityPtr::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
608  return *this;
609  }
610 
611  inline GeometryInstance GeometryPtr::instance() { return agxData::EntityPtr::instance(); }
612  inline const GeometryInstance GeometryPtr::instance() const { return agxData::EntityPtr::instance(); }
613  AGX_FORCE_INLINE GeometrySemantics* GeometryPtr::operator->() { return (GeometrySemantics* )this; }
614  AGX_FORCE_INLINE const GeometrySemantics* GeometryPtr::operator->() const { return (const GeometrySemantics* )this; }
615  AGX_FORCE_INLINE GeometryData* GeometryPtr::getData() { return static_cast<GeometryData* >(agxData::EntityPtr::getData()); }
616  AGX_FORCE_INLINE const GeometryData* GeometryPtr::getData() const { return static_cast<const GeometryData* >(agxData::EntityPtr::getData()); }
617 
618  AGX_FORCE_INLINE agx::Name& GeometryPtr::name() { verifyIndex(); return getData()->name[calculateIndex()]; }
619  AGX_FORCE_INLINE agx::Name const& GeometryPtr::name() const { verifyIndex(); return getData()->name[calculateIndex()]; }
620 
621  AGX_FORCE_INLINE agxCollide::GeometryState& GeometryPtr::state() { verifyIndex(); return getData()->state[calculateIndex()]; }
622  AGX_FORCE_INLINE agxCollide::GeometryState const& GeometryPtr::state() const { verifyIndex(); return getData()->state[calculateIndex()]; }
623 
624  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr& GeometryPtr::shape() { verifyIndex(); return getData()->shape[calculateIndex()]; }
625  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr const& GeometryPtr::shape() const { verifyIndex(); return getData()->shape[calculateIndex()]; }
626 
627  AGX_FORCE_INLINE agx::AffineMatrix4x4& GeometryPtr::transform() { verifyIndex(); return getData()->transform[calculateIndex()]; }
628  AGX_FORCE_INLINE agx::AffineMatrix4x4 const& GeometryPtr::transform() const { verifyIndex(); return getData()->transform[calculateIndex()]; }
629 
630  AGX_FORCE_INLINE agx::AffineMatrix4x4& GeometryPtr::localTransform() { verifyIndex(); return getData()->localTransform[calculateIndex()]; }
631  AGX_FORCE_INLINE agx::AffineMatrix4x4 const& GeometryPtr::localTransform() const { verifyIndex(); return getData()->localTransform[calculateIndex()]; }
632 
633  AGX_FORCE_INLINE agxCollide::BoundingAABB& GeometryPtr::boundingAABB() { verifyIndex(); return getData()->boundingAABB[calculateIndex()]; }
634  AGX_FORCE_INLINE agxCollide::BoundingAABB const& GeometryPtr::boundingAABB() const { verifyIndex(); return getData()->boundingAABB[calculateIndex()]; }
635 
636  AGX_FORCE_INLINE agx::Real& GeometryPtr::boundingRadius() { verifyIndex(); return getData()->boundingRadius[calculateIndex()]; }
637  AGX_FORCE_INLINE agx::Real const& GeometryPtr::boundingRadius() const { verifyIndex(); return getData()->boundingRadius[calculateIndex()]; }
638 
639  AGX_FORCE_INLINE agx::Vec3& GeometryPtr::localBoundCenter() { verifyIndex(); return getData()->localBoundCenter[calculateIndex()]; }
640  AGX_FORCE_INLINE agx::Vec3 const& GeometryPtr::localBoundCenter() const { verifyIndex(); return getData()->localBoundCenter[calculateIndex()]; }
641 
642  AGX_FORCE_INLINE agx::UInt8& GeometryPtr::tier() { verifyIndex(); return getData()->tier[calculateIndex()]; }
643  AGX_FORCE_INLINE agx::UInt8 const& GeometryPtr::tier() const { verifyIndex(); return getData()->tier[calculateIndex()]; }
644 
645  AGX_FORCE_INLINE agx::UInt32& GeometryPtr::cellIndex() { verifyIndex(); return getData()->cellIndex[calculateIndex()]; }
646  AGX_FORCE_INLINE agx::UInt32 const& GeometryPtr::cellIndex() const { verifyIndex(); return getData()->cellIndex[calculateIndex()]; }
647 
648  AGX_FORCE_INLINE agx::UInt16& GeometryPtr::cellSlot() { verifyIndex(); return getData()->cellSlot[calculateIndex()]; }
649  AGX_FORCE_INLINE agx::UInt16 const& GeometryPtr::cellSlot() const { verifyIndex(); return getData()->cellSlot[calculateIndex()]; }
650 
651  AGX_FORCE_INLINE agx::UInt32& GeometryPtr::oldCell() { verifyIndex(); return getData()->oldCell[calculateIndex()]; }
652  AGX_FORCE_INLINE agx::UInt32 const& GeometryPtr::oldCell() const { verifyIndex(); return getData()->oldCell[calculateIndex()]; }
653 
654  AGX_FORCE_INLINE agx::UInt& GeometryPtr::orientedBoundId() { verifyIndex(); return getData()->orientedBoundId[calculateIndex()]; }
655  AGX_FORCE_INLINE agx::UInt const& GeometryPtr::orientedBoundId() const { verifyIndex(); return getData()->orientedBoundId[calculateIndex()]; }
656 
657  AGX_FORCE_INLINE agx::Physics::CollisionGroupSetPtr& GeometryPtr::collisionGroupSet() { verifyIndex(); return getData()->collisionGroupSet[calculateIndex()]; }
658  AGX_FORCE_INLINE agx::Physics::CollisionGroupSetPtr const& GeometryPtr::collisionGroupSet() const { verifyIndex(); return getData()->collisionGroupSet[calculateIndex()]; }
659 
660  AGX_FORCE_INLINE agx::UInt32& GeometryPtr::sweepAndPruneIndex() { verifyIndex(); return getData()->sweepAndPruneIndex[calculateIndex()]; }
661  AGX_FORCE_INLINE agx::UInt32 const& GeometryPtr::sweepAndPruneIndex() const { verifyIndex(); return getData()->sweepAndPruneIndex[calculateIndex()]; }
662 
663  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr& GeometryPtr::body() { verifyIndex(); return getData()->body[calculateIndex()]; }
664  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr const& GeometryPtr::body() const { verifyIndex(); return getData()->body[calculateIndex()]; }
665 
666  AGX_FORCE_INLINE agx::Vec3f& GeometryPtr::surfaceVelocity() { verifyIndex(); return getData()->surfaceVelocity[calculateIndex()]; }
667  AGX_FORCE_INLINE agx::Vec3f const& GeometryPtr::surfaceVelocity() const { verifyIndex(); return getData()->surfaceVelocity[calculateIndex()]; }
668 
669  AGX_FORCE_INLINE agx::Physics::MaterialPtr& GeometryPtr::material() { verifyIndex(); return getData()->material[calculateIndex()]; }
670  AGX_FORCE_INLINE agx::Physics::MaterialPtr const& GeometryPtr::material() const { verifyIndex(); return getData()->material[calculateIndex()]; }
671 
672  AGX_FORCE_INLINE agxCollide::Geometry*& GeometryPtr::model() { verifyIndex(); return getData()->model[calculateIndex()]; }
673  AGX_FORCE_INLINE agxCollide::Geometry* const& GeometryPtr::model() const { verifyIndex(); return getData()->model[calculateIndex()]; }
674 
675  AGX_FORCE_INLINE agx::Physics::GeometryPtr& GeometryPtr::next() { verifyIndex(); return getData()->next[calculateIndex()]; }
676  AGX_FORCE_INLINE agx::Physics::GeometryPtr const& GeometryPtr::next() const { verifyIndex(); return getData()->next[calculateIndex()]; }
677 
678  //-----------------------------------------------------------------------------------------------------
679  AGX_FORCE_INLINE GeometryInstance::GeometryInstance() {}
680  AGX_FORCE_INLINE GeometryInstance::GeometryInstance(GeometryData* data, agx::Index index) : agx::ReferencedInstance(data, index) {}
681  AGX_FORCE_INLINE GeometryInstance::GeometryInstance(agxData::EntityStorage* storage, agx::Index index) : agx::ReferencedInstance(storage, index) {}
682  AGX_FORCE_INLINE GeometryInstance::GeometryInstance(const agxData::EntityInstance& other) : agx::ReferencedInstance(other)
683  {
685  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
687  }
688 
689  AGX_FORCE_INLINE GeometryInstance::GeometryInstance(const agxData::EntityPtr& ptr) : agx::ReferencedInstance(ptr)
690  {
692  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
694  }
695 
696 
697  AGX_FORCE_INLINE GeometryData* GeometryInstance::getData() { return static_cast<GeometryData* >(agxData::EntityInstance::getData()); }
698  AGX_FORCE_INLINE const GeometryData* GeometryInstance::getData() const { return static_cast<const GeometryData* >(agxData::EntityInstance::getData()); }
699 
700  AGX_FORCE_INLINE agx::Name& GeometryInstance::name() { verifyIndex(); return getData()->name[getIndex()]; }
701  AGX_FORCE_INLINE agx::Name const& GeometryInstance::name() const { verifyIndex(); return getData()->name[getIndex()]; }
702 
703  AGX_FORCE_INLINE agxCollide::GeometryState& GeometryInstance::state() { verifyIndex(); return getData()->state[getIndex()]; }
704  AGX_FORCE_INLINE agxCollide::GeometryState const& GeometryInstance::state() const { verifyIndex(); return getData()->state[getIndex()]; }
705 
706  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr& GeometryInstance::shape() { verifyIndex(); return getData()->shape[getIndex()]; }
707  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr const& GeometryInstance::shape() const { verifyIndex(); return getData()->shape[getIndex()]; }
708 
709  AGX_FORCE_INLINE agx::AffineMatrix4x4& GeometryInstance::transform() { verifyIndex(); return getData()->transform[getIndex()]; }
710  AGX_FORCE_INLINE agx::AffineMatrix4x4 const& GeometryInstance::transform() const { verifyIndex(); return getData()->transform[getIndex()]; }
711 
712  AGX_FORCE_INLINE agx::AffineMatrix4x4& GeometryInstance::localTransform() { verifyIndex(); return getData()->localTransform[getIndex()]; }
713  AGX_FORCE_INLINE agx::AffineMatrix4x4 const& GeometryInstance::localTransform() const { verifyIndex(); return getData()->localTransform[getIndex()]; }
714 
715  AGX_FORCE_INLINE agxCollide::BoundingAABB& GeometryInstance::boundingAABB() { verifyIndex(); return getData()->boundingAABB[getIndex()]; }
716  AGX_FORCE_INLINE agxCollide::BoundingAABB const& GeometryInstance::boundingAABB() const { verifyIndex(); return getData()->boundingAABB[getIndex()]; }
717 
718  AGX_FORCE_INLINE agx::Real& GeometryInstance::boundingRadius() { verifyIndex(); return getData()->boundingRadius[getIndex()]; }
719  AGX_FORCE_INLINE agx::Real const& GeometryInstance::boundingRadius() const { verifyIndex(); return getData()->boundingRadius[getIndex()]; }
720 
721  AGX_FORCE_INLINE agx::Vec3& GeometryInstance::localBoundCenter() { verifyIndex(); return getData()->localBoundCenter[getIndex()]; }
722  AGX_FORCE_INLINE agx::Vec3 const& GeometryInstance::localBoundCenter() const { verifyIndex(); return getData()->localBoundCenter[getIndex()]; }
723 
724  AGX_FORCE_INLINE agx::UInt8& GeometryInstance::tier() { verifyIndex(); return getData()->tier[getIndex()]; }
725  AGX_FORCE_INLINE agx::UInt8 const& GeometryInstance::tier() const { verifyIndex(); return getData()->tier[getIndex()]; }
726 
727  AGX_FORCE_INLINE agx::UInt32& GeometryInstance::cellIndex() { verifyIndex(); return getData()->cellIndex[getIndex()]; }
728  AGX_FORCE_INLINE agx::UInt32 const& GeometryInstance::cellIndex() const { verifyIndex(); return getData()->cellIndex[getIndex()]; }
729 
730  AGX_FORCE_INLINE agx::UInt16& GeometryInstance::cellSlot() { verifyIndex(); return getData()->cellSlot[getIndex()]; }
731  AGX_FORCE_INLINE agx::UInt16 const& GeometryInstance::cellSlot() const { verifyIndex(); return getData()->cellSlot[getIndex()]; }
732 
733  AGX_FORCE_INLINE agx::UInt32& GeometryInstance::oldCell() { verifyIndex(); return getData()->oldCell[getIndex()]; }
734  AGX_FORCE_INLINE agx::UInt32 const& GeometryInstance::oldCell() const { verifyIndex(); return getData()->oldCell[getIndex()]; }
735 
736  AGX_FORCE_INLINE agx::UInt& GeometryInstance::orientedBoundId() { verifyIndex(); return getData()->orientedBoundId[getIndex()]; }
737  AGX_FORCE_INLINE agx::UInt const& GeometryInstance::orientedBoundId() const { verifyIndex(); return getData()->orientedBoundId[getIndex()]; }
738 
739  AGX_FORCE_INLINE agx::Physics::CollisionGroupSetPtr& GeometryInstance::collisionGroupSet() { verifyIndex(); return getData()->collisionGroupSet[getIndex()]; }
740  AGX_FORCE_INLINE agx::Physics::CollisionGroupSetPtr const& GeometryInstance::collisionGroupSet() const { verifyIndex(); return getData()->collisionGroupSet[getIndex()]; }
741 
742  AGX_FORCE_INLINE agx::UInt32& GeometryInstance::sweepAndPruneIndex() { verifyIndex(); return getData()->sweepAndPruneIndex[getIndex()]; }
743  AGX_FORCE_INLINE agx::UInt32 const& GeometryInstance::sweepAndPruneIndex() const { verifyIndex(); return getData()->sweepAndPruneIndex[getIndex()]; }
744 
745  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr& GeometryInstance::body() { verifyIndex(); return getData()->body[getIndex()]; }
746  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr const& GeometryInstance::body() const { verifyIndex(); return getData()->body[getIndex()]; }
747 
748  AGX_FORCE_INLINE agx::Vec3f& GeometryInstance::surfaceVelocity() { verifyIndex(); return getData()->surfaceVelocity[getIndex()]; }
749  AGX_FORCE_INLINE agx::Vec3f const& GeometryInstance::surfaceVelocity() const { verifyIndex(); return getData()->surfaceVelocity[getIndex()]; }
750 
751  AGX_FORCE_INLINE agx::Physics::MaterialPtr& GeometryInstance::material() { verifyIndex(); return getData()->material[getIndex()]; }
752  AGX_FORCE_INLINE agx::Physics::MaterialPtr const& GeometryInstance::material() const { verifyIndex(); return getData()->material[getIndex()]; }
753 
754  AGX_FORCE_INLINE agxCollide::Geometry*& GeometryInstance::model() { verifyIndex(); return getData()->model[getIndex()]; }
755  AGX_FORCE_INLINE agxCollide::Geometry* const& GeometryInstance::model() const { verifyIndex(); return getData()->model[getIndex()]; }
756 
757  AGX_FORCE_INLINE agx::Physics::GeometryPtr& GeometryInstance::next() { verifyIndex(); return getData()->next[getIndex()]; }
758  AGX_FORCE_INLINE agx::Physics::GeometryPtr const& GeometryInstance::next() const { verifyIndex(); return getData()->next[getIndex()]; }
759 
760  //-----------------------------------------------------------------------------------------------------
761  AGX_FORCE_INLINE GeometrySemantics::GeometrySemantics() {}
762  //-----------------------------------------------------------------------------------------------------
764  }
765 }
766 
767 AGX_TYPE_BINDING(agx::Physics::GeometryPtr, "Physics.GeometryPtr")
768 AGX_TYPE_BINDING(agx::Physics::GeometryInstance, "Physics.GeometryInstance")
769 
770 #ifdef _MSC_VER
771 # pragma warning(pop)
772 #endif
773 
774 #undef AGX_ENTITY_WRAPPER
775 #undef AGX_ENTITY_NAMESPACE
776 #endif
777 
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGX_TYPE_BINDING(_Type, _Name)
Definition: Type.h:179
#define AGXPHYSICS_EXPORT
Axis aligned bounding box implementation.
Definition: BoundingAABB.h:38
The geometry representation used by the collision detection engine.
Definition: Geometry.h:93
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
Representation of a name string.
Definition: Name.h:33
agx::Model * getModel()
Definition: Object.h:371
Pointer to a entity instance of type Physics.CollisionGroupSet.
Abstract description of the data attributes for the Physics.Geometry entity.
static agxData::ScalarAttributeT< agx::UInt32 > * oldCellAttribute
virtual void configure(agx::TiXmlElement *eEntity) override
static agxData::ScalarAttributeT< agxCollide::GeometryState > * stateAttribute
virtual void construct(agxData::EntityPtr instance) override
static agxData::ScalarAttributeT< agx::UInt > * orientedBoundIdAttribute
static agxData::ScalarAttributeT< agx::Physics::Geometry::ShapePtr > * shapeAttribute
static agxData::EntityStorage * defaultStorage()
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Physics::MaterialPtr > * materialAttribute
static agxData::ScalarAttributeT< agx::Physics::GeometryPtr > * nextAttribute
static agxData::ScalarAttributeT< agx::AffineMatrix4x4 > * transformAttribute
static agxData::ScalarAttributeT< agx::Physics::RigidBodyPtr > * bodyAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * sweepAndPruneIndexAttribute
static GeometryPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static GeometryModel * instance()
static agxData::ScalarAttributeT< agx::Real > * boundingRadiusAttribute
static agxData::ScalarAttributeT< agxCollide::BoundingAABB > * boundingAABBAttribute
GeometryModel(const agx::String &name="Geometry")
static agxData::ScalarAttributeT< agx::Physics::CollisionGroupSetPtr > * collisionGroupSetAttribute
virtual void initAttributeAccessors() override
static agxData::ScalarAttributeT< agx::Vec3f > * surfaceVelocityAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * cellIndexAttribute
static agxData::ScalarAttributeT< agx::Name > * nameAttribute
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
static agxData::PointerAttributeT< agxCollide::Geometry * > * modelAttribute
static agxData::ScalarAttributeT< agx::UInt8 > * tierAttribute
void construct(agx::Physics::GeometryPtr geometry)
static agxData::ScalarAttributeT< agx::UInt16 > * cellSlotAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * localBoundCenterAttribute
static agxData::ScalarAttributeT< agx::AffineMatrix4x4 > * localTransformAttribute
Pointer to a entity instance of type Physics.Geometry.
AGXPHYSICS_EXPORT agx::Real const & boundingRadius() const
AGXPHYSICS_EXPORT agx::AffineMatrix4x4 const & localTransform() const
AGXPHYSICS_EXPORT agx::UInt16 const & cellSlot() const
AGXPHYSICS_EXPORT agx::Name const & name() const
AGXPHYSICS_EXPORT agx::Vec3 & localBoundCenter()
AGXPHYSICS_EXPORT agxCollide::GeometryState const & state() const
AGXPHYSICS_EXPORT agxCollide::Geometry *& model()
AGXPHYSICS_EXPORT GeometrySemantics * operator->()
AGXPHYSICS_EXPORT agx::UInt32 & cellIndex()
AGXPHYSICS_EXPORT agx::Vec3 const & localBoundCenter() const
AGXPHYSICS_EXPORT agx::UInt32 & sweepAndPruneIndex()
const GeometryData * getData() const
AGXPHYSICS_EXPORT agx::UInt32 const & cellIndex() const
AGXPHYSICS_EXPORT agx::AffineMatrix4x4 & localTransform()
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & next()
AGXPHYSICS_EXPORT agx::Vec3f const & surfaceVelocity() const
AGXPHYSICS_EXPORT agx::UInt16 & cellSlot()
AGXPHYSICS_EXPORT agx::Physics::Geometry::ShapePtr & shape()
AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr const & body() const
AGXPHYSICS_EXPORT agxCollide::GeometryState & state()
AGXPHYSICS_EXPORT agx::UInt32 const & sweepAndPruneIndex() const
AGXPHYSICS_EXPORT agx::UInt32 & oldCell()
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr const & next() const
AGXPHYSICS_EXPORT agx::Physics::Geometry::ShapePtr const & shape() const
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr const & collisionGroupSet() const
AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr & body()
AGXPHYSICS_EXPORT agx::Real & boundingRadius()
AGXPHYSICS_EXPORT agxCollide::BoundingAABB const & boundingAABB() const
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & material()
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr & collisionGroupSet()
AGXPHYSICS_EXPORT const GeometrySemantics * operator->() const
AGXPHYSICS_EXPORT agx::UInt & orientedBoundId()
AGXPHYSICS_EXPORT agx::AffineMatrix4x4 const & transform() const
AGXPHYSICS_EXPORT agxCollide::Geometry *const & model() const
AGXPHYSICS_EXPORT agx::UInt32 const & oldCell() const
AGXPHYSICS_EXPORT const GeometryInstance instance() const
AGXPHYSICS_EXPORT GeometryPtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::AffineMatrix4x4 & transform()
AGXPHYSICS_EXPORT GeometryPtr(const agxData::EntityPtr &ptr)
GeometryData * getData()
AGXPHYSICS_EXPORT agx::Vec3f & surfaceVelocity()
AGXPHYSICS_EXPORT agx::UInt8 const & tier() const
AGXPHYSICS_EXPORT agx::UInt const & orientedBoundId() const
AGXPHYSICS_EXPORT GeometryInstance instance()
AGXPHYSICS_EXPORT GeometryPtr(const agxData::EntityInstance &instance)
GeometryInstance InstanceType
AGXPHYSICS_EXPORT agx::UInt8 & tier()
AGXPHYSICS_EXPORT agx::Name & name()
AGXPHYSICS_EXPORT GeometryPtr()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const & material() const
AGXPHYSICS_EXPORT agxCollide::BoundingAABB & boundingAABB()
Pointer to a entity instance of type Physics.Geometry.Shape.
Definition: ShapeEntity.h:196
Pointer to a entity instance of type Physics.Material.
Pointer to a entity instance of type Physics.RigidBody.
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:97
#define CALLABLE
Definition: macros.h:72
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
#define AGX_FORCE_INLINE
Definition: macros.h:58
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Contains classes for low level data storage for AGX.
Definition: Container.h:23
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
agxData::EntityRef< GeometryPtr > GeometryRef
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint16_t UInt16
Definition: Integer.h:39
uint32_t UInt32
Definition: Integer.h:40
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42
uint8_t UInt8
Definition: Integer.h:38
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
Definition: Object.h:364
UInt32 Index
Definition: Integer.h:52