From: <sv...@ww...> - 2004-06-29 11:20:33
|
Author: delta Date: 2004-06-29 04:20:27 -0700 (Tue, 29 Jun 2004) New Revision: 1116 Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp Log: Landing gear position bug at start up. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1116 Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-06-29 11:18:18 UTC (rev 1115) +++ trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-06-29 11:20:27 UTC (rev 1116) @@ -327,9 +327,9 @@ m_Model = adjust; simdata::Matrix3 sd_adjust = simdata::fromOSG(model_orientation); //.getInverse(); for (unsigned i = 0; i < m_Contacts.size(); i++) { - m_Contacts[i] = sd_adjust * m_Contacts[i] + m_Offset; + m_Contacts[i] = sd_adjust * m_Contacts[i] + m_Offset; } - m_ViewPoint = sd_adjust * m_ViewPoint + m_Offset; + m_ViewPoint = sd_adjust * m_ViewPoint + m_Offset; } osg::BoundingSphere s = m_Model->getBound(); @@ -504,10 +504,13 @@ size_t n = m_LandingGear.size(); if (n>0) { m_GearSprites = new osg::Group; + m_GearSprites->setName("GearSprites"); makeFrontGear(m_LandingGear[0]); makeLeftGear(m_LandingGear[1]); makeRightGear(m_LandingGear[2]); m_DebugMarkers->addChild(m_GearSprites.get()); + simdata::Vector3 move[3] = {simdata::Vector3::ZERO,simdata::Vector3::ZERO,simdata::Vector3::ZERO}; + updateGearSprites(std::vector<simdata::Vector3>(move,move+3)); } } @@ -520,7 +523,7 @@ osg::Node *node = m_GearSprites->getChild(j); osg::PositionAttitudeTransform *pos = dynamic_cast<osg::PositionAttitudeTransform*>(node); if (pos && i < move.size()) { - osg::Vec3 p = osg::Vec3(m_LandingGear[i].x(),m_LandingGear[i].y(),move[i].z()); + osg::Vec3 p(m_LandingGear[i].x(),m_LandingGear[i].y(),move[i].z()); pos->setPosition(p); ++i; } |