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;
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;
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\'",
710 AGX_FORCE_INLINE ParticleSemantics* ParticlePtr::operator->() {
return (ParticleSemantics* )
this; }
711 AGX_FORCE_INLINE const ParticleSemantics* ParticlePtr::operator->()
const {
return (
const ParticleSemantics* )
this; }
715 AGX_FORCE_INLINE agx::ParticleState& ParticlePtr::state() { verifyIndex();
return getData()->state[calculateIndex()]; }
716 AGX_FORCE_INLINE agx::ParticleState
const& ParticlePtr::state()
const { verifyIndex();
return getData()->state[calculateIndex()]; }
731 AGX_FORCE_INLINE agx::Real const& ParticlePtr::defaultInvMass()
const { verifyIndex();
return getData()->defaultInvMass; }
734 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::position()
const { verifyIndex();
return getData()->position[calculateIndex()]; }
737 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::velocity()
const { verifyIndex();
return getData()->velocity[calculateIndex()]; }
739 AGX_FORCE_INLINE agx::Vec3& ParticlePtr::oldVelocity() { verifyIndex();
return getData()->oldVelocity[calculateIndex()]; }
740 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::oldVelocity()
const { verifyIndex();
return getData()->oldVelocity[calculateIndex()]; }
743 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::force()
const { verifyIndex();
return getData()->force[calculateIndex()]; }
749 AGX_FORCE_INLINE agx::Real const& ParticlePtr::radius()
const { verifyIndex();
return getData()->radius[calculateIndex()]; }
755 AGX_FORCE_INLINE agx::Real const& ParticlePtr::invMass()
const { verifyIndex();
return getData()->invMass[calculateIndex()]; }
760 AGX_FORCE_INLINE agx::Uuid& ParticlePtr::materialUuid() { verifyIndex();
return getData()->materialUuid[calculateIndex()]; }
761 AGX_FORCE_INLINE agx::Uuid const& ParticlePtr::materialUuid()
const { verifyIndex();
return getData()->materialUuid[calculateIndex()]; }
770 AGX_FORCE_INLINE agx::UInt32 const& ParticlePtr::cellIndex()
const { verifyIndex();
return getData()->cellIndex[calculateIndex()]; }
778 AGX_FORCE_INLINE agx::UInt32& ParticlePtr::geometryContactList() { verifyIndex();
return getData()->geometryContactList[calculateIndex()]; }
779 AGX_FORCE_INLINE agx::UInt32 const& ParticlePtr::geometryContactList()
const { verifyIndex();
return getData()->geometryContactList[calculateIndex()]; }
782 AGX_FORCE_INLINE agx::UInt32 const& ParticlePtr::solveBodyIndex()
const { verifyIndex();
return getData()->solveBodyIndex[calculateIndex()]; }
790 AGX_FORCE_INLINE agx::Vec3& ParticlePtr::geometryContactVector() { verifyIndex();
return getData()->geometryContactVector[calculateIndex()]; }
791 AGX_FORCE_INLINE agx::Vec3 const& ParticlePtr::geometryContactVector()
const { verifyIndex();
return getData()->geometryContactVector[calculateIndex()]; }
793 AGX_FORCE_INLINE agx::Real32& ParticlePtr::enableRendering() { verifyIndex();
return getData()->enableRendering[calculateIndex()]; }
794 AGX_FORCE_INLINE agx::Real32 const& ParticlePtr::enableRendering()
const { verifyIndex();
return getData()->enableRendering[calculateIndex()]; }
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()]; }
910 # pragma warning(pop)
913 #undef AGX_ENTITY_WRAPPER
914 #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...
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
EntityPtr & operator=(const EntityPtr &other)=default
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.
static agxData::ScalarAttributeT< agx::Vec4f > * colorAttribute
static ParticleModel * instance()
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 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::EntityStorage * defaultStorage()
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)
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
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::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::Physics::CollisionGroupSetPtr & defaultCollisionGroupSet()
AGXPHYSICS_EXPORT agx::UInt8 const & tier() const
AGXPHYSICS_EXPORT agx::Physics::GraphNodePtr const & graphNode() const
AGXPHYSICS_EXPORT agx::ParticleState & state()
AGXPHYSICS_EXPORT agx::Real const & defaultInvMass() const
AGXPHYSICS_EXPORT agx::Real & life()
AGXPHYSICS_EXPORT agx::Uuid & materialUuid()
AGXPHYSICS_EXPORT agx::UInt32 const & geometryContactList() const
AGXPHYSICS_EXPORT agx::UInt32 & geometryContactList()
AGXPHYSICS_EXPORT agx::Real const & life() const
AGXPHYSICS_EXPORT agx::UInt32 const & solveBodyIndex() const
AGXPHYSICS_EXPORT agx::Real const & mass() const
AGXPHYSICS_EXPORT agx::Real const & defaultMass() const
AGXPHYSICS_EXPORT agx::Vec3 & oldVelocity()
AGXPHYSICS_EXPORT agx::Vec3 & force()
AGXPHYSICS_EXPORT agx::UInt16 const & cellSlot() const
ParticleInstance InstanceType
AGXPHYSICS_EXPORT agx::Vec3 & position()
AGXPHYSICS_EXPORT agx::Real & defaultRadius()
AGXPHYSICS_EXPORT agx::UInt32 & solveBodyIndex()
AGXPHYSICS_EXPORT ParticlePtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::Real & defaultMass()
AGXPHYSICS_EXPORT agx::Real const & invMass() const
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr const & defaultCollisionGroupSet() const
AGXPHYSICS_EXPORT agx::UInt8 & tier()
AGXPHYSICS_EXPORT agx::Uuid const & materialUuid() const
AGXPHYSICS_EXPORT const ParticleSemantics * operator->() const
AGXPHYSICS_EXPORT ParticleInstance instance()
AGXPHYSICS_EXPORT agx::Real const & radius() const
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & defaultMaterial()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & material()
AGXPHYSICS_EXPORT agx::UInt32 & oldCell()
AGXPHYSICS_EXPORT agx::Vec3 const & force() const
AGXPHYSICS_EXPORT agx::Real & mass()
AGXPHYSICS_EXPORT agx::UInt32 & cellIndex()
AGXPHYSICS_EXPORT agx::Vec3 & geometryContactVector()
AGXPHYSICS_EXPORT agx::Vec4f & color()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const & defaultMaterial() const
AGXPHYSICS_EXPORT ParticlePtr()
AGXPHYSICS_EXPORT agx::Real32 const & enableRendering() const
AGXPHYSICS_EXPORT agx::UInt32 const & oldCell() const
AGXPHYSICS_EXPORT agx::Vec4f const & color() const
AGXPHYSICS_EXPORT agx::Real & defaultInvMass()
AGXPHYSICS_EXPORT const ParticleInstance instance() const
AGXPHYSICS_EXPORT agx::Real & invMass()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const & material() const
AGXPHYSICS_EXPORT agx::Real const & defaultRadius() const
AGXPHYSICS_EXPORT agx::Vec3 const & geometryContactVector() const
AGXPHYSICS_EXPORT agx::UInt32 const & cellIndex() const
AGXPHYSICS_EXPORT agx::Physics::GraphNodePtr & graphNode()
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr const & collisionGroupSet() const
const ParticleData * getData() const
AGXPHYSICS_EXPORT agx::Vec3 const & velocity() const
AGXPHYSICS_EXPORT ParticleSemantics * operator->()
AGXPHYSICS_EXPORT agx::Vec3 const & position() const
AGXPHYSICS_EXPORT agx::Real32 & enableRendering()
AGXPHYSICS_EXPORT agx::Vec3 & velocity()
AGXPHYSICS_EXPORT agx::Real & radius()
AGXPHYSICS_EXPORT agx::ParticleState const & state() const
AGXPHYSICS_EXPORT agx::Vec3 const & oldVelocity() const
AGXPHYSICS_EXPORT ParticlePtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT ParticlePtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Physics::CollisionGroupSetPtr & collisionGroupSet()
AGXPHYSICS_EXPORT agx::UInt16 & cellSlot()
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.
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())