WSF
WsfSixDOF_MassProperties.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2020 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFSIXDOFMASSPROPERTIES_HPP
13#define WSFSIXDOFMASSPROPERTIES_HPP
14
15#include "wsf_six_dof_export.h"
16
17class UtInput;
18#include "UtVec3dX.hpp"
19
20namespace wsf
21{
22namespace six_dof
23{
24// MassProperties provides mass and rotational inertia properties for
25// Mover objects. It also provides functions to "build-up" mass properties
26// including those from subobjects (Movers) as well as contributors
27// from consumables such as fuel.
28class WSF_SIX_DOF_EXPORT MassProperties
29{
30public:
31 bool ProcessInput(UtInput& aInput);
32
33 // This is the "preferred" method of adding mass properties
35
36 // These functions provide the "current" values
37 double GetMass_lbs() const;
38 double GetIxx_slugft2() const;
39 double GetIyy_slugft2() const;
40 double GetIzz_slugft2() const;
41 UtVec3dX GetCmPosRelToRef_ft() const;
42
43 // These functions provide the "base" values
44 double GetBaseMass_lbs() const;
45 double GetBaseIxx_slugft2() const;
46 double GetBaseIyy_slugft2() const;
47 double GetBaseIzz_slugft2() const;
48 UtVec3dX GetBaseCmPosRelToRef_ft() const;
49
50 // This sets all mass properties data to zero
51 void ClearData();
52
53 // This sets the current properties to the base properties
55
56 // This sets the base properties and (internally) set the current properties
57 void SetBaseMassProperties(double aBaseMass_lbm, const UtVec3dX& aBaseCmPosRelToRef_ft);
58
59 // This sets the base properties and (internally) set the current properties
60 void SetBaseMassProperties(double aBaseMass_lbm,
61 double aBaseIxx_slugft2,
62 double aBaseIyy_slugft2,
63 double aBaseIzz_slugft2,
64 const UtVec3dX& aBaseCmPosRelToRef_ft);
65
66 // This adds a mass, with the specified rotational inertia,
67 // at the specified location
68 void AddMassAtLocation(double aMass_lbm, const UtVec3dX& aLocation_ft);
69
70 // This adds a mass, with the specified rotational inertia,
71 // at the specified location
72 void AddMassAtLocation(double aMass_lbm,
73 double aIxx_slugft2,
74 double aIyy_slugft2,
75 double aIzz_slugft2,
76 const UtVec3dX& aLocation_ft);
77
78 // This is a convenience function to apply rotational inertia
79 // from an additional mass
80 void AddInertiaFromParallelAxis(double aAdditionalMass_lbm,
81 const UtVec3dX& aPositionDelta_ft,
82 double& aIxx_slugft2,
83 double& aIyy_slugft2,
84 double& aIzz_slugft2);
85
86 // This moves to a new reference point
87 void MoveToLocation(const UtVec3dX& aLocation_ft);
88
89protected:
90 double mBaseMass_lbm = 0.0;
91 double mBaseIxx_slugft2 = 0.0;
92 double mBaseIyy_slugft2 = 0.0;
93 double mBaseIzz_slugft2 = 0.0;
94 UtVec3dX mBaseCmPosRelToRef_ft; // CM location relative to reference point
95
96 double mCurrentMass_lbm = 0.0;
97 double mCurrentIxx_slugft2 = 0.0;
98 double mCurrentIyy_slugft2 = 0.0;
99 double mCurrentIzz_slugft2 = 0.0;
100 UtVec3dX mCurrentCmPosRelToRef_ft; // CM location relative to reference point
101};
102} // namespace six_dof
103} // namespace wsf
104
105#endif
Definition WsfSixDOF_MassProperties.hpp:29
MassProperties & operator+=(const MassProperties &aSrc)
Definition WsfSixDOF_MassProperties.cpp:35
double mBaseIyy_slugft2
Definition WsfSixDOF_MassProperties.hpp:92
double mCurrentIxx_slugft2
Definition WsfSixDOF_MassProperties.hpp:97
void SetBaseMassProperties(double aBaseMass_lbm, const UtVec3dX &aBaseCmPosRelToRef_ft)
Definition WsfSixDOF_MassProperties.cpp:259
bool ProcessInput(UtInput &aInput)
Definition WsfSixDOF_MassProperties.cpp:159
double mBaseIxx_slugft2
Definition WsfSixDOF_MassProperties.hpp:91
double mCurrentIzz_slugft2
Definition WsfSixDOF_MassProperties.hpp:99
double mCurrentIyy_slugft2
Definition WsfSixDOF_MassProperties.hpp:98
double mCurrentMass_lbm
Definition WsfSixDOF_MassProperties.hpp:96
void MoveToLocation(const UtVec3dX &aLocation_ft)
Definition WsfSixDOF_MassProperties.cpp:322
double GetIyy_slugft2() const
Definition WsfSixDOF_MassProperties.cpp:99
double GetBaseIyy_slugft2() const
Definition WsfSixDOF_MassProperties.cpp:114
UtVec3dX GetCmPosRelToRef_ft() const
Definition WsfSixDOF_MassProperties.cpp:124
double GetIxx_slugft2() const
Definition WsfSixDOF_MassProperties.cpp:94
double mBaseMass_lbm
Definition WsfSixDOF_MassProperties.hpp:90
void AddMassAtLocation(double aMass_lbm, const UtVec3dX &aLocation_ft)
Definition WsfSixDOF_MassProperties.cpp:317
double GetIzz_slugft2() const
Definition WsfSixDOF_MassProperties.cpp:104
double mBaseIzz_slugft2
Definition WsfSixDOF_MassProperties.hpp:93
double GetBaseMass_lbs() const
Definition WsfSixDOF_MassProperties.cpp:129
UtVec3dX mCurrentCmPosRelToRef_ft
Definition WsfSixDOF_MassProperties.hpp:100
void SetCurrentDataToBaseData()
Definition WsfSixDOF_MassProperties.cpp:150
UtVec3dX GetBaseCmPosRelToRef_ft() const
Definition WsfSixDOF_MassProperties.cpp:134
double GetBaseIzz_slugft2() const
Definition WsfSixDOF_MassProperties.cpp:119
void AddInertiaFromParallelAxis(double aAdditionalMass_lbm, const UtVec3dX &aPositionDelta_ft, double &aIxx_slugft2, double &aIyy_slugft2, double &aIzz_slugft2)
Definition WsfSixDOF_MassProperties.cpp:21
double GetBaseIxx_slugft2() const
Definition WsfSixDOF_MassProperties.cpp:109
UtVec3dX mBaseCmPosRelToRef_ft
Definition WsfSixDOF_MassProperties.hpp:94
double GetMass_lbs() const
Definition WsfSixDOF_MassProperties.cpp:89
void ClearData()
Definition WsfSixDOF_MassProperties.cpp:139
Definition WsfSA_Processor.hpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved