18#ifndef AGX_POWERLINE_PHYSICAL_DIMENSION_STATE_H
19#define AGX_POWERLINE_PHYSICAL_DIMENSION_STATE_H
40 class PhysicalDimension;
144 virtual
void store(
agxStream::OutputArchive& out) const override;
145 virtual
void restore(
agxStream::InputArchive& in) override;
147 virtual
bool store(
agxStream::StorageStream& out) const;
162 void disallowPacking();
164 agx::Vec3 getWorldPosition() const;
166 agx::Vec3 getWorldVelocity() const;
168 const
agx::Frame* getBodyFrame() const;
170 void setBody(
agx::RigidBody* newBody);
173 agx::RigidBodyRef m_body;
176 bool m_allowsPacking;
209 template<
typename DimensionType>
300 static const char* getConstructClassId();
325 DimensionType m_storage;
353 template<
typename DimensionType>
421 static const char* getConstructClassId();
434 void calculateMergedBodyJacobian(
440 void printInvalidDirectionReference()
const;
445 DimensionType m_storage;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
PowerLine is the base class for a system of power transfer integrated into the rigid body simulation.
The SlotMapper is reponsible for mapping one dimensional dimension states to slots in the RigidBodies...
Base class for the two one dimensional dimension state classes.
AbstractDimensionState1Dof(agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension, bool allowPacking)
virtual agx::UInt8 getSlot() const =0
Base class for the two three dimensional dimension state classes.
virtual void setLocalDirection(const agx::Vec3 &direction)=0
virtual void setWorldDirection(const agx::Vec3 &direction)=0
AbstractDimensionState3Dof(agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension)
Templated one dimensional dimension state.
static agxStream::Serializable * create()
virtual void reserveBody() override
Ensure that this DimensionState is the only state using this state's RigidBody.
void moveImpl(agx::RigidBody *newBody, agx::UInt8 newSlot)
virtual agxStream::StorageAgent * getStorageAgent() const override
virtual void removeNotification(agxPowerLine::PowerLine *powerLine) override
virtual agx::Real getValue() const override
static agxStream::Serializable * create(agxStream::InputArchive &)
virtual const agx::RigidBody * getReservedBody() const override
virtual void addLoad(agx::Real load) override
void move(agx::RigidBody *body, agx::UInt8 slot)
Make this dimension state use the given body for storage.
void split()
Move this DimensionState to a new RigidBody that is guaranteed to not be shared with any other Dimens...
virtual void setVelocityDamping(float damping) override
virtual bool isExternalBody() const override
virtual void setGradient(agx::Real gradient) override
virtual void restore(agxStream::InputArchive &in) override
virtual agx::Vec3 getLocalDirection() const override
virtual void setValue(agx::Real value) override
virtual agx::Vec3 getDirection() const override
virtual agx::Vec3 getWorldDirection() const override
virtual agx::UInt8 getSlot() const override
virtual void postUpdate(agx::Real timeStep) override
virtual void addNotification(agxPowerLine::PowerLine *powerLine) override
virtual agx::Real getSecondGradient() const override
virtual DirectionReference getDirectionReference() const override
virtual bool store(agxStream::StorageStream &out) const override
virtual void store(agxStream::OutputArchive &out) const override
DimensionState1Dof(agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension, agx::UInt8 slot)
virtual bool setMassProperty(agx::Real massProperty) override
virtual agx::Real getGradient() const override
virtual ~DimensionState1Dof()
virtual bool restore(agxStream::StorageStream &in) override
virtual const char * getClassName() const override
SlotMapper * getSlotMapper()
virtual agx::Real getMassProperty() const override
virtual float getVelocityDamping() override
virtual agx::RigidBody * getReservedBody() override
Returns a RigidBody that is guaranteed to not be shared with any other DimensionState.
virtual void calculateJacobian(agx::Jacobian6DOFElement *G, agx::Real ratio, size_t index) const override
Templated three dimensional dimension state.
virtual ~DimensionState3Dof()
virtual void setWorldDirection(const agx::Vec3 &direction) override
virtual const agx::RigidBody * getReservedBody() const override
virtual agx::Vec3 getDirection() const override
virtual void postUpdate(agx::Real) override
static agxStream::Serializable * create(agxStream::InputArchive &)
virtual agx::RigidBody * getReservedBody() override
Gives access to a RigidBody that is known to be used by this dimension state only.
DimensionState3Dof(agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension, const agx::Vec3 &direction, DirectionReference directionReference)
virtual bool store(agxStream::StorageStream &out) const override
virtual agx::Vec3 getWorldDirection() const override
virtual void addLoad(agx::Real load) override
static agxStream::Serializable * create()
DimensionState3Dof(agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension, const agx::Vec3 &direction, DirectionReference directionReference, bool externalBody)
virtual DirectionReference getDirectionReference() const override
virtual bool restore(agxStream::StorageStream &in) override
virtual void store(agxStream::OutputArchive &out) const override
virtual bool setMassProperty(agx::Real massProperty) override
virtual void setLocalDirection(const agx::Vec3 &direction) override
virtual void restore(agxStream::InputArchive &in) override
virtual void calculateJacobian(agx::Jacobian6DOFElement *G, agx::Real ratio, size_t index) const override
virtual agx::Real getGradient() const override
virtual agx::Real getValue() const override
virtual void addNotification(agxPowerLine::PowerLine *powerLine) override
virtual agx::Vec3 getLocalDirection() const override
virtual float getVelocityDamping() override
virtual void setVelocityDamping(float damping) override
virtual bool isExternalBody() const override
virtual void reserveBody() override
Reserve a body for this dimension state.
virtual const char * getClassName() const override
virtual agx::Real getSecondGradient() const override
virtual void setGradient(agx::Real gradient) override
virtual agx::Real getMassProperty() const override
virtual agxStream::StorageAgent * getStorageAgent() const override
virtual void setValue(agx::Real value) override
virtual void removeNotification(agxPowerLine::PowerLine *powerLine) override
A DimensionState is the data carrier of a PhysicalDimension.
virtual void setGradient(agx::Real value)=0
virtual bool isExternalBody() const =0
virtual const agx::RigidBody * getReservedBody() const =0
virtual agx::Real getMassProperty() const =0
virtual agx::RigidBody * getReservedBody()=0
Gives access to a RigidBody that is known to be used by this dimension state only.
bool getAllowsPacking() const
virtual agx::Real getValue() const =0
virtual void calculateJacobian(agx::Jacobian6DOFElement *G, agx::Real ratio, size_t index) const =0
virtual agx::Vec3 getDirection() const =0
virtual void postUpdate(agx::Real timeStep)=0
virtual void setValue(agx::Real value)=0
virtual agx::Vec3 getLocalDirection() const =0
const agxPowerLine::PhysicalDimension * getDimension() const
agx::RigidBody * getCurrentBody()
Returns the body currently used by this dimension state.
virtual void addNotification(agxPowerLine::PowerLine *powerLine)=0
virtual void removeNotification(agxPowerLine::PowerLine *powerLine)=0
virtual agxPowerLine::DirectionReference getDirectionReference() const =0
virtual void setVelocityDamping(float damping)=0
virtual float getVelocityDamping()=0
virtual agx::Vec3 getWorldDirection() const =0
const agx::RigidBody * getCurrentBody() const
virtual agx::Real getSecondGradient() const =0
virtual bool setMassProperty(agx::Real massProperty)=0
virtual void reserveBody()=0
Reserve a body for this dimension state.
virtual agx::Real getGradient() const =0
virtual void addLoad(agx::Real load)=0
Class for writing serialized data in binary format to a stream.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Abstract base class for storing/restoring a line/drums with version control.
Structure holding several "normal" rigid bodies.
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
agxPowerLine contains a collection of connected components that transport power across a system.
DirectionReference
The DirectionReference specifies what the direction attribute of a DimensionState is relative to.
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.