47 #include "FGFDMExec.h" 48 #include "models/FGPropagate.h" 49 #include "models/FGMassBalance.h" 50 #include "models/FGAuxiliary.h" 56 IDENT(IdSrc,
"$Id: FGForce.cpp,v 1.19 2014/01/13 10:46:10 ehofman Exp $");
57 IDENT(IdHdr,ID_FORCE);
70 vActingXYZn.InitMatrix();
94 vFb = Transform()*vFn;
102 vM = vMn + vDXYZ*vFb;
109 const FGMatrix33& FGForce::Transform(
void)
const 120 cout <<
"Unrecognized tranform requested from FGForce::Transform()" << endl;
127 void FGForce::UpdateCustomTransformMatrix(
void)
129 double cp,sp,cr,sr,cy,sy;
130 double srsp, crcy, crsy;
132 cp=cos(vOrient(ePitch)); sp=sin(vOrient(ePitch));
133 cr=cos(vOrient(eRoll)); sr=sin(vOrient(eRoll));
134 cy=cos(vOrient(eYaw)); sy=sin(vOrient(eYaw));
144 mT(1,2) = srsp*cy - crsy;
145 mT(2,2) = srsp*sy + crcy;
148 mT(1,3) = crcy*sp + sr*sy;
149 mT(2,3) = crsy*sp - sr*cy;
155 void FGForce::SetAnglesToBody(
double broll,
double bpitch,
double byaw)
157 if (ttype == tCustom) {
158 vOrient(ePitch) = bpitch;
159 vOrient(eRoll) = broll;
160 vOrient(eYaw) = byaw;
162 UpdateCustomTransformMatrix();
185 void FGForce::Debug(
int from)
187 if (debug_lvl <= 0)
return;
194 if (debug_lvl & 2 ) {
195 if (from == 0) cout <<
"Instantiated: FGForce" << endl;
196 if (from == 1) cout <<
"Destroyed: FGForce" << endl;
198 if (debug_lvl & 4 ) {
200 if (debug_lvl & 8 ) {
202 if (debug_lvl & 16) {
204 if (debug_lvl & 64) {
206 cout << IdSrc << endl;
207 cout << IdHdr << endl;
const FGMatrix33 & GetTw2b(void)
Calculates and returns the wind-to-body axis transformation matrix.
const FGMatrix33 & GetTl2b(void) const
Retrieves the local-to-body transformation matrix.
FGAuxiliary * GetAuxiliary(void)
Returns the FGAuxiliary pointer.
This class implements a 3 element column vector.
Handles matrix math operations.
void InitMatrix(void)
Initialize the matrix.
Encapsulates the JSBSim simulation executive.
FGColumnVector3 StructuralToBody(const FGColumnVector3 &r) const
Conversion from the structural frame to the body frame.
FGPropagate * GetPropagate(void)
Returns the FGPropagate pointer.
FGMassBalance * GetMassBalance(void)
Returns the FGAircraft pointer.