AGX Dynamics  2.35.0.1
RotationalUnit.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXPOWERLINE_ROTATIONAL_UNIT_H
18 #define AGXPOWERLINE_ROTATIONAL_UNIT_H
19 
20 #include <agxModel/export.h>
22 #include <agxPowerLine/Unit.h>
23 
24 namespace agxPowerLine
25 {
30  {
31  public:
36 
37 
39 
43  virtual agx::Real getDeliveredTorque() const;
44 
49 
53  agx::Real getRPM() const;
54 
59 
64 
68  virtual void setInertia( agx::Real inertia );
69 
70  virtual agx::Real getInertia() const;
71 
75  virtual agx::Vec3 getDirection() const;
76 
82 
86  virtual bool preUpdate(agx::Real timeStep) override;
87 
90  virtual bool postUpdate(agx::Real timeStep) override;
91 
95  virtual bool store(agxStream::StorageStream& str) const override;
96 
100  virtual bool restore(agxStream::StorageStream& str) override;
101 
103 
104  protected:
105  virtual ~RotationalUnit();
106 
107  protected:
109  };
110 
112 }
113 
114 #endif // AGXMODEL_ROTATIONAL_UNIT_H
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXMODEL_EXPORT
The rotational has one rotational degree of freedom.
A rotational unit has one degree of freedom.
virtual agx::Vec3 getDirection() const
returns a vector in world coordinates that defines the rotational axis of the rotational unit.
virtual bool postUpdate(agx::Real timeStep) override
virtual agx::Real getDeliveredTorque() const
returns the amount of torque delivered from the rotational dimension
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
static agx::Real convertRPMtoAngularVelocity(const agx::Real rpm)
RotationalUnit()
Create a rotational unit.
agxPowerLine::RotationalDimension * getRotationalDimension() const
returns a pointer to the rotational dimension
static agx::Real convertAngularVelocityToRPM(const agx::Real angVel)
Convert between m/s and rpm.
RotationalUnit(agx::RigidBody *body, agx::UInt8 slot)
agx::Real getRPM() const
returns the number of revolutions per minute
virtual bool preUpdate(agx::Real timeStep) override
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
virtual void setInertia(agx::Real inertia)
set the inertia for the rotational dimension of the rotational unit.
void setAngularVelocityDamping(agx::Real damping)
set the angular velocity damping around the local axis (direction)
RotationalDimensionRef m_rotationalDimension
agx::Real getAngularVelocity() const
returns the number of radians per second
virtual agx::Real getInertia() const
Pure virtual class.
Definition: Unit.h:73
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24
agx::ref_ptr< RotationalUnit > RotationalUnitRef
double Real
Definition: Real.h:42
uint8_t UInt8
Definition: Integer.h:38