21#ifndef GENERATED_AGX_PHYSICS_SOLVEBODY_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_SOLVEBODY_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 )
60 class SolveBodyInstance;
61 class SolveBodySemantics;
102 virtual void configure(agx::TiXmlElement* eEntity)
override;
110 #ifndef AGX_PHYSICS_SOLVEBODY_DATA_SET_OVERRIDE
111 #define AGX_PHYSICS_SOLVEBODY_DATA_SET
115 SolveBodyInstance operator[] (
size_t index);
131 typedef agx::Vec3 oldAngularVelocityType;
141 virtual ~SolveBodyData() {}
142 virtual void setNumElements(
agx::Index numElements)
override;
145 SolveBodyData& operator= (
const SolveBodyData&) {
return *
this; }
159 agx::Vec3 const& getAngularVelocity()
const;
161 agx::Vec3 const& getOldAngularVelocity()
const;
169 void setVelocity(
agx::Vec3 const& value);
170 void setAngularVelocity(
agx::Vec3 const& value);
171 void setOldVelocity(
agx::Vec3 const& value);
172 void setOldAngularVelocity(
agx::Vec3 const& value);
174 void setInvInertia(
agx::Real const& value);
179 friend class SolveBodyPtr;
180 friend class SolveBodyInstance;
181 SolveBodySemantics();
256 SolveBodyInstance(SolveBodyData* data,
agx::Index index);
261 SolveBodyData* getData();
262 const SolveBodyData* getData()
const;
273 agx::Vec3 const& angularVelocity()
const;
283 agx::Vec3 const& oldAngularVelocity()
const;
314 inline SolveBodyInstance
agx::Physics::SolveBodyData::operator[] (
size_t index) {
return SolveBodyInstance(
this, (
agx::Index)index); }
321 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
328 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
336 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
337 EntityPtr::getModel()->fullPath().c_str(), SolveBodyModel::instance()->fullPath().c_str());
345 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
346 EntityPtr::getModel()->fullPath().c_str(), SolveBodyModel::instance()->fullPath().c_str());
352 AGX_FORCE_INLINE SolveBodySemantics* SolveBodyPtr::operator->() {
return (SolveBodySemantics* )
this; }
353 AGX_FORCE_INLINE const SolveBodySemantics* SolveBodyPtr::operator->()
const {
return (
const SolveBodySemantics* )
this; }
358 AGX_FORCE_INLINE agx::Vec3 const& SolveBodyPtr::velocity()
const { verifyIndex();
return getData()->velocity[calculateIndex()]; }
360 AGX_FORCE_INLINE agx::Vec3& SolveBodyPtr::angularVelocity() { verifyIndex();
return getData()->angularVelocity[calculateIndex()]; }
361 AGX_FORCE_INLINE agx::Vec3 const& SolveBodyPtr::angularVelocity()
const { verifyIndex();
return getData()->angularVelocity[calculateIndex()]; }
363 AGX_FORCE_INLINE agx::Vec3& SolveBodyPtr::oldVelocity() { verifyIndex();
return getData()->oldVelocity[calculateIndex()]; }
364 AGX_FORCE_INLINE agx::Vec3 const& SolveBodyPtr::oldVelocity()
const { verifyIndex();
return getData()->oldVelocity[calculateIndex()]; }
366 AGX_FORCE_INLINE agx::Vec3& SolveBodyPtr::oldAngularVelocity() { verifyIndex();
return getData()->oldAngularVelocity[calculateIndex()]; }
367 AGX_FORCE_INLINE agx::Vec3 const& SolveBodyPtr::oldAngularVelocity()
const { verifyIndex();
return getData()->oldAngularVelocity[calculateIndex()]; }
370 AGX_FORCE_INLINE agx::Real const& SolveBodyPtr::invMass()
const { verifyIndex();
return getData()->invMass[calculateIndex()]; }
372 AGX_FORCE_INLINE agx::Real& SolveBodyPtr::invInertia() { verifyIndex();
return getData()->invInertia[calculateIndex()]; }
373 AGX_FORCE_INLINE agx::Real const& SolveBodyPtr::invInertia()
const { verifyIndex();
return getData()->invInertia[calculateIndex()]; }
385 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
392 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
401 AGX_FORCE_INLINE agx::Vec3 const& SolveBodyInstance::velocity()
const { verifyIndex();
return getData()->velocity[getIndex()]; }
403 AGX_FORCE_INLINE agx::Vec3& SolveBodyInstance::angularVelocity() { verifyIndex();
return getData()->angularVelocity[getIndex()]; }
404 AGX_FORCE_INLINE agx::Vec3 const& SolveBodyInstance::angularVelocity()
const { verifyIndex();
return getData()->angularVelocity[getIndex()]; }
406 AGX_FORCE_INLINE agx::Vec3& SolveBodyInstance::oldVelocity() { verifyIndex();
return getData()->oldVelocity[getIndex()]; }
407 AGX_FORCE_INLINE agx::Vec3 const& SolveBodyInstance::oldVelocity()
const { verifyIndex();
return getData()->oldVelocity[getIndex()]; }
409 AGX_FORCE_INLINE agx::Vec3& SolveBodyInstance::oldAngularVelocity() { verifyIndex();
return getData()->oldAngularVelocity[getIndex()]; }
410 AGX_FORCE_INLINE agx::Vec3 const& SolveBodyInstance::oldAngularVelocity()
const { verifyIndex();
return getData()->oldAngularVelocity[getIndex()]; }
413 AGX_FORCE_INLINE agx::Real const& SolveBodyInstance::invMass()
const { verifyIndex();
return getData()->invMass[getIndex()]; }
416 AGX_FORCE_INLINE agx::Real const& SolveBodyInstance::invInertia()
const { verifyIndex();
return getData()->invInertia[getIndex()]; }
435#undef AGX_ENTITY_WRAPPER
436#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.
agx::String fullPath() const
Abstract description of the data attributes for the Physics.SolveBody entity.
static agxData::ScalarAttributeT< agx::Real > * invInertiaAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * oldAngularVelocityAttribute
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Vec3 > * oldVelocityAttribute
static SolveBodyModel * instance()
virtual void configure(agx::TiXmlElement *eEntity) override
SolveBodyModel(const agx::String &name="SolveBody")
static SolveBodyPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::ScalarAttributeT< agx::Vec3 > * velocityAttribute
static agxData::ScalarAttributeT< agx::Real > * invMassAttribute
static agxData::ScalarAttributeT< agx::SpinMutex > * solveMutexAttribute
virtual ~SolveBodyModel()
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
virtual void initAttributeAccessors() override
static agxData::EntityStorage * defaultStorage()
virtual void construct(agxData::EntityPtr instance) override
static agxData::ScalarAttributeT< agx::Vec3 > * angularVelocityAttribute
void construct(agx::Physics::SolveBodyPtr solveBody)
Pointer to a entity instance of type Physics.SolveBody.
AGXPHYSICS_EXPORT agx::SpinMutex const & solveMutex() const
AGXPHYSICS_EXPORT agx::Vec3 & oldAngularVelocity()
AGXPHYSICS_EXPORT agx::Vec3 & angularVelocity()
AGXPHYSICS_EXPORT agx::SpinMutex & solveMutex()
AGXPHYSICS_EXPORT SolveBodySemantics * operator->()
const SolveBodyData * getData() const
AGXPHYSICS_EXPORT SolveBodyPtr()
SolveBodyData * getData()
SolveBodyInstance InstanceType
AGXPHYSICS_EXPORT SolveBodyPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Real const & invMass() const
AGXPHYSICS_EXPORT agx::Vec3 const & oldAngularVelocity() const
AGXPHYSICS_EXPORT SolveBodyPtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT SolveBodyInstance instance()
AGXPHYSICS_EXPORT const SolveBodySemantics * operator->() const
AGXPHYSICS_EXPORT SolveBodyPtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::Real & invMass()
AGXPHYSICS_EXPORT agx::Real const & invInertia() const
AGXPHYSICS_EXPORT agx::Vec3 const & angularVelocity() const
AGXPHYSICS_EXPORT agx::Vec3 & oldVelocity()
AGXPHYSICS_EXPORT agx::Vec3 const & velocity() const
AGXPHYSICS_EXPORT const SolveBodyInstance instance() const
AGXPHYSICS_EXPORT agx::Vec3 & velocity()
AGXPHYSICS_EXPORT agx::Real & invInertia()
AGXPHYSICS_EXPORT agx::Vec3 const & oldVelocity() const
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.