[Gcblue-commits] gcb_wx/src/graphics tc3DModel.cpp,1.21,1.22 tcNumberWidget.cpp,1.1,1.2
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:33:28
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20374/src/graphics Modified Files: tc3DModel.cpp tcNumberWidget.cpp Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tc3DModel.cpp 27 Jan 2005 01:01:48 -0000 1.21 --- tc3DModel.cpp 31 Jan 2005 01:33:07 -0000 1.22 *************** *** 350,353 **** --- 350,370 ---- } + /** + * Retrieves launcher info for launcher <idx> + * Zero is used as default if idx out of range + */ + void tc3DModel::GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az) + { + if (idx >= launcherInfo.size()) + { + pos.set(0, 0, 0); + az = 0; + return; + } + + pos = launcherInfo[idx].position; + az = launcherInfo[idx].pointingAzimuth; + } + osg::ref_ptr<osg::Node> tc3DModel::GetNode() { *************** *** 471,474 **** --- 488,493 ---- LoadXmlAnimationInfo(doc); + LoadXmlMountInfo(doc); + LoadXmlSmokeInfo(doc); *************** *** 540,543 **** --- 559,594 ---- } + /** + * + */ + void tc3DModel::LoadXmlMountInfo(TiXmlDocument* doc) + { + launcherInfo.clear(); + + TiXmlNode* current = doc->FirstChild("Launcher"); + while (current) + { + if (TiXmlElement* elt = current->ToElement()) + { + LauncherMountInfo info; + double x = 0; + double y = 0; + double z = 0; + double az = 0; + + elt->Attribute("X", &x); + elt->Attribute("Y", &y); + elt->Attribute("Z", &z); + elt->Attribute("Az", &az); + + info.position.set(x, y, z); + info.pointingAzimuth = az; + + launcherInfo.push_back(info); + + } + current = current->NextSibling("Launcher"); + } + } /** Index: tcNumberWidget.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNumberWidget.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcNumberWidget.cpp 28 Dec 2004 00:41:35 -0000 1.1 --- tcNumberWidget.cpp 31 Jan 2005 01:33:07 -0000 1.2 *************** *** 261,265 **** caption = "NULL"; isMouseOver = false; ! soundEffect = -1; fontSize = 10.0f; backgroundAlpha = 1.0f; --- 261,265 ---- caption = "NULL"; isMouseOver = false; ! soundEffect = ""; fontSize = 10.0f; backgroundAlpha = 1.0f; |