From: <de...@us...> - 2003-01-11 10:54:20
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv23155 Modified Files: HudGeometricElement.cpp Log Message: no message Index: HudGeometricElement.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/HudGeometricElement.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HudGeometricElement.cpp 12 Dec 2002 21:13:45 -0000 1.2 --- HudGeometricElement.cpp 11 Jan 2003 10:54:17 -0000 1.3 *************** *** 1,5 **** #include <osg/Geode> #include <osg/Geometry> - #include <osg/Math> #include "BaseObject.h" --- 1,4 ---- *************** *** 35,39 **** { unsigned short const levelsNumber = 9; ! double const hsiStepSize = .1; osg::Vec3Array* vertices = osgNew osg::Vec3Array; --- 34,38 ---- { unsigned short const levelsNumber = 9; ! double const hsiStepSize = .1; osg::Vec3Array* vertices = osgNew osg::Vec3Array; *************** *** 41,53 **** // middle segment ! vertices->push_back(osg::Vec3(-0.15 * g_ScreenWidth, 0.0, 0.0)); ! vertices->push_back(osg::Vec3(0.15 * g_ScreenWidth, 0.0, 0.0)); // fondamental vertices top: generate others segments with those ones osg::Vec3Array* fondVerticesTop = osgNew osg::Vec3Array; ! fondVerticesTop->push_back(osg::Vec3(-0.06 * g_ScreenWidth, 0.0, 0.05 * g_ScreenHeight)); ! fondVerticesTop->push_back(osg::Vec3(-0.06 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); ! fondVerticesTop->push_back(osg::Vec3(-0.01 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); unsigned short i; --- 40,52 ---- // middle segment ! vertices->push_back(osg::Vec3(-0.15 , 0.0, 0.0)); ! vertices->push_back(osg::Vec3(0.15 , 0.0, 0.0)); // fondamental vertices top: generate others segments with those ones osg::Vec3Array* fondVerticesTop = osgNew osg::Vec3Array; ! fondVerticesTop->push_back(osg::Vec3(-0.06 , 0.0, 0.05 )); ! fondVerticesTop->push_back(osg::Vec3(-0.06 , 0.0, 0.07 )); ! fondVerticesTop->push_back(osg::Vec3(-0.01 , 0.0, 0.07 )); unsigned short i; *************** *** 58,62 **** { osg::Vec3 u((*fondVerticesTop)[j]); ! vertices->push_back(u + osg::Vec3(0.0, 0.0, hsiStepSize * i * g_ScreenHeight)); } --- 57,61 ---- { osg::Vec3 u((*fondVerticesTop)[j]); ! vertices->push_back(u + osg::Vec3(0.0, 0.0, hsiStepSize * i )); } *************** *** 67,71 **** osg::Vec3 u((*fondVerticesTop)[j]); u.x() = - u.x(); ! vertices->push_back(u + osg::Vec3(0.0, 0.0, hsiStepSize * i * g_ScreenHeight)); } --- 66,70 ---- osg::Vec3 u((*fondVerticesTop)[j]); u.x() = - u.x(); ! vertices->push_back(u + osg::Vec3(0.0, 0.0, hsiStepSize * i )); } *************** *** 73,87 **** osg::Vec3Array* fondVerticesBottom = osgNew osg::Vec3Array; ! fondVerticesBottom->push_back(osg::Vec3(-0.06 * g_ScreenWidth, 0.0, 0.05 * g_ScreenHeight)); ! fondVerticesBottom->push_back(osg::Vec3(-0.06 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); ! fondVerticesBottom->push_back(osg::Vec3(-0.06 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); ! fondVerticesBottom->push_back(osg::Vec3(-0.05 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); ! fondVerticesBottom->push_back(osg::Vec3(-0.04 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); ! fondVerticesBottom->push_back(osg::Vec3(-0.03 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); ! fondVerticesBottom->push_back(osg::Vec3(-0.02 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); ! fondVerticesBottom->push_back(osg::Vec3(-0.01 * g_ScreenWidth, 0.0, 0.07 * g_ScreenHeight)); // bottom left --- 72,86 ---- osg::Vec3Array* fondVerticesBottom = osgNew osg::Vec3Array; ! fondVerticesBottom->push_back(osg::Vec3(-0.06 , 0.0, 0.05 )); ! fondVerticesBottom->push_back(osg::Vec3(-0.06 , 0.0, 0.07 )); ! fondVerticesBottom->push_back(osg::Vec3(-0.06 , 0.0, 0.07 )); ! fondVerticesBottom->push_back(osg::Vec3(-0.05 , 0.0, 0.07 )); ! fondVerticesBottom->push_back(osg::Vec3(-0.04 , 0.0, 0.07 )); ! fondVerticesBottom->push_back(osg::Vec3(-0.03 , 0.0, 0.07 )); ! fondVerticesBottom->push_back(osg::Vec3(-0.02 , 0.0, 0.07 )); ! fondVerticesBottom->push_back(osg::Vec3(-0.01 , 0.0, 0.07 )); // bottom left *************** *** 91,95 **** osg::Vec3 u((*fondVerticesBottom)[j]); u.z() = - u.z(); ! vertices->push_back(u - osg::Vec3(0.0, 0.0, hsiStepSize * i * g_ScreenHeight)); } --- 90,94 ---- osg::Vec3 u((*fondVerticesBottom)[j]); u.z() = - u.z(); ! vertices->push_back(u - osg::Vec3(0.0, 0.0, hsiStepSize * i )); } *************** *** 101,105 **** u.x() = - u.x(); u.z() = - u.z(); ! vertices->push_back(u - osg::Vec3(0.0, 0.0, hsiStepSize * i * g_ScreenHeight)); } --- 100,104 ---- u.x() = - u.x(); u.z() = - u.z(); ! vertices->push_back(u - osg::Vec3(0.0, 0.0, hsiStepSize * i )); } *************** *** 131,135 **** void HudGeometricElement::MakeFpm(float const p_radius, float const p_segLengthH, float const p_segLengthV) { ! unsigned short const verticesCircleNumber = 30; osg::Vec3Array* vertices = osgNew osg::Vec3Array; --- 130,134 ---- void HudGeometricElement::MakeFpm(float const p_radius, float const p_segLengthH, float const p_segLengthV) { ! unsigned short const verticesCircleNumber = 10; osg::Vec3Array* vertices = osgNew osg::Vec3Array; *************** *** 187,192 **** void HudGeometricElement::OnUpdateHsi() { ! m_fheadingAngle = - g_pPlayerObject->getRoll() / 60.0 ; ! m_fpitchAngle = - 8.0 * g_pPlayerObject->getPitch(); setPosition(osg::Vec3(0.0, 0.0, m_fpitchAngle)); --- 186,191 ---- void HudGeometricElement::OnUpdateHsi() { ! m_fheadingAngle = - osg::DegreesToRadians(g_pPlayerObject->getRoll()) / 2.0; ! m_fpitchAngle = - osg::DegreesToRadians(g_pPlayerObject->getPitch()) / 2.0; setPosition(osg::Vec3(0.0, 0.0, m_fpitchAngle)); *************** *** 197,202 **** void HudGeometricElement::OnUpdateFpm() { ! StandardVector3 t1 = g_pPlayerObject->getVelocity() - g_pPlayerObject->getSpeed() * g_pPlayerObject->getDirection(); ! osg::Vec3 t = osg::Vec3(t1.x, t1.y, t1.z); setPosition(t); } --- 196,202 ---- void HudGeometricElement::OnUpdateFpm() { ! StandardVector3 t1 = g_pPlayerObject->getVelocity() / g_pPlayerObject->getSpeed() - g_pPlayerObject->getDirection(); ! osg::Vec3 t = osg::Vec3(t1.x, t1.y, t1.z) / 4.0; ! //t.normalize(); setPosition(t); } |