21 #ifndef GENERATED_AGX_PHYSICS_PARTICLE_H_PLUGIN 22 #define GENERATED_AGX_PHYSICS_PARTICLE_H_PLUGIN 24 #define AGX_ENTITY_WRAPPER 1 28 # pragma warning(push) 30 # pragma warning( disable : 4505 ) 32 # pragma warning( disable : 4251 ) 34 # pragma warning( disable : 4355 ) 36 # pragma warning( disable: 4714 ) 57 namespace agx {
namespace Physics {
class MaterialPtr; }}
58 namespace agx {
namespace Physics {
class CollisionGroupSetPtr; }}
59 namespace agx {
namespace Physics {
class GraphNodePtr; }}
69 class ParticleInstance;
70 class ParticleSemantics;
95 virtual void shutdownCleanup()
override;
131 virtual void configure(agx::TiXmlElement* eEntity)
override;
132 virtual void initAttributeAccessors()
override;
139 #ifndef AGX_PHYSICS_PARTICLE_DATA_SET_OVERRIDE 140 #define AGX_PHYSICS_PARTICLE_DATA_SET 144 ParticleInstance operator[] (
size_t index);
177 typedef agx::ParticleState stateType;
202 typedef agx::Vec3 geometryContactVectorType;
210 virtual ~ParticleData() {}
211 virtual void setNumElements(
agx::Index numElements)
override;
212 virtual void synchronizeSharedAttribute(
agxData::Value* value)
override;
215 ParticleData& operator= (
const ParticleData&) {
return *
this; }
228 agx::ParticleState
const& getState()
const;
238 agx::Uuid const& getMaterialUuid()
const;
248 agx::Vec3 const& getGeometryContactVector()
const;
252 void integrate(
const agx::Real& clock_timeStep);
253 void integratePosition(
const agx::Real& clock_timeStep);
254 void integrateVelocity(
const agx::Real& clock_timeStep);
258 void setPosition(
const agx::Vec3& position);
260 void setVelocity(
const agx::Vec3& velocity);
263 void setState(agx::ParticleState
const& value);
264 void setOldVelocity(
agx::Vec3 const& value);
268 void setMaterialUuid(
agx::Uuid const& value);
274 void setGeometryContactList(
agx::UInt32 const& value);
277 void setGeometryContactVector(
agx::Vec3 const& value);
283 friend class ParticleInstance;
312 ParticleData* getData();
313 const ParticleData* getData()
const;
453 #ifdef AGX_GENERATED_TOLUA_WRAPPER 454 inline agx::ParticleState
const& getState()
const {
return (*this)->getState(); }
455 inline agx::Vec3 const& getPosition()
const {
return (*this)->getPosition(); }
456 inline agx::Vec3 const& getVelocity()
const {
return (*this)->getVelocity(); }
457 inline agx::Vec3 const& getOldVelocity()
const {
return (*this)->getOldVelocity(); }
458 inline agx::Vec3 const& getForce()
const {
return (*this)->getForce(); }
459 inline agx::Real const& getLife()
const {
return (*this)->getLife(); }
460 inline agx::Real const& getRadius()
const {
return (*this)->getRadius(); }
461 inline agx::Real const& getMass()
const {
return (*this)->getMass(); }
462 inline agx::Real const& getInvMass()
const {
return (*this)->getInvMass(); }
464 inline agx::Uuid const& getMaterialUuid()
const {
return (*this)->getMaterialUuid(); }
466 inline agx::UInt8 const& getTier()
const {
return (*this)->getTier(); }
467 inline agx::UInt32 const& getCellIndex()
const {
return (*this)->getCellIndex(); }
468 inline agx::UInt16 const& getCellSlot()
const {
return (*this)->getCellSlot(); }
469 inline agx::UInt32 const& getOldCell()
const {
return (*this)->getOldCell(); }
470 inline agx::UInt32 const& getGeometryContactList()
const {
return (*this)->getGeometryContactList(); }
471 inline agx::UInt32 const& getSolveBodyIndex()
const {
return (*this)->getSolveBodyIndex(); }
473 inline agx::Vec4f const& getColor()
const {
return (*this)->getColor(); }
474 inline agx::Vec3 const& getGeometryContactVector()
const {
return (*this)->getGeometryContactVector(); }
475 inline agx::Real32 const& getEnableRendering()
const {
return (*this)->getEnableRendering(); }
477 inline void integrate(
const agx::Real& clock_timeStep) { (*this)->integrate(clock_timeStep); }
478 inline void integratePosition(
const agx::Real& clock_timeStep) { (*this)->integratePosition(clock_timeStep); }
479 inline void integrateVelocity(
const agx::Real& clock_timeStep) { (*this)->integrateVelocity(clock_timeStep); }
480 inline void setColor(
const agx::Vec4f& color) { (*this)->setColor(color); }
481 inline void setMass(
const agx::Real& mass) { (*this)->setMass(mass); }
483 inline void setPosition(
const agx::Vec3& position) { (*this)->setPosition(position); }
484 inline void setRadius(
const agx::Real& radius) { (*this)->setRadius(radius); }
485 inline void setVelocity(
const agx::Vec3& velocity) { (*this)->setVelocity(velocity); }
487 inline void setState(agx::ParticleState
const& value) { (*this)->setState(value); }
488 inline void setOldVelocity(
agx::Vec3 const& value) { (*this)->setOldVelocity(value); }
489 inline void setForce(
agx::Vec3 const& value) { (*this)->setForce(value); }
490 inline void setLife(
agx::Real const& value) { (*this)->setLife(value); }
491 inline void setInvMass(
agx::Real const& value) { (*this)->setInvMass(value); }
492 inline void setMaterialUuid(
agx::Uuid const& value) { (*this)->setMaterialUuid(value); }
494 inline void setTier(
agx::UInt8 const& value) { (*this)->setTier(value); }
495 inline void setCellIndex(
agx::UInt32 const& value) { (*this)->setCellIndex(value); }
496 inline void setCellSlot(
agx::UInt16 const& value) { (*this)->setCellSlot(value); }
497 inline void setOldCell(
agx::UInt32 const& value) { (*this)->setOldCell(value); }
498 inline void setGeometryContactList(
agx::UInt32 const& value) { (*this)->setGeometryContactList(value); }
499 inline void setSolveBodyIndex(
agx::UInt32 const& value) { (*this)->setSolveBodyIndex(value); }
501 inline void setGeometryContactVector(
agx::Vec3 const& value) { (*this)->setGeometryContactVector(value); }
502 inline void setEnableRendering(
agx::Real32 const& value) { (*this)->setEnableRendering(value); }
514 ParticleInstance(ParticleData* data,
agx::Index index);
519 ParticleData* getData();
520 const ParticleData* getData()
const;
524 agx::ParticleState& state();
526 agx::ParticleState
const& state()
const;
651 agx::Vec3 const& geometryContactVector()
const;
672 inline ParticleInstance
agx::Physics::ParticleData::operator[] (
size_t index) {
return ParticleInstance(
this, (
agx::Index)index); }
679 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
686 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
694 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
703 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
803 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
810 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
818 AGX_FORCE_INLINE agx::ParticleState& ParticleInstance::state() { verifyIndex();
return getData()->state[getIndex()]; }
819 AGX_FORCE_INLINE agx::ParticleState
const& ParticleInstance::state()
const { verifyIndex();
return getData()->state[getIndex()]; }
822 AGX_FORCE_INLINE agx::Real const& ParticleInstance::defaultRadius()
const { verifyIndex();
return getData()->defaultRadius; }
825 AGX_FORCE_INLINE agx::Real const& ParticleInstance::defaultMass()
const { verifyIndex();
return getData()->defaultMass; }
834 AGX_FORCE_INLINE agx::Real const& ParticleInstance::defaultInvMass()
const { verifyIndex();
return getData()->defaultInvMass; }
837 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::position()
const { verifyIndex();
return getData()->position[getIndex()]; }
840 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::velocity()
const { verifyIndex();
return getData()->velocity[getIndex()]; }
842 AGX_FORCE_INLINE agx::Vec3& ParticleInstance::oldVelocity() { verifyIndex();
return getData()->oldVelocity[getIndex()]; }
843 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::oldVelocity()
const { verifyIndex();
return getData()->oldVelocity[getIndex()]; }
846 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::force()
const { verifyIndex();
return getData()->force[getIndex()]; }
852 AGX_FORCE_INLINE agx::Real const& ParticleInstance::radius()
const { verifyIndex();
return getData()->radius[getIndex()]; }
858 AGX_FORCE_INLINE agx::Real const& ParticleInstance::invMass()
const { verifyIndex();
return getData()->invMass[getIndex()]; }
863 AGX_FORCE_INLINE agx::Uuid& ParticleInstance::materialUuid() { verifyIndex();
return getData()->materialUuid[getIndex()]; }
864 AGX_FORCE_INLINE agx::Uuid const& ParticleInstance::materialUuid()
const { verifyIndex();
return getData()->materialUuid[getIndex()]; }
873 AGX_FORCE_INLINE agx::UInt32 const& ParticleInstance::cellIndex()
const { verifyIndex();
return getData()->cellIndex[getIndex()]; }
881 AGX_FORCE_INLINE agx::UInt32& ParticleInstance::geometryContactList() { verifyIndex();
return getData()->geometryContactList[getIndex()]; }
882 AGX_FORCE_INLINE agx::UInt32 const& ParticleInstance::geometryContactList()
const { verifyIndex();
return getData()->geometryContactList[getIndex()]; }
885 AGX_FORCE_INLINE agx::UInt32 const& ParticleInstance::solveBodyIndex()
const { verifyIndex();
return getData()->solveBodyIndex[getIndex()]; }
893 AGX_FORCE_INLINE agx::Vec3& ParticleInstance::geometryContactVector() { verifyIndex();
return getData()->geometryContactVector[getIndex()]; }
894 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::geometryContactVector()
const { verifyIndex();
return getData()->geometryContactVector[getIndex()]; }
896 AGX_FORCE_INLINE agx::Real32& ParticleInstance::enableRendering() { verifyIndex();
return getData()->enableRendering[getIndex()]; }
897 AGX_FORCE_INLINE agx::Real32 const& ParticleInstance::enableRendering()
const { verifyIndex();
return getData()->enableRendering[getIndex()]; }
907 AGX_TYPE_BINDING(agx::Physics::ParticleInstance,
"Physics.ParticleInstance")
910 # pragma warning(pop) 913 #undef AGX_ENTITY_WRAPPER 914 #undef AGX_ENTITY_NAMESPACE static agxData::ScalarAttributeT< agx::UInt8 > * tierAttribute
AGXPHYSICS_EXPORT agx::ParticleState & state()
static agxData::ScalarAttributeT< agx::Uuid > * materialUuidAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * geometryContactVectorAttribute
static agxData::ScalarAttributeT< agx::Vec4f > * colorAttribute
agxData::EntityData * getData()
static agxData::ScalarAttributeT< agx::UInt32 > * oldCellAttribute
static agxData::SharedAttributeT< agx::Physics::CollisionGroupSetPtr > * defaultCollisionGroupSetAttribute
AGXPHYSICS_EXPORT agx::Vec3 & force()
agxData::EntityInstance instance()
AGXPHYSICS_EXPORT agx::UInt32 & oldCell()
AGXPHYSICS_EXPORT agx::Real & radius()
static agxData::SharedAttributeT< agx::Real > * defaultRadiusAttribute
static agxData::ScalarAttributeT< agx::UInt16 > * cellSlotAttribute
Data storage for a collection of entity instances of a specified EntityModel.
static agxData::ScalarAttributeT< agx::Real > * massAttribute
Abstract representation of a value.
Pointer to a entity instance of type Physics.Material.
#define agxAssertN(expr, format,...)
A class holding 4 dimensional vectors and providing basic arithmetic.
agxData::EntityData * getData()
agx::String fullPath() const
#define AGX_TYPE_BINDING(_Type, _Name)
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
static agxData::SharedAttributeT< agx::Physics::MaterialPtr > * defaultMaterialAttribute
#define AGXPHYSICS_EXPORT
AGXPHYSICS_EXPORT agx::Uuid & materialUuid()
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...
AGXPHYSICS_EXPORT ParticleSemantics * operator->()
AGXPHYSICS_EXPORT ParticlePtr()
AGXPHYSICS_EXPORT agx::Physics::GraphNodePtr & graphNode()
#define AGX_DECLARE_POINTER_TYPES(type)
bool isInstanceOf(agxData::EntityModel *model) const
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & material()
static agxData::SharedAttributeT< agx::Real > * defaultInvMassAttribute
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr & defaultCollisionGroupSet()
static agxData::ScalarAttributeT< agx::Physics::GraphNodePtr > * graphNodeAttribute
AGXPHYSICS_EXPORT agx::Vec3 & position()
Type-specific Array used for fast access into the data held by a Buffer.
AGXPHYSICS_EXPORT agx::Real & defaultRadius()
static agxData::ScalarAttributeT< agx::Vec3 > * forceAttribute
Pointer to a entity instance of type Physics.CollisionGroupSet.
AGXPHYSICS_EXPORT agx::Vec4f & color()
AGXPHYSICS_EXPORT ParticleInstance instance()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & defaultMaterial()
Vector containing 'raw' data.
EntityPtr & operator=(const EntityPtr &other)=default
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
static agxData::ScalarAttributeT< agx::Vec3 > * oldVelocityAttribute
Abstract description of the data attributes for the Physics.Particle entity.
Pointer to a entity instance of type Physics.GraphNode.
static agxData::ScalarAttributeT< agx::Real > * invMassAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * geometryContactListAttribute
AGXPHYSICS_EXPORT agx::Real & defaultInvMass()
static agxData::ScalarAttributeT< agx::Physics::MaterialPtr > * materialAttribute
AGXPHYSICS_EXPORT agx::Vec3 & oldVelocity()
AGXPHYSICS_EXPORT ParticlePtr & operator=(const agxData::EntityPtr &ptr)
static agxData::ScalarAttributeT< agx::Vec3 > * positionAttribute
Contains classes for low level data storage for AGX.
AGXPHYSICS_EXPORT agx::Vec3 & velocity()
AGXPHYSICS_EXPORT agx::Real & mass()
AGXPHYSICS_EXPORT agx::Real & defaultMass()
AGXPHYSICS_EXPORT agx::Real & invMass()
AGXPHYSICS_EXPORT agx::UInt8 & tier()
static agxData::ScalarAttributeT< agx::Real32 > * enableRenderingAttribute
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
ParticleInstance InstanceType
static agxData::ScalarAttributeT< agx::UInt32 > * cellIndexAttribute
static agxData::ScalarAttributeT< agx::Real > * radiusAttribute
static agxData::SharedAttributeT< agx::Real > * defaultMassAttribute
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
bool isInstanceOf(agxData::EntityModel *model) const
AGXPHYSICS_EXPORT agx::UInt32 & geometryContactList()
static agxData::ScalarAttributeT< agx::Vec3 > * velocityAttribute
AGXPHYSICS_EXPORT agx::UInt32 & solveBodyIndex()
static ParticleModel * instance()
AGXPHYSICS_EXPORT agx::UInt32 & cellIndex()
static agxData::ScalarAttributeT< agx::Real > * lifeAttribute
AGXPHYSICS_EXPORT agx::Real & life()
static agxData::ScalarAttributeT< agx::Physics::CollisionGroupSetPtr > * collisionGroupSetAttribute
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr & collisionGroupSet()
AGXPHYSICS_EXPORT agx::Real32 & enableRendering()
Pointer to a entity instance of type Physics.Particle.
static agxData::ScalarAttributeT< agx::ParticleState > * stateAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * solveBodyIndexAttribute
#define DOXYGEN_END_INTERNAL_BLOCK()
AGXPHYSICS_EXPORT agx::UInt16 & cellSlot()
#define DOXYGEN_START_INTERNAL_BLOCK()
AGXPHYSICS_EXPORT agx::Vec3 & geometryContactVector()