Momentum Scripting v1
Loading...
Searching...
No Matches
SpringJoint.h
1/*
2Copyright 2007-2025. 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 without having a written signed agreement with Algoryx Simulation AB.
9
10Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
11from using this software, unless otherwise stated in written agreements with
12Algoryx Simulation AB.
13*/
14
15#ifndef MOMENTUM_SPRINGJOINT_H
16#define MOMENTUM_SPRINGJOINT_H
17
18#include "momentum_export.h"
19#include "momentum_namespace.h"
20
21#include "Joint.h"
22
23#include "LinearMotor.h"
24#include "LinearSpring.h"
25#include "LinearRange.h"
26
27#ifndef SWIG
29namespace agx
30{
31 class DistanceJoint;
32}
34#endif
35
36namespace MOMENTUM_NAMESPACE
37{
41 class MOMENTUM_EXPORT SpringJoint : public Joint
42 {
43 public:
44#ifndef SWIG
46
49 SpringJoint(agx::DistanceJoint* distanceJoint);
50
56#endif
57
61 std::shared_ptr<LinearMotor> getMotor() const;
62
66 std::shared_ptr<LinearSpring> getSpring() const;
67
71 std::shared_ptr<LinearRange> getRange() const;
72
77 double getSpringElasticity() const;
78
79#ifndef AGX_MOMENTUM_ANALYSIS_API
86 void setSpringElasticity(double elasticity);
87#endif
88
93 double getSpringDamping() const;
94
95#ifndef AGX_MOMENTUM_ANALYSIS_API
102 void setSpringDamping(double damping);
103#endif
104
109 double getCurrentLength() const;
110
112 virtual ~SpringJoint();
113 virtual std::string __str__() const;
115
116 protected:
119 private:
120#ifndef SWIG
122 agx::DistanceJoint* getDistanceJoint() const;
124#endif
125 };
126
127 V1_DECLARE_CONTAINER_TYPE(SpringJoint);
128
129} // namespace momentum
130
131
132#endif
Base class for all joints.
Definition: Joint.h:51
DegreeOfFreedom
Definition: Joint.h:54
A spring joint is a joint which will try to restore the distance between attached bodies.
Definition: SpringJoint.h:42
virtual int getAgxRotationalDOF(Joint::DegreeOfFreedom dof) const
void setSpringElasticity(double elasticity)
Set the elasticity of the spring, in the unit of Newton per meter.
double getCurrentLength() const
Get the current distance between the attachment points of the spring, in meters.
double getSpringDamping() const
Get the damping of the spring, in the unit of Newton-seconds per meter.
double getSpringElasticity() const
Get the elasticity of the spring, in the unit of Newton per meter.
std::shared_ptr< LinearMotor > getMotor() const
Get the motor of the translational z-axis.
std::shared_ptr< LinearRange > getRange() const
Get the range of the translational z-axis.
void setSpringDamping(double damping)
Set the damping of the spring, in the unit of Newton-seconds per meter.
std::shared_ptr< LinearSpring > getSpring() const
Get the spring of the translational z-axis.
virtual int getAgxTranslationalDOF(Joint::DegreeOfFreedom dof) const
Namespace for Momentum Scripting API.
Definition: AffineMatrix4x4.h:29