Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
Joint.h
1// trax track library
2// AD 2015
3//
4// "the resolution of all the fruitless searches"
5//
6// Peter Gabriel
7//
8//
9// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
10// Copyright (c) 2019 Marc-Michael Horstmann
11//
12// Permission is hereby granted to any person obtaining a copy of this software
13// and associated source code (the "Software"), to use, view, and study the
14// Software for personal or internal business purposes, subject to the following
15// conditions:
16//
17// 1. Redistribution, modification, sublicensing, or commercial use of the
18// Software is NOT permitted without prior written consent from the copyright
19// holder.
20//
21// 2. The Software is provided "AS IS", without warranty of any kind, express
22// or implied.
23//
24// 3. All copies of the Software must retain this license notice.
25//
26// For further information, please contact: horstmann.marc@trendverlag.de
27
28#pragma once
29
36
37#include "trax/Identified.h"
38#include "trax/Units.h"
39
40#include "spat/Frame.h"
41
42#include <memory>
43
44namespace trax{
45
46 struct Body;
47
48 struct Joint
49 {
54 virtual void SetName( const char* name ) noexcept = 0;
55
56
58 virtual const char* GetName() const noexcept = 0;
59
60
62 virtual Body* BodyA() const noexcept = 0;
63
64
66 virtual void BodyA( Body* pBody ) = 0;
67
68
70 virtual spat::Frame<Length,One> LocalPoseA() const noexcept = 0;
71
72
74 // virtual void LocalPoseA( const spat::Frame<Length,One>& pose ) const noexcept = 0;
75
76
78 virtual Body* BodyB() const noexcept = 0;
79
80
82 virtual void BodyB( Body* pBody ) = 0;
83
84
86 virtual spat::Frame<Length,One> LocalPoseB() const noexcept = 0;
87
88
90 // virtual void LocalPoseB( const spat::Frame<Length,One>& pose ) const noexcept = 0;
91
92 virtual ~Joint() = default;
93 };
94
95
97 {
99 virtual spat::VectorBundle<Length,One> LocalAxisA() const noexcept = 0;
100
102 virtual spat::VectorBundle<Length,One> LocalAxisB() const noexcept = 0;
103
105 virtual Angle GetTurnAngle() const noexcept = 0;
106
108 virtual Angle GetBendAngle() const noexcept = 0;
109
111 virtual Angle GetPitchAngle() const noexcept = 0;
112 };
113
114
116 {
117 virtual Length GetPosition() const noexcept = 0;
118
119
120 virtual void SetPosition( Length position ) const noexcept = 0;
121 };
122
123
125 {
126
127
128 };
129
130
132 {
133 virtual Length GetDistance() const noexcept = 0;
134
135 virtual void SetDistance( Length distance ) const noexcept = 0;
136
137 virtual spat::Vector<Force> GetForce() const noexcept = 0;
138 };
139}
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
Value< Dimension< 0, 0, 0 > > Angle
Angle in radians.
Definition DimensionedValues.h:320
The namespace provides classes and methods for spatial computations.
Definition Box.h:32
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
Implements a Vector bundle.
Definition VectorBundle.h:42
Implements a 3D - vector in cartesian coordinates.
Definition Vector.h:48
Definition Joint.h:125
A dynamic object in physical space.
Definition Body.h:44
Definition Joint.h:132
Definition Joint.h:97
virtual Angle GetPitchAngle() const noexcept=0
virtual Angle GetTurnAngle() const noexcept=0
virtual Angle GetBendAngle() const noexcept=0
virtual spat::VectorBundle< Length, One > LocalAxisA() const noexcept=0
virtual spat::VectorBundle< Length, One > LocalAxisB() const noexcept=0
Definition Joint.h:49
virtual Body * BodyA() const noexcept=0
The dominant body of the connection.
virtual Body * BodyB() const noexcept=0
Set the pose of the joint in the local coordinate system of body A.
virtual void SetName(const char *name) noexcept=0
Sets the name of the Joint.
virtual spat::Frame< Length, One > LocalPoseA() const noexcept=0
The pose of the joint in the local coordinate system of body A.
virtual spat::Frame< Length, One > LocalPoseB() const noexcept=0
The pose of the joint in the local coordinate system of body B.
virtual const char * GetName() const noexcept=0
Definition Joint.h:116