174 void calculateWorkFromExternalForces( const
agx::Physics::RigidBodyData& rigidBody );
178 void calculateWorkFromBinaryConstraints( const
agx::Physics::BinaryConstraintData& binaryConstraint,
179 const
agx::Physics::ConstraintRowData& binaryConstraintRow,
180 const
agxData::Array<
agx::Jacobian6DOFElement >& binaryConstraintJacobian,
181 const
agx::Physics::RigidBodyData& rigidBody );
185 void calculateWorkFromManyBodyConstraints( const
agx::Physics::ManyBodyConstraintData& manyBodyConstraint,
186 const
agx::Physics::ConstraintRowData& manyBodyConstraintRow,
187 const
agxData::Array<
agx::Jacobian6DOFElement >& manyBodyConstraintJacobian,
188 const
agx::Physics::RigidBodyData& rigidBody );
230 : potential( initValue ), dissipation( initValue )
256 UpdateListener( EnergyManager* energyManager );
260 virtual ~UpdateListener();
267 friend class Simulation;
285 void calculateEnergyForElementaryConstraint(
agx::Real& potential,
agx::Real& dissipation,
288 const agx::Physics::ConstraintRowData& binaryConstraintRow,
291 const agx::Physics::RigidBodyData& rigidBody );
293 void calculateWorkOnBody(
agx::Real& potential,
agx::Real& dissipation,
const EnergyManager::RigidBodyData& rbData,
300 RigidBodyDataContainer m_rbData;
301 EnergyChangeBodyContainer m_energyChangeBodies;
302 EnergyChangeConstraintContainer m_energyChangeConstraints;
303 EnergyChangeScContainer m_energyChangeSc;
305 RigidBodyConstRefVector m_rigidBodies;
306 ConstraintConstRefVector m_constraints;
308 agxSDK::SimulationObserver m_simulation;
309 UpdateListenerRef m_updateListener;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Type-specific Array used for fast access into the data held by a Buffer.
Keeps track of the energy flow in the system.
agx::Real getDissipation(const agx::Constraint *constraint) const
Get the dissipation for a constraint during the last timestep.
void add(const agx::Constraint *constraint)
Enables energy calculations for a constraint.
agx::Real getPotentialChange(const agx::RigidBody *rb) const
Get the change in gravity potential for a rigid body during the last timestep.
agx::Real getRotationalEnergyChange(const agx::RigidBody *rb) const
Get the change in kinetic energy from the rotational motion for a rigid body during the last time ste...
static agx::Real getRotationalEnergy(const agx::RigidBody *rb)
Get the rotational part of the kinetic energy of a rigid body.
agx::Real getTranslationalEnergyChange(const agx::RigidBody *rb) const
Get the change in kinetic energy from the translational motion for a rigid body during the last time ...
agx::Real getPotentialChange(const agx::Constraint *constraint) const
Get the change in potential for a constraint during the last timestep.
void remove(const agx::Constraint *constraint)
Removes the constraint from the EnergyManager.
agx::Real getKineticEnergyChange(const agx::RigidBody *rb) const
Get the change in kinetic energy for a rigid body during the last time step.
agx::Real getPotentialChange(const agx::ElementaryConstraint *constraint) const
Get the change in potential for a secondary constraint during the last timestep.
void remove(const agx::RigidBody *rigidBody)
Removes the rigid body from the EnergyManager.
static agx::Real getKineticEnergy(const agx::RigidBody *rb)
Get the kinetic energy for a rigid body.
agx::Real getDissipation(const agx::RigidBody *rb) const
Get the dissipation from linear and angular velocity damping and external forces.
void add(const agx::RigidBody *rigidBody)
Enables energy calculations for a rigid body.
agx::Real getDissipation(const agx::ElementaryConstraint *constraint) const
Get the dissipation for a secondary constraint during the last timestep.
agx::Real getPower(const agx::ElementaryConstraint *motor) const
Get the power from a constraint motor.
static agx::Real getTranslationalEnergy(const agx::RigidBody *rb)
Get the translational part of the kinetic energy of a rigid body.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Derive from this class to implement a listener for simulation step events.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
The base class for a constraint.
Elementary constraint base class with interface and global constraint functionality.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
Contains classes for low level data storage for AGX.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
agx::observer_ptr< Simulation > SimulationObserver
agx::observer_ptr< EnergyManager > EnergyManagerObserver
AGXTERRAIN_EXPORT void clear()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.