21#ifndef GENERATED_AGX_PHYSICS_PARTICLE_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_PARTICLE_H_PLUGIN
24#define AGX_ENTITY_WRAPPER 1
30# pragma warning( disable : 4505 )
32# pragma warning( disable : 4251 )
34# pragma warning( disable : 4355 )
36# pragma warning( disable: 4714 )
57namespace agx {
namespace Physics {
class MaterialPtr; }}
58namespace agx {
namespace Physics {
class CollisionGroupSetPtr; }}
59namespace agx {
namespace Physics {
class GraphNodePtr; }}
69 class ParticleInstance;
70 class ParticleSemantics;
131 virtual void configure(agx::TiXmlElement* eEntity)
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);
282 friend class ParticlePtr;
283 friend class ParticleInstance;
459 ParticleInstance(ParticleData* data,
agx::Index index);
464 ParticleData* getData();
465 const ParticleData* getData()
const;
469 agx::ParticleState& state();
471 agx::ParticleState
const& state()
const;
596 agx::Vec3 const& geometryContactVector()
const;
617 inline ParticleInstance
agx::Physics::ParticleData::operator[] (
size_t index) {
return ParticleInstance(
this, (
agx::Index)index); }
624 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
631 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
639 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
640 EntityPtr::getModel()->fullPath().c_str(), ParticleModel::instance()->fullPath().c_str());
648 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
649 EntityPtr::getModel()->fullPath().c_str(), ParticleModel::instance()->fullPath().c_str());
655 AGX_FORCE_INLINE ParticleSemantics* ParticlePtr::operator->() {
return (ParticleSemantics* )
this; }
656 AGX_FORCE_INLINE const ParticleSemantics* ParticlePtr::operator->()
const {
return (
const ParticleSemantics* )
this; }
660 AGX_FORCE_INLINE agx::ParticleState& ParticlePtr::state() { verifyIndex();
return getData()->state[calculateIndex()]; }
661 AGX_FORCE_INLINE agx::ParticleState
const& ParticlePtr::state()
const { verifyIndex();
return getData()->state[calculateIndex()]; }
676 AGX_FORCE_INLINE agx::Real const& ParticlePtr::defaultInvMass()
const { verifyIndex();
return getData()->defaultInvMass; }
679 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::position()
const { verifyIndex();
return getData()->position[calculateIndex()]; }
682 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::velocity()
const { verifyIndex();
return getData()->velocity[calculateIndex()]; }
684 AGX_FORCE_INLINE agx::Vec3& ParticlePtr::oldVelocity() { verifyIndex();
return getData()->oldVelocity[calculateIndex()]; }
685 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::oldVelocity()
const { verifyIndex();
return getData()->oldVelocity[calculateIndex()]; }
688 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::force()
const { verifyIndex();
return getData()->force[calculateIndex()]; }
694 AGX_FORCE_INLINE agx::Real const& ParticlePtr::radius()
const { verifyIndex();
return getData()->radius[calculateIndex()]; }
700 AGX_FORCE_INLINE agx::Real const& ParticlePtr::invMass()
const { verifyIndex();
return getData()->invMass[calculateIndex()]; }
705 AGX_FORCE_INLINE agx::Uuid& ParticlePtr::materialUuid() { verifyIndex();
return getData()->materialUuid[calculateIndex()]; }
706 AGX_FORCE_INLINE agx::Uuid const& ParticlePtr::materialUuid()
const { verifyIndex();
return getData()->materialUuid[calculateIndex()]; }
715 AGX_FORCE_INLINE agx::UInt32 const& ParticlePtr::cellIndex()
const { verifyIndex();
return getData()->cellIndex[calculateIndex()]; }
723 AGX_FORCE_INLINE agx::UInt32& ParticlePtr::geometryContactList() { verifyIndex();
return getData()->geometryContactList[calculateIndex()]; }
724 AGX_FORCE_INLINE agx::UInt32 const& ParticlePtr::geometryContactList()
const { verifyIndex();
return getData()->geometryContactList[calculateIndex()]; }
727 AGX_FORCE_INLINE agx::UInt32 const& ParticlePtr::solveBodyIndex()
const { verifyIndex();
return getData()->solveBodyIndex[calculateIndex()]; }
735 AGX_FORCE_INLINE agx::Vec3& ParticlePtr::geometryContactVector() { verifyIndex();
return getData()->geometryContactVector[calculateIndex()]; }
736 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::geometryContactVector()
const { verifyIndex();
return getData()->geometryContactVector[calculateIndex()]; }
738 AGX_FORCE_INLINE agx::Real32& ParticlePtr::enableRendering() { verifyIndex();
return getData()->enableRendering[calculateIndex()]; }
739 AGX_FORCE_INLINE agx::Real32 const& ParticlePtr::enableRendering()
const { verifyIndex();
return getData()->enableRendering[calculateIndex()]; }
748 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
755 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
763 AGX_FORCE_INLINE agx::ParticleState& ParticleInstance::state() { verifyIndex();
return getData()->state[getIndex()]; }
764 AGX_FORCE_INLINE agx::ParticleState
const& ParticleInstance::state()
const { verifyIndex();
return getData()->state[getIndex()]; }
767 AGX_FORCE_INLINE agx::Real const& ParticleInstance::defaultRadius()
const { verifyIndex();
return getData()->defaultRadius; }
770 AGX_FORCE_INLINE agx::Real const& ParticleInstance::defaultMass()
const { verifyIndex();
return getData()->defaultMass; }
779 AGX_FORCE_INLINE agx::Real const& ParticleInstance::defaultInvMass()
const { verifyIndex();
return getData()->defaultInvMass; }
782 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::position()
const { verifyIndex();
return getData()->position[getIndex()]; }
785 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::velocity()
const { verifyIndex();
return getData()->velocity[getIndex()]; }
787 AGX_FORCE_INLINE agx::Vec3& ParticleInstance::oldVelocity() { verifyIndex();
return getData()->oldVelocity[getIndex()]; }
788 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::oldVelocity()
const { verifyIndex();
return getData()->oldVelocity[getIndex()]; }
791 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::force()
const { verifyIndex();
return getData()->force[getIndex()]; }
797 AGX_FORCE_INLINE agx::Real const& ParticleInstance::radius()
const { verifyIndex();
return getData()->radius[getIndex()]; }
803 AGX_FORCE_INLINE agx::Real const& ParticleInstance::invMass()
const { verifyIndex();
return getData()->invMass[getIndex()]; }
808 AGX_FORCE_INLINE agx::Uuid& ParticleInstance::materialUuid() { verifyIndex();
return getData()->materialUuid[getIndex()]; }
809 AGX_FORCE_INLINE agx::Uuid const& ParticleInstance::materialUuid()
const { verifyIndex();
return getData()->materialUuid[getIndex()]; }
818 AGX_FORCE_INLINE agx::UInt32 const& ParticleInstance::cellIndex()
const { verifyIndex();
return getData()->cellIndex[getIndex()]; }
826 AGX_FORCE_INLINE agx::UInt32& ParticleInstance::geometryContactList() { verifyIndex();
return getData()->geometryContactList[getIndex()]; }
827 AGX_FORCE_INLINE agx::UInt32 const& ParticleInstance::geometryContactList()
const { verifyIndex();
return getData()->geometryContactList[getIndex()]; }
830 AGX_FORCE_INLINE agx::UInt32 const& ParticleInstance::solveBodyIndex()
const { verifyIndex();
return getData()->solveBodyIndex[getIndex()]; }
838 AGX_FORCE_INLINE agx::Vec3& ParticleInstance::geometryContactVector() { verifyIndex();
return getData()->geometryContactVector[getIndex()]; }
839 AGX_FORCE_INLINE agx::Vec3 const& ParticleInstance::geometryContactVector()
const { verifyIndex();
return getData()->geometryContactVector[getIndex()]; }
841 AGX_FORCE_INLINE agx::Real32& ParticleInstance::enableRendering() { verifyIndex();
return getData()->enableRendering[getIndex()]; }
842 AGX_FORCE_INLINE agx::Real32 const& ParticleInstance::enableRendering()
const { verifyIndex();
return getData()->enableRendering[getIndex()]; }
858#undef AGX_ENTITY_WRAPPER
859#undef AGX_ENTITY_NAMESPACE
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_TYPE_BINDING(_Type, _Name)
#define AGXPHYSICS_EXPORT
Type-specific Array used for fast access into the data held by a Buffer.
Entity instance provides access to a single instance in an EntityStorage.
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
EntityPtr & operator=(const EntityPtr &other)=default
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
Data storage for a collection of entity instances of a specified EntityModel.
Abstract representation of a value.
agx::String fullPath() const
Pointer to a entity instance of type Physics.CollisionGroupSet.
Pointer to a entity instance of type Physics.GraphNode.
Pointer to a entity instance of type Physics.Material.
Abstract description of the data attributes for the Physics.Particle entity.
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
static agxData::ScalarAttributeT< agx::Vec4f > * colorAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * oldCellAttribute
static agxData::SharedAttributeT< agx::Real > * defaultInvMassAttribute
static agxData::SharedAttributeT< agx::Physics::CollisionGroupSetPtr > * defaultCollisionGroupSetAttribute
static agxData::ScalarAttributeT< agx::UInt16 > * cellSlotAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * positionAttribute
static ParticleModel * instance()
static agxData::ScalarAttributeT< agx::UInt32 > * cellIndexAttribute
ParticleModel(const agx::String &name="Particle")
static agxData::SharedAttributeT< agx::Real > * defaultRadiusAttribute
static agxData::ScalarAttributeT< agx::Uuid > * materialUuidAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * solveBodyIndexAttribute
static agxData::ScalarAttributeT< agx::Real > * invMassAttribute
static ParticlePtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::SharedAttributeT< agx::Real > * defaultMassAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * velocityAttribute
static agxData::ScalarAttributeT< agx::UInt8 > * tierAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * oldVelocityAttribute
static agxData::ScalarAttributeT< agx::Physics::CollisionGroupSetPtr > * collisionGroupSetAttribute
static agxData::ScalarAttributeT< agx::Real > * massAttribute
virtual void initAttributeAccessors() override
void construct(agx::Physics::ParticlePtr particle)
static agxData::ScalarAttributeT< agx::Real > * radiusAttribute
static agxData::SharedAttributeT< agx::Physics::MaterialPtr > * defaultMaterialAttribute
static agxData::ScalarAttributeT< agx::UInt32 > * geometryContactListAttribute
static agxData::ScalarAttributeT< agx::ParticleState > * stateAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * geometryContactVectorAttribute
virtual void construct(agxData::EntityPtr instance) override
static agxData::ScalarAttributeT< agx::Real32 > * enableRenderingAttribute
static agxData::EntityStorage * defaultStorage()
static agxData::ScalarAttributeT< agx::Physics::MaterialPtr > * materialAttribute
virtual void configure(agx::TiXmlElement *eEntity) override
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Vec3 > * forceAttribute
static agxData::ScalarAttributeT< agx::Physics::GraphNodePtr > * graphNodeAttribute
static agxData::ScalarAttributeT< agx::Real > * lifeAttribute
Pointer to a entity instance of type Physics.Particle.
AGXPHYSICS_EXPORT agx::UInt8 & tier()
AGXPHYSICS_EXPORT agx::Uuid const & materialUuid() const
AGXPHYSICS_EXPORT agx::ParticleState const & state() const
AGXPHYSICS_EXPORT agx::UInt32 const & solveBodyIndex() const
AGXPHYSICS_EXPORT agx::Real32 & enableRendering()
AGXPHYSICS_EXPORT agx::Physics::GraphNodePtr & graphNode()
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr & defaultCollisionGroupSet()
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr const & defaultCollisionGroupSet() const
AGXPHYSICS_EXPORT agx::Real & defaultRadius()
AGXPHYSICS_EXPORT ParticleSemantics * operator->()
AGXPHYSICS_EXPORT agx::Real & radius()
AGXPHYSICS_EXPORT agx::UInt16 & cellSlot()
AGXPHYSICS_EXPORT agx::UInt32 const & cellIndex() const
AGXPHYSICS_EXPORT agx::UInt32 & cellIndex()
AGXPHYSICS_EXPORT agx::UInt32 const & oldCell() const
ParticleInstance InstanceType
AGXPHYSICS_EXPORT ParticlePtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::Real const & invMass() const
AGXPHYSICS_EXPORT agx::UInt32 & oldCell()
AGXPHYSICS_EXPORT ParticleInstance instance()
AGXPHYSICS_EXPORT agx::UInt16 const & cellSlot() const
AGXPHYSICS_EXPORT agx::Real const & radius() const
AGXPHYSICS_EXPORT agx::Vec3 & velocity()
AGXPHYSICS_EXPORT agx::Vec4f const & color() const
AGXPHYSICS_EXPORT agx::Physics::GraphNodePtr const & graphNode() const
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const & material() const
AGXPHYSICS_EXPORT agx::Vec3 const & velocity() const
AGXPHYSICS_EXPORT agx::ParticleState & state()
AGXPHYSICS_EXPORT agx::Real & life()
AGXPHYSICS_EXPORT agx::Real & mass()
AGXPHYSICS_EXPORT agx::Real32 const & enableRendering() const
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const & defaultMaterial() const
AGXPHYSICS_EXPORT agx::Vec3 const & geometryContactVector() const
AGXPHYSICS_EXPORT agx::Vec3 const & position() const
AGXPHYSICS_EXPORT agx::Vec3 & position()
AGXPHYSICS_EXPORT const ParticleSemantics * operator->() const
AGXPHYSICS_EXPORT agx::Real const & life() const
AGXPHYSICS_EXPORT ParticlePtr()
AGXPHYSICS_EXPORT agx::Real const & defaultRadius() const
AGXPHYSICS_EXPORT agx::Real const & defaultInvMass() const
AGXPHYSICS_EXPORT const ParticleInstance instance() const
AGXPHYSICS_EXPORT agx::Vec3 const & force() const
AGXPHYSICS_EXPORT agx::Real & defaultMass()
AGXPHYSICS_EXPORT agx::Vec3 const & oldVelocity() const
AGXPHYSICS_EXPORT agx::Real const & defaultMass() const
AGXPHYSICS_EXPORT agx::UInt8 const & tier() const
AGXPHYSICS_EXPORT agx::Uuid & materialUuid()
AGXPHYSICS_EXPORT agx::Real & defaultInvMass()
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr const & collisionGroupSet() const
AGXPHYSICS_EXPORT agx::Vec4f & color()
AGXPHYSICS_EXPORT agx::UInt32 & geometryContactList()
const ParticleData * getData() const
AGXPHYSICS_EXPORT agx::Vec3 & oldVelocity()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & material()
AGXPHYSICS_EXPORT agx::Real const & mass() const
AGXPHYSICS_EXPORT agx::UInt32 const & geometryContactList() const
AGXPHYSICS_EXPORT agx::Vec3 & geometryContactVector()
AGXPHYSICS_EXPORT ParticlePtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr & collisionGroupSet()
AGXPHYSICS_EXPORT agx::UInt32 & solveBodyIndex()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & defaultMaterial()
AGXPHYSICS_EXPORT ParticlePtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Real & invMass()
AGXPHYSICS_EXPORT agx::Vec3 & force()
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
A class holding 4 dimensional vectors and providing basic arithmetic.
Vector containing 'raw' data.
#define agxAssertN(expr, format,...)
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
Contains classes for low level data storage for AGX.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.