21 #ifndef GENERATED_AGX_PHYSICS_GRANULARBODY_H_PLUGIN 22 #define GENERATED_AGX_PHYSICS_GRANULARBODY_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 ) 58 class GranularBodyModel;
59 class GranularBodyData;
60 class GranularBodyPtr;
61 class GranularBodyInstance;
62 class GranularBodySemantics;
87 virtual void shutdownCleanup()
override;
102 virtual void configure(agx::TiXmlElement* eEntity)
override;
103 virtual void initAttributeAccessors()
override;
110 #ifndef AGX_PHYSICS_GRANULARBODY_DATA_SET_OVERRIDE 111 #define AGX_PHYSICS_GRANULARBODY_DATA_SET 115 GranularBodyInstance operator[] (
size_t index);
128 typedef agx::Vec3 oldAngularVelocityType;
139 virtual ~GranularBodyData() {}
140 virtual void setNumElements(
agx::Index numElements)
override;
143 GranularBodyData& operator= (
const GranularBodyData&) {
return *
this; }
156 agx::Vec3 const& getAngularVelocity()
const;
157 agx::Vec3 const& getOldAngularVelocity()
const;
164 void integratePosition(
const agx::Real& clock_timeStep);
165 void integrateVelocity(
const agx::Real& clock_timeStep);
166 void setAngularVelocity(
const agx::Vec3& angularVelocity);
172 void setOldAngularVelocity(
agx::Vec3 const& value);
173 void setRotation(
agx::Quat const& value);
176 void setInvInertia(
agx::Real const& value);
181 friend class GranularBodyInstance;
182 GranularBodySemantics();
210 GranularBodyData* getData();
211 const GranularBodyData* getData()
const;
246 #ifdef AGX_GENERATED_TOLUA_WRAPPER 247 inline agx::Vec3 const& getAngularVelocity()
const {
return (*this)->getAngularVelocity(); }
248 inline agx::Vec3 const& getOldAngularVelocity()
const {
return (*this)->getOldAngularVelocity(); }
249 inline agx::Quat const& getRotation()
const {
return (*this)->getRotation(); }
250 inline agx::Vec3 const& getTorque()
const {
return (*this)->getTorque(); }
251 inline agx::Real const& getInertia()
const {
return (*this)->getInertia(); }
252 inline agx::Real const& getInvInertia()
const {
return (*this)->getInvInertia(); }
254 inline void integratePosition(
const agx::Real& clock_timeStep) { (*this)->integratePosition(clock_timeStep); }
255 inline void integrateVelocity(
const agx::Real& clock_timeStep) { (*this)->integrateVelocity(clock_timeStep); }
256 inline void setAngularVelocity(
const agx::Vec3& angularVelocity) { (*this)->setAngularVelocity(angularVelocity); }
257 inline void setMass(
const agx::Real& mass) { (*this)->setMass(mass); }
259 inline void setRadius(
const agx::Real& radius) { (*this)->setRadius(radius); }
261 inline void setOldAngularVelocity(
agx::Vec3 const& value) { (*this)->setOldAngularVelocity(value); }
262 inline void setRotation(
agx::Quat const& value) { (*this)->setRotation(value); }
263 inline void setTorque(
agx::Vec3 const& value) { (*this)->setTorque(value); }
264 inline void setInertia(
agx::Real const& value) { (*this)->setInertia(value); }
265 inline void setInvInertia(
agx::Real const& value) { (*this)->setInvInertia(value); }
276 GranularBodyInstance();
277 GranularBodyInstance(GranularBodyData* data,
agx::Index index);
282 GranularBodyData* getData();
283 const GranularBodyData* getData()
const;
289 agx::Vec3 const& angularVelocity()
const;
294 agx::Vec3 const& oldAngularVelocity()
const;
330 inline GranularBodyInstance
agx::Physics::GranularBodyData::operator[] (
size_t index) {
return GranularBodyInstance(
this, (
agx::Index)index); }
337 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
344 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
352 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
361 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
393 AGX_FORCE_INLINE GranularBodyInstance::GranularBodyInstance(GranularBodyData* data,
agx::Index index) : agx::Physics::ParticleInstance(data, index) {}
398 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
405 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
413 AGX_FORCE_INLINE agx::Vec3& GranularBodyInstance::angularVelocity() { verifyIndex();
return getData()->angularVelocity[getIndex()]; }
414 AGX_FORCE_INLINE agx::Vec3 const& GranularBodyInstance::angularVelocity()
const { verifyIndex();
return getData()->angularVelocity[getIndex()]; }
416 AGX_FORCE_INLINE agx::Vec3& GranularBodyInstance::oldAngularVelocity() { verifyIndex();
return getData()->oldAngularVelocity[getIndex()]; }
417 AGX_FORCE_INLINE agx::Vec3 const& GranularBodyInstance::oldAngularVelocity()
const { verifyIndex();
return getData()->oldAngularVelocity[getIndex()]; }
420 AGX_FORCE_INLINE agx::Quat const& GranularBodyInstance::rotation()
const { verifyIndex();
return getData()->rotation[getIndex()]; }
423 AGX_FORCE_INLINE agx::Vec3 const& GranularBodyInstance::torque()
const { verifyIndex();
return getData()->torque[getIndex()]; }
426 AGX_FORCE_INLINE agx::Real const& GranularBodyInstance::inertia()
const { verifyIndex();
return getData()->inertia[getIndex()]; }
428 AGX_FORCE_INLINE agx::Real& GranularBodyInstance::invInertia() { verifyIndex();
return getData()->invInertia[getIndex()]; }
429 AGX_FORCE_INLINE agx::Real const& GranularBodyInstance::invInertia()
const { verifyIndex();
return getData()->invInertia[getIndex()]; }
439 AGX_TYPE_BINDING(agx::Physics::GranularBodyInstance,
"Physics.GranularBodyInstance")
442 # pragma warning(pop) 445 #undef AGX_ENTITY_WRAPPER 446 #undef AGX_ENTITY_NAMESPACE AGXPHYSICS_EXPORT agx::Quat & rotation()
GranularBodyData * getData()
Abstract description of the data attributes for the Physics.GranularBody entity.
agxData::EntityData * getData()
static agxData::ScalarAttributeT< agx::Real > * invInertiaAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * angularVelocityAttribute
agxData::EntityInstance instance()
Data storage for a collection of entity instances of a specified EntityModel.
GranularBodyModel ModelType
Pointer to a entity instance of type Physics.GranularBody.
Pointer to a entity instance of type Physics.Material.
#define agxAssertN(expr, format,...)
agxData::EntityData * getData()
agx::String fullPath() const
static GranularBodyModel * instance()
static agxData::ScalarAttributeT< agx::Quat > * rotationAttribute
#define AGX_TYPE_BINDING(_Type, _Name)
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
#define AGXPHYSICS_EXPORT
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...
#define AGX_DECLARE_POINTER_TYPES(type)
bool isInstanceOf(agxData::EntityModel *model) const
AGXPHYSICS_EXPORT agx::Vec3 & angularVelocity()
static agxData::ScalarAttributeT< agx::Real > * inertiaAttribute
Type-specific Array used for fast access into the data held by a Buffer.
static agxData::ScalarAttributeT< agx::Vec3 > * torqueAttribute
AGXPHYSICS_EXPORT agx::Vec3 & oldAngularVelocity()
Vector containing 'raw' data.
EntityPtr & operator=(const EntityPtr &other)=default
static agxData::ScalarAttributeT< agx::Vec3 > * oldAngularVelocityAttribute
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
AGXPHYSICS_EXPORT agx::Vec3 & torque()
Abstract description of the data attributes for the Physics.Particle entity.
Contains classes for low level data storage for AGX.
AGXPHYSICS_EXPORT agx::Real & inertia()
GranularBodyData DataType
AGXPHYSICS_EXPORT GranularBodySemantics * operator->()
bool isInstanceOf(agxData::EntityModel *model) const
AGXPHYSICS_EXPORT GranularBodyInstance instance()
AGXPHYSICS_EXPORT agx::Real & invInertia()
AGXPHYSICS_EXPORT GranularBodyPtr()
AGXPHYSICS_EXPORT GranularBodyPtr & operator=(const agxData::EntityPtr &ptr)
Pointer to a entity instance of type Physics.Particle.
GranularBodyInstance InstanceType
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()