AGX Dynamics  2.37.2.0
WireTensionData.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 #pragma once
18 
19 #include <agxWire/Node.h>
20 
21 namespace agxWire
22 {
27  {
29  WireSegmentTensionData( agx::Real rawTension, agx::Real smoothedTension );
30  explicit WireSegmentTensionData( const agxWire::Node::Tension* tension );
31 
34  };
35 
41  {
46 
50  WireNodeTensionData( const agxWire::Node::Tension* currNodeTension, const agxWire::Node::Tension* nextNodeTension );
51 
55  agx::Real getAverageRaw() const;
56 
60  agx::Real getAverageSmoothed() const;
61 
65  agx::Real getRaw() const;
66 
70  agx::Real getSmoothed() const;
71 
74  };
75 
77 
78 
80  : raw( agx::Real( 0 ) ), smoothed( agx::Real( 0 ) )
81  {
82  }
83 
84  inline WireSegmentTensionData::WireSegmentTensionData( agx::Real rawTension, agx::Real smoothedTension )
85  : raw( rawTension ), smoothed( smoothedTension )
86  {
87  }
88 
89  inline WireSegmentTensionData::WireSegmentTensionData( const Node::Tension* tension )
90  : raw( tension != nullptr ? tension->raw : agx::Real( 0 ) ), smoothed( tension != nullptr ? tension->smoothed : agx::Real( 0 ) )
91  {
92  }
93 
95  : prev(), next()
96  {
97  }
98 
99  inline WireNodeTensionData::WireNodeTensionData( const Node::Tension* currNodeTension, const Node::Tension* nextNodeTension )
100  : prev( currNodeTension ), next( nextNodeTension )
101  {
102  }
103 
105  {
106  return agx::Real( 0.5 ) * ( prev.raw + next.raw );
107  }
108 
110  {
111  return agx::Real( 0.5 ) * ( prev.smoothed + next.smoothed );
112  }
113 
115  {
116  return prev.raw;
117  }
118 
120  {
121  return prev.smoothed;
122  }
123 
125 
126 }
127 
agx::Real smoothed
Smoothed tension value given the current smoothing filter.
#define AGXPHYSICS_EXPORT
Structure containing relevant tension data for a wire element/segment.
agx::Real getAverageSmoothed() const
Structure containing relevant tension data for a node.
agx::Real getSmoothed() const
WireNodeTensionData()
Default constructor - all values default.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:39
WireSegmentTensionData next
Segment after node (this node is begin node to that segment) tension data.
agx::Real raw
Raw tension value.
WireSegmentTensionData prev
Segment before node (this node is end node to that segment) tension data.
agx::Real getRaw() const
double Real
Definition: Real.h:42
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
agx::Real getAverageRaw() const