AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
WireTensionData.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 <agxWire/Node.h>
20
21namespace 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
56
61
66
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
#define AGXPHYSICS_EXPORT
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition macros.h:96
Implements a Wire model with adaptive resolution.
Definition MergedBody.h:40
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition Real.h:42
Structure containing relevant tension data for a node.
WireNodeTensionData()
Default constructor - all values default.
WireNodeTensionData(const agxWire::Node::Tension *currNodeTension, const agxWire::Node::Tension *nextNodeTension)
Construct given node tension data for current node (for prev segment) and next node in (for next segm...
agx::Real getSmoothed() const
WireSegmentTensionData next
Segment after node (this node is begin node to that segment) tension data.
agx::Real getAverageRaw() const
agx::Real getRaw() const
agx::Real getAverageSmoothed() const
WireSegmentTensionData prev
Segment before node (this node is end node to that segment) tension data.
Structure containing relevant tension data for a wire element/segment.
agx::Real smoothed
Smoothed tension value given the current smoothing filter.
WireSegmentTensionData(const agxWire::Node::Tension *tension)
WireSegmentTensionData(agx::Real rawTension, agx::Real smoothedTension)
agx::Real raw
Raw tension value.