AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
TranslationalDimension.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agxModel/export.h>
23
25
26#include <agxUtil/agxUtil.h>
27
28#include <agx/RigidBody.h>
30
31namespace agxPowerLine
32{
33
35
36 #define DEFAULT_TRANSLATIONAL_DIRECTION agx::Vec3(0, 1, 0)
37
38 class TranslationalUnit;
39
46 class AGXMODEL_EXPORT TranslationalDimension : public agxPowerLine::PhysicalDimension
47 {
48 public:
54 TranslationalDimension(agxPowerLine::Unit* unit);
55
61 TranslationalDimension(
63 agx::RigidBody* body,
64 const agx::Vec3& direction,
65 agxPowerLine::DirectionReference directionReference,
66 bool externalBody = false);
67
72 static std::string getStaticTypeName();
73
77 virtual std::string getTypeName() const override;
78
82 virtual void renderDebug() override;
83
84 void setVelocity(agx::Real velocity);
85 agx::Real getVelocity() const;
86
90 virtual agx::Real getOutputLoad() const override;
91 virtual agx::Real getInputLoad() const override;
92 agx::Real getOutputForce() const;
93 agx::Real getInputForce() const;
94
95
99 virtual agx::Real getPowerIn() const override;
100 virtual agx::Real getPowerOut() const override;
101
105 virtual agx::Vec3 getWorldDirection() const;
106
114 static agxPowerLine::PhysicalDimension::Type getStaticType();
115
119 virtual bool store(agxStream::StorageStream& out) const override;
120
124 virtual bool restore(agxStream::StorageStream& in) override;
125
126 AGXSTREAM_DECLARE_SERIALIZABLE(agxPowerLine::TranslationalDimension);
127
128 protected:
129 TranslationalDimension();
130 virtual ~TranslationalDimension();
131 };
132
133
134 typedef agx::ref_ptr<TranslationalDimension> TranslationalDimensionRef;
135
139 class AGXMODEL_EXPORT TranslationalConnector : public agxPowerLine::Connector
140 {
141 public:
142 TranslationalConnector();
143
144 virtual PhysicalDimensionMultiBodyConstraintImplementation* createConstraint() override;
145 virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping( const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
146
150 virtual bool store(agxStream::StorageStream& out) const override;
151
155 virtual bool restore(agxStream::StorageStream& in) override;
156
157 AGXSTREAM_DECLARE_SERIALIZABLE(agxPowerLine::TranslationalConnector);
158
159 protected:
160 virtual ~TranslationalConnector() {}
161 };
162
163 typedef agx::ref_ptr<TranslationalConnector> TranslationalConnectorRef;
164
166}
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXMODEL_EXPORT
Links two connections together.
Definition Connector.h:53
Pure virtual class.
Definition Unit.h:72
Abstract base class for storing/restoring a line/drums with version control.
The rigid body class, combining a geometric model and a frame of reference.
Definition RigidBody.h:52
Smart pointer for handling referenced counted objects.
Definition ref_ptr.h:30
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition macros.h:96
agxPowerLine contains a collection of connected components that transport power across a system.
Definition MotorUnit.h:24
DirectionReference
The DirectionReference specifies what the direction attribute of a DimensionState is relative to.
double Real
Definition Real.h:42