From: <mk...@us...> - 2003-08-06 07:56:59
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv31730/Source Modified Files: AircraftObject.cpp Log Message: Index: AircraftObject.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AircraftObject.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** AircraftObject.cpp 6 Aug 2003 06:25:18 -0000 1.29 --- AircraftObject.cpp 6 Aug 2003 07:56:56 -0000 1.30 *************** *** 524,536 **** void AircraftObject::setAttitude(double pitch, double roll, double heading) { - simdata::Quat attitude; m_Pitch = pitch; m_Roll = roll; m_Heading = heading; // use standard Euler convension (X axis is roll, Y is pitch, Z is yaw). ! //attitude = simdata::Quat::MakeQFromEulerAngles(m_Roll, m_Pitch, -m_Heading); // old-style ! attitude.makeRotate(m_Roll, m_Pitch, -m_Heading); ! DynamicObject::setAttitude(attitude); } --- 524,537 ---- void AircraftObject::setAttitude(double pitch, double roll, double heading) { m_Pitch = pitch; m_Roll = roll; m_Heading = heading; + simdata::Quat attitude; // use standard Euler convension (X axis is roll, Y is pitch, Z is yaw). ! attitude.makeRotate(m_Roll, m_Pitch, m_Heading); ! // convert to CSP coordinate system (X axis is pitch, Y axis is roll, -Z is yaw) ! simdata::Quat modified(m_Attitude.y(), m_Attitude.x(), -m_Attitude.z(), m_Attitude.w()); ! DynamicObject::setAttitude(modified); } *************** *** 552,564 **** ///updateTransform(); ! // modified Euler angles are the CSP frame (X is pitch, Y is roll, Z is -yaw). ! double yaw; ! m_Attitude.getEulerAngles(m_Roll, m_Pitch, yaw); ! m_Heading = -yaw; ! ! //simdata::Vector3 angles = simdata::Quat::MakeModifiedEulerAnglesFromQ(m_Attitude); // old-style ! //m_Pitch = angles.x(); ! //m_Roll = angles.y(); ! //m_Heading = angles.z(); m_Speed = m_LinearVelocity.length(); --- 553,559 ---- ///updateTransform(); ! // convert from CSP frame to standard Euler (X is roll, Y is pitch, Z is yaw) ! simdata::Quat modified(m_Attitude.y(), m_Attitude.x(), -m_Attitude.z(), m_Attitude.w()); ! modified.getEulerAngles(m_Roll, m_Pitch, m_Heading); m_Speed = m_LinearVelocity.length(); |