AGX Dynamics  2.37.2.0
GeometryEntity.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_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 
92  static GeometryModel* instance();
93 
95  static GeometryPtr createInstance();
96 
98  static agxData::EntityStorage* defaultStorage();
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;
133  void construct(agx::Physics::GeometryPtr geometry);
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:
281  AGXPHYSICS_EXPORT GeometryPtr& operator= (const agxData::EntityPtr& ptr);
282  AGXPHYSICS_EXPORT GeometryPtr& operator= (const agxData::EntityInstance& instance);
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 
296  AGXPHYSICS_EXPORT agx::Name const& name() const;
297 
299  AGXPHYSICS_EXPORT agxCollide::GeometryState& state();
301  AGXPHYSICS_EXPORT agxCollide::GeometryState const& state() const;
302 
307 
312 
314  AGXPHYSICS_EXPORT agx::AffineMatrix4x4& localTransform();
316  AGXPHYSICS_EXPORT agx::AffineMatrix4x4 const& localTransform() const;
317 
321  AGXPHYSICS_EXPORT agxCollide::BoundingAABB const& boundingAABB() const;
322 
324  AGXPHYSICS_EXPORT agx::Real& boundingRadius();
326  AGXPHYSICS_EXPORT agx::Real const& boundingRadius() const;
327 
329  AGXPHYSICS_EXPORT agx::Vec3& localBoundCenter();
331  AGXPHYSICS_EXPORT agx::Vec3 const& localBoundCenter() const;
332 
336  AGXPHYSICS_EXPORT agx::UInt8 const& tier() const;
337 
339  AGXPHYSICS_EXPORT agx::UInt32& cellIndex();
341  AGXPHYSICS_EXPORT agx::UInt32 const& cellIndex() const;
342 
344  AGXPHYSICS_EXPORT agx::UInt16& cellSlot();
346  AGXPHYSICS_EXPORT agx::UInt16 const& cellSlot() const;
347 
349  AGXPHYSICS_EXPORT agx::UInt32& oldCell();
351  AGXPHYSICS_EXPORT agx::UInt32 const& oldCell() const;
352 
354  AGXPHYSICS_EXPORT agx::UInt& orientedBoundId();
356  AGXPHYSICS_EXPORT agx::UInt const& orientedBoundId() const;
357 
361  AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr const& collisionGroupSet() const;
362 
364  AGXPHYSICS_EXPORT agx::UInt32& sweepAndPruneIndex();
366  AGXPHYSICS_EXPORT agx::UInt32 const& sweepAndPruneIndex() const;
367 
371  AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr const& body() const;
372 
374  AGXPHYSICS_EXPORT agx::Vec3f& surfaceVelocity();
376  AGXPHYSICS_EXPORT agx::Vec3f const& surfaceVelocity() const;
377 
381  AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const& material() const;
382 
386  AGXPHYSICS_EXPORT agxCollide::Geometry* const& model() const;
387 
391  AGXPHYSICS_EXPORT agx::Physics::GeometryPtr const& next() const;
392 
393  };
394 
395  // Entity is Referenced
397 
398 
400  class AGXPHYSICS_EXPORT GeometryInstance : public agx::ReferencedInstance
401  {
402  public:
403  GeometryInstance();
404  GeometryInstance(GeometryData* data, agx::Index index);
405  GeometryInstance(agxData::EntityStorage *storage, agx::Index index);
406  GeometryInstance(const agxData::EntityInstance& other);
407  GeometryInstance(const agxData::EntityPtr& ptr);
408 
409  GeometryData* getData();
410  const GeometryData* getData() const;
411 
412  public:
414  agx::Name& name();
416  agx::Name const& name() const;
417 
419  agxCollide::GeometryState& state();
421  agxCollide::GeometryState const& state() const;
422 
426  agx::Physics::Geometry::ShapePtr const& shape() const;
427 
431  agx::AffineMatrix4x4 const& transform() const;
432 
434  agx::AffineMatrix4x4& localTransform();
436  agx::AffineMatrix4x4 const& localTransform() const;
437 
439  agxCollide::BoundingAABB& boundingAABB();
441  agxCollide::BoundingAABB const& boundingAABB() const;
442 
444  agx::Real& boundingRadius();
446  agx::Real const& boundingRadius() const;
447 
449  agx::Vec3& localBoundCenter();
451  agx::Vec3 const& localBoundCenter() const;
452 
454  agx::UInt8& tier();
456  agx::UInt8 const& tier() const;
457 
459  agx::UInt32& cellIndex();
461  agx::UInt32 const& cellIndex() const;
462 
464  agx::UInt16& cellSlot();
466  agx::UInt16 const& cellSlot() const;
467 
469  agx::UInt32& oldCell();
471  agx::UInt32 const& oldCell() const;
472 
474  agx::UInt& orientedBoundId();
476  agx::UInt const& orientedBoundId() const;
477 
479  agx::Physics::CollisionGroupSetPtr& collisionGroupSet();
481  agx::Physics::CollisionGroupSetPtr const& collisionGroupSet() const;
482 
484  agx::UInt32& sweepAndPruneIndex();
486  agx::UInt32 const& sweepAndPruneIndex() const;
487 
491  agx::Physics::RigidBodyPtr const& body() const;
492 
494  agx::Vec3f& surfaceVelocity();
496  agx::Vec3f const& surfaceVelocity() const;
497 
499  agx::Physics::MaterialPtr& material();
501  agx::Physics::MaterialPtr const& material() const;
502 
504  agxCollide::Geometry*& model();
506  agxCollide::Geometry* const& model() const;
507 
511  agx::Physics::GeometryPtr const& next() const;
512 
513  };
515 
516 
517 
520 
521 
522 
524  /* Implementation */
525  //-----------------------------------------------------------------------------------------------------
526  //-----------------------------------------------------------------------------------------------------
527  inline GeometryInstance agx::Physics::GeometryData::operator[] (size_t index) { return GeometryInstance(this, (agx::Index)index); }
528  //-----------------------------------------------------------------------------------------------------
529  AGX_FORCE_INLINE GeometryPtr::GeometryPtr() {}
530  AGX_FORCE_INLINE GeometryPtr::GeometryPtr(agxData::EntityStorage* storage, agx::Index id) : agx::ReferencedPtr(storage, id) {}
531  AGX_FORCE_INLINE GeometryPtr::GeometryPtr(const agxData::EntityPtr& ptr) : agx::ReferencedPtr(ptr)
532  {
533  agxAssertN(!ptr || ptr.isInstanceOf(GeometryModel::instance()),
534  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
535  EntityPtr::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
536  }
537 
538  AGX_FORCE_INLINE GeometryPtr::GeometryPtr(const agxData::EntityInstance& instance) : agx::ReferencedPtr(instance)
539  {
540  agxAssertN(!instance || instance.isInstanceOf(GeometryModel::instance()),
541  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
542  EntityPtr::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
543  }
544 
545  AGX_FORCE_INLINE GeometryPtr& GeometryPtr::operator= (const agxData::EntityPtr& ptr)
546  {
548  agxAssertN(!ptr || ptr.isInstanceOf(GeometryModel::instance()),
549  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
550  EntityPtr::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
551  return *this;
552  }
553 
554  AGX_FORCE_INLINE GeometryPtr& GeometryPtr::operator= (const agxData::EntityInstance& instance)
555  {
557  agxAssertN(!instance || instance.isInstanceOf(GeometryModel::instance()),
558  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
559  EntityPtr::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
560  return *this;
561  }
562 
563  inline GeometryInstance GeometryPtr::instance() { return agxData::EntityPtr::instance(); }
564  inline const GeometryInstance GeometryPtr::instance() const { return agxData::EntityPtr::instance(); }
565  AGX_FORCE_INLINE GeometrySemantics* GeometryPtr::operator->() { return (GeometrySemantics* )this; }
566  AGX_FORCE_INLINE const GeometrySemantics* GeometryPtr::operator->() const { return (const GeometrySemantics* )this; }
567  AGX_FORCE_INLINE GeometryData* GeometryPtr::getData() { return static_cast<GeometryData* >(agxData::EntityPtr::getData()); }
568  AGX_FORCE_INLINE const GeometryData* GeometryPtr::getData() const { return static_cast<const GeometryData* >(agxData::EntityPtr::getData()); }
569 
570  AGX_FORCE_INLINE agx::Name& GeometryPtr::name() { verifyIndex(); return getData()->name[calculateIndex()]; }
571  AGX_FORCE_INLINE agx::Name const& GeometryPtr::name() const { verifyIndex(); return getData()->name[calculateIndex()]; }
572 
573  AGX_FORCE_INLINE agxCollide::GeometryState& GeometryPtr::state() { verifyIndex(); return getData()->state[calculateIndex()]; }
574  AGX_FORCE_INLINE agxCollide::GeometryState const& GeometryPtr::state() const { verifyIndex(); return getData()->state[calculateIndex()]; }
575 
576  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr& GeometryPtr::shape() { verifyIndex(); return getData()->shape[calculateIndex()]; }
577  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr const& GeometryPtr::shape() const { verifyIndex(); return getData()->shape[calculateIndex()]; }
578 
579  AGX_FORCE_INLINE agx::AffineMatrix4x4& GeometryPtr::transform() { verifyIndex(); return getData()->transform[calculateIndex()]; }
580  AGX_FORCE_INLINE agx::AffineMatrix4x4 const& GeometryPtr::transform() const { verifyIndex(); return getData()->transform[calculateIndex()]; }
581 
582  AGX_FORCE_INLINE agx::AffineMatrix4x4& GeometryPtr::localTransform() { verifyIndex(); return getData()->localTransform[calculateIndex()]; }
583  AGX_FORCE_INLINE agx::AffineMatrix4x4 const& GeometryPtr::localTransform() const { verifyIndex(); return getData()->localTransform[calculateIndex()]; }
584 
585  AGX_FORCE_INLINE agxCollide::BoundingAABB& GeometryPtr::boundingAABB() { verifyIndex(); return getData()->boundingAABB[calculateIndex()]; }
586  AGX_FORCE_INLINE agxCollide::BoundingAABB const& GeometryPtr::boundingAABB() const { verifyIndex(); return getData()->boundingAABB[calculateIndex()]; }
587 
588  AGX_FORCE_INLINE agx::Real& GeometryPtr::boundingRadius() { verifyIndex(); return getData()->boundingRadius[calculateIndex()]; }
589  AGX_FORCE_INLINE agx::Real const& GeometryPtr::boundingRadius() const { verifyIndex(); return getData()->boundingRadius[calculateIndex()]; }
590 
591  AGX_FORCE_INLINE agx::Vec3& GeometryPtr::localBoundCenter() { verifyIndex(); return getData()->localBoundCenter[calculateIndex()]; }
592  AGX_FORCE_INLINE agx::Vec3 const& GeometryPtr::localBoundCenter() const { verifyIndex(); return getData()->localBoundCenter[calculateIndex()]; }
593 
594  AGX_FORCE_INLINE agx::UInt8& GeometryPtr::tier() { verifyIndex(); return getData()->tier[calculateIndex()]; }
595  AGX_FORCE_INLINE agx::UInt8 const& GeometryPtr::tier() const { verifyIndex(); return getData()->tier[calculateIndex()]; }
596 
597  AGX_FORCE_INLINE agx::UInt32& GeometryPtr::cellIndex() { verifyIndex(); return getData()->cellIndex[calculateIndex()]; }
598  AGX_FORCE_INLINE agx::UInt32 const& GeometryPtr::cellIndex() const { verifyIndex(); return getData()->cellIndex[calculateIndex()]; }
599 
600  AGX_FORCE_INLINE agx::UInt16& GeometryPtr::cellSlot() { verifyIndex(); return getData()->cellSlot[calculateIndex()]; }
601  AGX_FORCE_INLINE agx::UInt16 const& GeometryPtr::cellSlot() const { verifyIndex(); return getData()->cellSlot[calculateIndex()]; }
602 
603  AGX_FORCE_INLINE agx::UInt32& GeometryPtr::oldCell() { verifyIndex(); return getData()->oldCell[calculateIndex()]; }
604  AGX_FORCE_INLINE agx::UInt32 const& GeometryPtr::oldCell() const { verifyIndex(); return getData()->oldCell[calculateIndex()]; }
605 
606  AGX_FORCE_INLINE agx::UInt& GeometryPtr::orientedBoundId() { verifyIndex(); return getData()->orientedBoundId[calculateIndex()]; }
607  AGX_FORCE_INLINE agx::UInt const& GeometryPtr::orientedBoundId() const { verifyIndex(); return getData()->orientedBoundId[calculateIndex()]; }
608 
609  AGX_FORCE_INLINE agx::Physics::CollisionGroupSetPtr& GeometryPtr::collisionGroupSet() { verifyIndex(); return getData()->collisionGroupSet[calculateIndex()]; }
610  AGX_FORCE_INLINE agx::Physics::CollisionGroupSetPtr const& GeometryPtr::collisionGroupSet() const { verifyIndex(); return getData()->collisionGroupSet[calculateIndex()]; }
611 
612  AGX_FORCE_INLINE agx::UInt32& GeometryPtr::sweepAndPruneIndex() { verifyIndex(); return getData()->sweepAndPruneIndex[calculateIndex()]; }
613  AGX_FORCE_INLINE agx::UInt32 const& GeometryPtr::sweepAndPruneIndex() const { verifyIndex(); return getData()->sweepAndPruneIndex[calculateIndex()]; }
614 
615  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr& GeometryPtr::body() { verifyIndex(); return getData()->body[calculateIndex()]; }
616  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr const& GeometryPtr::body() const { verifyIndex(); return getData()->body[calculateIndex()]; }
617 
618  AGX_FORCE_INLINE agx::Vec3f& GeometryPtr::surfaceVelocity() { verifyIndex(); return getData()->surfaceVelocity[calculateIndex()]; }
619  AGX_FORCE_INLINE agx::Vec3f const& GeometryPtr::surfaceVelocity() const { verifyIndex(); return getData()->surfaceVelocity[calculateIndex()]; }
620 
621  AGX_FORCE_INLINE agx::Physics::MaterialPtr& GeometryPtr::material() { verifyIndex(); return getData()->material[calculateIndex()]; }
622  AGX_FORCE_INLINE agx::Physics::MaterialPtr const& GeometryPtr::material() const { verifyIndex(); return getData()->material[calculateIndex()]; }
623 
624  AGX_FORCE_INLINE agxCollide::Geometry*& GeometryPtr::model() { verifyIndex(); return getData()->model[calculateIndex()]; }
625  AGX_FORCE_INLINE agxCollide::Geometry* const& GeometryPtr::model() const { verifyIndex(); return getData()->model[calculateIndex()]; }
626 
627  AGX_FORCE_INLINE agx::Physics::GeometryPtr& GeometryPtr::next() { verifyIndex(); return getData()->next[calculateIndex()]; }
628  AGX_FORCE_INLINE agx::Physics::GeometryPtr const& GeometryPtr::next() const { verifyIndex(); return getData()->next[calculateIndex()]; }
629 
630  //-----------------------------------------------------------------------------------------------------
631  AGX_FORCE_INLINE GeometryInstance::GeometryInstance() {}
632  AGX_FORCE_INLINE GeometryInstance::GeometryInstance(GeometryData* data, agx::Index index) : agx::ReferencedInstance(data, index) {}
633  AGX_FORCE_INLINE GeometryInstance::GeometryInstance(agxData::EntityStorage* storage, agx::Index index) : agx::ReferencedInstance(storage, index) {}
634  AGX_FORCE_INLINE GeometryInstance::GeometryInstance(const agxData::EntityInstance& other) : agx::ReferencedInstance(other)
635  {
636  agxAssertN(!other || other.isInstanceOf(GeometryModel::instance()),
637  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
638  EntityInstance::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
639  }
640 
641  AGX_FORCE_INLINE GeometryInstance::GeometryInstance(const agxData::EntityPtr& ptr) : agx::ReferencedInstance(ptr)
642  {
643  agxAssertN(!ptr || ptr.isInstanceOf(GeometryModel::instance()),
644  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
645  EntityInstance::getModel()->fullPath().c_str(), GeometryModel::instance()->fullPath().c_str());
646  }
647 
648 
649  AGX_FORCE_INLINE GeometryData* GeometryInstance::getData() { return static_cast<GeometryData* >(agxData::EntityInstance::getData()); }
650  AGX_FORCE_INLINE const GeometryData* GeometryInstance::getData() const { return static_cast<const GeometryData* >(agxData::EntityInstance::getData()); }
651 
652  AGX_FORCE_INLINE agx::Name& GeometryInstance::name() { verifyIndex(); return getData()->name[getIndex()]; }
653  AGX_FORCE_INLINE agx::Name const& GeometryInstance::name() const { verifyIndex(); return getData()->name[getIndex()]; }
654 
655  AGX_FORCE_INLINE agxCollide::GeometryState& GeometryInstance::state() { verifyIndex(); return getData()->state[getIndex()]; }
656  AGX_FORCE_INLINE agxCollide::GeometryState const& GeometryInstance::state() const { verifyIndex(); return getData()->state[getIndex()]; }
657 
658  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr& GeometryInstance::shape() { verifyIndex(); return getData()->shape[getIndex()]; }
659  AGX_FORCE_INLINE agx::Physics::Geometry::ShapePtr const& GeometryInstance::shape() const { verifyIndex(); return getData()->shape[getIndex()]; }
660 
661  AGX_FORCE_INLINE agx::AffineMatrix4x4& GeometryInstance::transform() { verifyIndex(); return getData()->transform[getIndex()]; }
662  AGX_FORCE_INLINE agx::AffineMatrix4x4 const& GeometryInstance::transform() const { verifyIndex(); return getData()->transform[getIndex()]; }
663 
664  AGX_FORCE_INLINE agx::AffineMatrix4x4& GeometryInstance::localTransform() { verifyIndex(); return getData()->localTransform[getIndex()]; }
665  AGX_FORCE_INLINE agx::AffineMatrix4x4 const& GeometryInstance::localTransform() const { verifyIndex(); return getData()->localTransform[getIndex()]; }
666 
667  AGX_FORCE_INLINE agxCollide::BoundingAABB& GeometryInstance::boundingAABB() { verifyIndex(); return getData()->boundingAABB[getIndex()]; }
668  AGX_FORCE_INLINE agxCollide::BoundingAABB const& GeometryInstance::boundingAABB() const { verifyIndex(); return getData()->boundingAABB[getIndex()]; }
669 
670  AGX_FORCE_INLINE agx::Real& GeometryInstance::boundingRadius() { verifyIndex(); return getData()->boundingRadius[getIndex()]; }
671  AGX_FORCE_INLINE agx::Real const& GeometryInstance::boundingRadius() const { verifyIndex(); return getData()->boundingRadius[getIndex()]; }
672 
673  AGX_FORCE_INLINE agx::Vec3& GeometryInstance::localBoundCenter() { verifyIndex(); return getData()->localBoundCenter[getIndex()]; }
674  AGX_FORCE_INLINE agx::Vec3 const& GeometryInstance::localBoundCenter() const { verifyIndex(); return getData()->localBoundCenter[getIndex()]; }
675 
676  AGX_FORCE_INLINE agx::UInt8& GeometryInstance::tier() { verifyIndex(); return getData()->tier[getIndex()]; }
677  AGX_FORCE_INLINE agx::UInt8 const& GeometryInstance::tier() const { verifyIndex(); return getData()->tier[getIndex()]; }
678 
679  AGX_FORCE_INLINE agx::UInt32& GeometryInstance::cellIndex() { verifyIndex(); return getData()->cellIndex[getIndex()]; }
680  AGX_FORCE_INLINE agx::UInt32 const& GeometryInstance::cellIndex() const { verifyIndex(); return getData()->cellIndex[getIndex()]; }
681 
682  AGX_FORCE_INLINE agx::UInt16& GeometryInstance::cellSlot() { verifyIndex(); return getData()->cellSlot[getIndex()]; }
683  AGX_FORCE_INLINE agx::UInt16 const& GeometryInstance::cellSlot() const { verifyIndex(); return getData()->cellSlot[getIndex()]; }
684 
685  AGX_FORCE_INLINE agx::UInt32& GeometryInstance::oldCell() { verifyIndex(); return getData()->oldCell[getIndex()]; }
686  AGX_FORCE_INLINE agx::UInt32 const& GeometryInstance::oldCell() const { verifyIndex(); return getData()->oldCell[getIndex()]; }
687 
688  AGX_FORCE_INLINE agx::UInt& GeometryInstance::orientedBoundId() { verifyIndex(); return getData()->orientedBoundId[getIndex()]; }
689  AGX_FORCE_INLINE agx::UInt const& GeometryInstance::orientedBoundId() const { verifyIndex(); return getData()->orientedBoundId[getIndex()]; }
690 
691  AGX_FORCE_INLINE agx::Physics::CollisionGroupSetPtr& GeometryInstance::collisionGroupSet() { verifyIndex(); return getData()->collisionGroupSet[getIndex()]; }
692  AGX_FORCE_INLINE agx::Physics::CollisionGroupSetPtr const& GeometryInstance::collisionGroupSet() const { verifyIndex(); return getData()->collisionGroupSet[getIndex()]; }
693 
694  AGX_FORCE_INLINE agx::UInt32& GeometryInstance::sweepAndPruneIndex() { verifyIndex(); return getData()->sweepAndPruneIndex[getIndex()]; }
695  AGX_FORCE_INLINE agx::UInt32 const& GeometryInstance::sweepAndPruneIndex() const { verifyIndex(); return getData()->sweepAndPruneIndex[getIndex()]; }
696 
697  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr& GeometryInstance::body() { verifyIndex(); return getData()->body[getIndex()]; }
698  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr const& GeometryInstance::body() const { verifyIndex(); return getData()->body[getIndex()]; }
699 
700  AGX_FORCE_INLINE agx::Vec3f& GeometryInstance::surfaceVelocity() { verifyIndex(); return getData()->surfaceVelocity[getIndex()]; }
701  AGX_FORCE_INLINE agx::Vec3f const& GeometryInstance::surfaceVelocity() const { verifyIndex(); return getData()->surfaceVelocity[getIndex()]; }
702 
703  AGX_FORCE_INLINE agx::Physics::MaterialPtr& GeometryInstance::material() { verifyIndex(); return getData()->material[getIndex()]; }
704  AGX_FORCE_INLINE agx::Physics::MaterialPtr const& GeometryInstance::material() const { verifyIndex(); return getData()->material[getIndex()]; }
705 
706  AGX_FORCE_INLINE agxCollide::Geometry*& GeometryInstance::model() { verifyIndex(); return getData()->model[getIndex()]; }
707  AGX_FORCE_INLINE agxCollide::Geometry* const& GeometryInstance::model() const { verifyIndex(); return getData()->model[getIndex()]; }
708 
709  AGX_FORCE_INLINE agx::Physics::GeometryPtr& GeometryInstance::next() { verifyIndex(); return getData()->next[getIndex()]; }
710  AGX_FORCE_INLINE agx::Physics::GeometryPtr const& GeometryInstance::next() const { verifyIndex(); return getData()->next[getIndex()]; }
711 
712  //-----------------------------------------------------------------------------------------------------
713  AGX_FORCE_INLINE GeometrySemantics::GeometrySemantics() {}
714  //-----------------------------------------------------------------------------------------------------
716  }
717 }
718 
719 AGX_TYPE_BINDING(agx::Physics::GeometryPtr, "Physics.GeometryPtr")
720 AGX_TYPE_BINDING(agx::Physics::GeometryInstance, "Physics.GeometryInstance")
721 
722 #ifdef _MSC_VER
723 # pragma warning(pop)
724 #endif
725 
726 #undef AGX_ENTITY_WRAPPER
727 #undef AGX_ENTITY_NAMESPACE
728 #endif
729 
static agxData::ScalarAttributeT< agx::UInt32 > * sweepAndPruneIndexAttribute
agxData::EntityData * getData()
static agxData::ScalarAttributeT< agx::Physics::CollisionGroupSetPtr > * collisionGroupSetAttribute
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
Abstract description of the data attributes for the Physics.Geometry entity.
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
static agxData::ScalarAttributeT< agx::Physics::MaterialPtr > * materialAttribute
This namespace consists of a set of classes for handling geometric intersection tests including boole...
static agxData::ScalarAttributeT< agx::UInt32 > * oldCellAttribute
Pointer to a entity instance of type Physics.Material.
static agxData::ScalarAttributeT< agx::UInt8 > * tierAttribute
#define agxAssertN(expr, format,...)
Definition: debug.h:145
agxData::EntityData * getData()
agx::String fullPath() const
#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
uint8_t UInt8
Definition: Integer.h:38
static agxData::ScalarAttributeT< agx::Real > * boundingRadiusAttribute
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
#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
static agxData::ScalarAttributeT< agx::AffineMatrix4x4 > * localTransformAttribute
bool isInstanceOf(agxData::EntityModel *model) const
Representation of a name string.
Definition: Name.h:32
#define AGX_FORCE_INLINE
Definition: Object.h:59
Type-specific Array used for fast access into the data held by a Buffer.
Definition: agxData.h:30
Pointer to a entity instance of type Physics.CollisionGroupSet.
static agxData::ScalarAttributeT< agxCollide::BoundingAABB > * boundingAABBAttribute
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
static agxData::ScalarAttributeT< agx::UInt16 > * cellSlotAttribute
Pointer to a entity instance of type Physics.RigidBody.
uint32_t UInt
Definition: Integer.h:34
static agxData::ScalarAttributeT< agx::Name > * nameAttribute
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.
GeometryInstance InstanceType
Pointer to a entity instance of type Physics.Geometry.
Contains classes for low level data storage for AGX.
Definition: Container.h:23
UInt32 Index
Definition: Integer.h:52
static agxData::ScalarAttributeT< agx::Physics::Geometry::ShapePtr > * shapeAttribute
static agxData::ScalarAttributeT< agx::Physics::RigidBodyPtr > * bodyAttribute
static agxData::PointerAttributeT< agxCollide::Geometry * > * modelAttribute
#define CALLABLE
Definition: Object.h:73
Abstract description of the data attributes for the Referenced entity.
static agxData::ScalarAttributeT< agx::Vec3 > * localBoundCenterAttribute
static agxData::ScalarAttributeT< agx::AffineMatrix4x4 > * transformAttribute
bool isInstanceOf(agxData::EntityModel *model) const
static agxData::ScalarAttributeT< agxCollide::GeometryState > * stateAttribute
Pointer to a entity instance of type Referenced.
agx::ref_ptr< Geometry > GeometryRef
Definition: Geometry.h:78
uint16_t UInt16
Definition: Integer.h:39
double Real
Definition: Real.h:42
Axis aligned bounding box implementation.
Definition: BoundingAABB.h:37
static agxData::ScalarAttributeT< agx::UInt32 > * cellIndexAttribute
static agxData::ScalarAttributeT< agx::Vec3f > * surfaceVelocityAttribute
static agxData::ScalarAttributeT< agx::UInt > * orientedBoundIdAttribute
uint32_t UInt32
Definition: Integer.h:40
static agxData::ScalarAttributeT< agx::Physics::GeometryPtr > * nextAttribute
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
AGX_DECLARE_POINTER_TYPES(SpaceListener)