Momentum Scripting v1
Deprecated API version. Use Momentum.v2 for new scripts.
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{
42 class MOMENTUM_EXPORT SpringJoint : public Joint
43 {
44 public:
45#ifndef SWIG
47
50 SpringJoint(agx::DistanceJoint* distanceJoint);
51
57#endif
58
62 std::shared_ptr<LinearMotor> getMotor() const;
63
67 std::shared_ptr<LinearSpring> getSpring() const;
68
72 std::shared_ptr<LinearRange> getRange() const;
73
78 double getSpringElasticity() const;
79
80#ifndef AGX_MOMENTUM_ANALYSIS_API
87 void setSpringElasticity(double elasticity);
88#endif
89
94 double getSpringDamping() const;
95
96#ifndef AGX_MOMENTUM_ANALYSIS_API
103 void setSpringDamping(double damping);
104#endif
105
110 double getCurrentLength() const;
111
113 virtual ~SpringJoint();
114 virtual std::string __str__() const;
116
117 protected:
120 private:
121#ifndef SWIG
123 agx::DistanceJoint* getDistanceJoint() const;
125#endif
126 };
127
128 V1_DECLARE_CONTAINER_TYPE(SpringJoint);
129
130} // namespace momentum
131
132
133#endif
Base class for all joints.
Definition: Joint.h:52
DegreeOfFreedom
Definition: Joint.h:55
A spring joint is a joint which will try to restore the distance between attached bodies.
Definition: SpringJoint.h:43
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