You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(140) |
Feb
(98) |
Mar
(152) |
Apr
(104) |
May
(71) |
Jun
(94) |
Jul
(169) |
Aug
(83) |
Sep
(47) |
Oct
(134) |
Nov
(7) |
Dec
(20) |
2004 |
Jan
(41) |
Feb
(14) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(143) |
Jul
(65) |
Aug
(29) |
Sep
(40) |
Oct
(34) |
Nov
(33) |
Dec
(97) |
2005 |
Jan
(29) |
Feb
(30) |
Mar
(9) |
Apr
(37) |
May
(13) |
Jun
(31) |
Jul
(22) |
Aug
(23) |
Sep
|
Oct
(37) |
Nov
(34) |
Dec
(117) |
2006 |
Jan
(48) |
Feb
(6) |
Mar
(2) |
Apr
(71) |
May
(10) |
Jun
(16) |
Jul
(7) |
Aug
(1) |
Sep
(14) |
Oct
(17) |
Nov
(25) |
Dec
(26) |
2007 |
Jan
(8) |
Feb
(2) |
Mar
(7) |
Apr
(26) |
May
|
Jun
(12) |
Jul
(30) |
Aug
(14) |
Sep
(9) |
Oct
(4) |
Nov
(7) |
Dec
(6) |
2008 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(18) |
Aug
(15) |
Sep
(16) |
Oct
(5) |
Nov
(3) |
Dec
(10) |
2009 |
Jan
(11) |
Feb
(2) |
Mar
|
Apr
(15) |
May
(31) |
Jun
(18) |
Jul
(11) |
Aug
(26) |
Sep
(52) |
Oct
(17) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mk...@us...> - 2003-03-15 02:09:40
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv9502/Source Modified Files: GameScreen.cpp Log Message: Logstream.h->LogStream.h Index: GameScreen.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/GameScreen.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GameScreen.cpp 12 Mar 2003 21:39:28 -0000 1.7 --- GameScreen.cpp 15 Mar 2003 02:09:37 -0000 1.8 *************** *** 28,32 **** #include "GameScreen.h" #include "EventMapIndex.h" ! #include "Logstream.h" #include "VirtualBattlefield.h" --- 28,32 ---- #include "GameScreen.h" #include "EventMapIndex.h" ! #include "LogStream.h" #include "VirtualBattlefield.h" |
From: <mk...@us...> - 2003-03-15 02:09:02
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv9383 Modified Files: Makefile.in Log Message: removed -march build flag Index: Makefile.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Makefile.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.in 19 Feb 2003 21:24:15 -0000 1.2 --- Makefile.in 15 Mar 2003 02:08:58 -0000 1.3 *************** *** 5,9 **** export GDEBUGF = -g -Wall ! export GCFLAGS = -I/usr/local/include/python2.2 -fPIC -Wall -DSWIG_GLOBAL -O2 -march=athon-tbird export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -noexcept --- 5,9 ---- export GDEBUGF = -g -Wall ! export GCFLAGS = -I/usr/local/include/python2.2 -fPIC -Wall -DSWIG_GLOBAL -O2 export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -noexcept |
From: <mk...@us...> - 2003-03-14 23:08:41
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv15891 Added Files: CHANGES CHANGES.current Log Message: added change logs --- NEW FILE: CHANGES --- SimData release change log. See CHANGES.current for the latest updates to CVS. Version 0.3.0 (2003-03-??) =========================== 2003-03-14: onsight CHANGES and CHANGES.current started. First tagged version of SimData: 0.3.0 --- NEW FILE: CHANGES.current --- Version 0.3.1 (in progress) =========================== 2003-03-13: onsight * fixed several bugs related to std::vector types * fix to allow inplace (anonymous) object definitions in xml Added a logging facility so we can filter and redirect messages to a file. The syntax is similar to that used in CSP: SIMDATA_LOG(type, severity, msg) Where type is one of (LOG_TYPE, LOG_ARCHIVE, LOG_REGISTRY, ...) and severity is one of (LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ALERT, LOG_ERROR). The msg field can include the usual ostream operators (<<). Added a new postCreate() method in Object which is called after unpack() is complete. You can extend this to do additional object setup once the data is loaded. From now on, unpack() must be the exact inverse operation of pack(). Data compiler enhancements, mainly the ability to only reparse xml files that have changed since the archive was last generated. This significantly speeds up the processing. Specifying '--rebuild' on the command line will rebuild the entire archive from scratch. Big simplification of the various smart pointer types: PathPointer<T> is gone; now just use Pointer<T> for all object references. PathPointerBase is not PointerBase, and what was originally PointerBase is now ReferencedPointer (although you shouldn't need to use these classed directly). |
From: <mk...@us...> - 2003-03-14 22:02:22
|
Update of /cvsroot/csp/THIRDPARTYLIBS/demeter In directory sc8-pr-cvs1:/tmp/cvs-serv19242 Modified Files: Makefile.in Log Message: added aclocal target Index: Makefile.in =================================================================== RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.in 2 Feb 2003 20:59:22 -0000 1.3 --- Makefile.in 14 Mar 2003 22:02:18 -0000 1.4 *************** *** 68,74 **** # automatic re-running of configure if the ocnfigure.in file has changed ! ${srcdir}/configure: configure.in #aclocal.m4 cd ${srcdir} && autoconf --- 68,76 ---- + ${srcdir}/aclocal.m4: acinclude.m4 + cd ${srcdir} && aclocal # automatic re-running of configure if the ocnfigure.in file has changed ! ${srcdir}/configure: configure.in aclocal.m4 cd ${srcdir} && autoconf |
From: <de...@us...> - 2003-03-12 21:40:25
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv5786 Added Files: CHANGES.current Log Message: Log state --- NEW FILE: CHANGES.current --- 3-12-2003 delta Cleaning code for ScreenInfo and ScreenInfoManager. It still needs some improvements but it should be better now. Note that osgText has been entirely reimplemented. Although, I didn t use it, we ll need to switch to it soon: more flexible interface, robuster and faster code. I added a Runge-Kutta method RK_24, with a predictive step and a corrective one; it is implemented as an abstract class in DynamicalSystem (.cpp & .h). A dynamical system is roughly speaking a system of differential equations (ODE); a pure virtual method is the vector field which looks like vector f(time,vector); here, vector is a std::vector<double> of any dimension; you need to pass its size when you instantiate a DynamicalSystem. This class is generic and could be use as soon as a vector field may be defined. Aerodynamics inherites now from DynamicalSystem. I ve done some minor cleaning in code and implement some helper functions to use with dynamical system. Call to this numerical method occurs in doSimStep2; it will be keep until others will have tested it enough (so, old code is still available and functional - just 1 line to be changed to switch back). I added a line in CSPSim.ini to read sound files (still hardcoded). At the moment, SDL API is used but it should be replaced by OpenAL soon (Wolverine is working on it). Looks like that here: SoundPath = ../Data/Sounds Changed the radius of skydome to 64000 (hardcoded!, pkz Onsight, check it) Others changes are minor. |
From: <de...@us...> - 2003-03-12 21:38:49
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv5022 Added Files: DynamicalSystem.cpp Log Message: class to solve ODE with Runge-Kutta 24 --- NEW FILE: DynamicalSystem.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file DynamicalSystem.cpp * **/ #include <cmath> #include <iostream> #include "DynamicalSystem.h" double const DynamicalSystem::PGROW = -0.20; double const DynamicalSystem::PSHRNK = -0.25; double const DynamicalSystem::FCOR = 0.06666666; // 1.0/15.0 double const DynamicalSystem::SAFETY = 0.9; double const DynamicalSystem::ERRCON = 6.0e-4; unsigned int const DynamicalSystem::MAXSTP = 10000; double const DynamicalSystem::TINY = std::numeric_limits<float>::epsilon();//1.0e-30; //=========================================================================== std::vector<double> const &DynamicalSystem::rk4(std::vector<double> const &y, std::vector<double> const &dydx, double x, double h) { static std::vector<double> yout(m_NVariable), yt(m_NVariable), dyt(m_NVariable), dym(m_NVariable); double hh = h * 0.5; unsigned short i = 0; for (; i < m_NVariable; ++i) yt[i] = y[i] + hh * dydx[i]; double xh = x + hh; dyt = f(xh, yt); for (i = 0; i < m_NVariable; ++i) yt[i] = y[i] + hh * dyt[i]; dym = f(xh, yt); for (i = 0; i < m_NVariable; ++i) { yt[i] = y[i] + h * dym[i]; dym[i] += dyt[i]; } dyt = f(x + h, yt); double h6 = h / 6.0; for (i = 0; i < m_NVariable; ++i) yout[i] = y[i] + h6 * (dydx[i] + dyt[i] + 2.0 * dym[i]); return yout; } //=========================================================================== std::vector<double> const &DynamicalSystem::rkqc(std::vector<double> &y, std::vector<double> &dydx, double &x, double htry, double eps, std::vector<double> const &yscal, double &hdid, double &hnext) { static std::vector<double> ytemp, ysav, dysav; double xsav = x; ysav = y; dysav = dydx; double h = htry; unsigned short i; bool loop = true; do { double hh = 0.5 * h; ytemp = rk4(ysav, dysav, xsav, hh); x = xsav + hh; dydx = f(x, ytemp); y = rk4(ytemp, dydx, x, hh); x = xsav + h; if (x == xsav) { std::cout << "Step size too small in routine RKQC\n" << std::endl; loop = false; } else { ytemp = rk4(ysav, dysav, xsav, h); double errmax = 0.0; for (i = 0; i < m_NVariable; ++i) { ytemp[i] -= y[i]; // ytemp[i] = y[i] - ytemp[i]; double temp = fabs(ytemp[i] / yscal[i]); if (errmax < temp) errmax = temp; } errmax /= eps; if (errmax <= 1.0) { hdid = h; hnext = (errmax > ERRCON ? SAFETY * h * exp(PGROW * log(errmax)) : 4.0 * h); loop = false; } else h *= SAFETY * exp(PSHRNK * log(errmax)); } } while ( loop ); for (i = 0; i < m_NVariable; ++i) y[i] += ytemp[i] * FCOR; return y; } //=========================================================================== std::vector<double> const &DynamicalSystem::odeint(std::vector<double> const & ystart, double x1, double x2, double eps, double h1, double hmin, unsigned int &nok, unsigned int &nbad) { static std::vector<double> y, dydx, yscal(m_NVariable); double hnext, hdid; double x = x1; double h = (x2 > x1) ? fabs(h1) : -fabs(h1); nok = nbad = 0; y = ystart; unsigned int nstp = 0; do { ++nstp; dydx = f(x, y); for (unsigned short i = 0;i < m_NVariable; ++i) yscal[i] = fabs(y[i]) + fabs(dydx[i] * h) + TINY; if ((x+h-x2)*(x+h-x1) > 0.0) h = x2 - x; y = rkqc(y, dydx, x, h, eps, yscal, hdid, hnext); if ( hdid == h ) ++nok; else ++nbad; if ( (x-x2) * (x2-x1) >= 0.0 ) return y; else { if (fabs(hnext) <= hmin) { std::cout << "Step size too small in ODEINT\n" << std::endl; nstp = MAXSTP; } h = hnext; } } while ( nstp < MAXSTP ); std::cout << "Too many steps in routine ODEINT\n" << std::endl; return ystart; } //================================================================= std::vector<double> const &DynamicalSystem::RungeKutta(std::vector<double> const &y0, double t1, double t2) { static std::vector<double> result; unsigned int nok,nbad; result = odeint(y0, t1, t2, m_precision, m_hestimate, m_hmin, nok, nbad); //std::cout << "nok =" << nok << "; nbad = " << nbad << "\n"; return result; } |
From: <de...@us...> - 2003-03-12 21:38:19
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv4709 Added Files: DynamicalSystem.h Log Message: class to solve ODE with Runge-Kutta 24 --- NEW FILE: DynamicalSystem.h --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file DynamicalSystem.h * **/ #ifndef __DYNAMICALSYSTEM_H__ #define __DYNAMICALSYSTEM_H__ #include <limits> #include <vector> class DynamicalSystem { unsigned short const m_NVariable; std::vector<double> const & rkqc(std::vector<double> &y, std::vector<double> &dyx, double &x, double htry, double eps, std::vector<double> const &yscal, double &hdid, double &hnext); std::vector<double> const &odeint(std::vector<double> const & ystart, double x1, double x2, double eps, double h1, double hmin, unsigned int &nok, unsigned int &nbad); static double const PGROW ; static double const PSHRNK; static double const FCOR; static double const SAFETY; static double const ERRCON; static unsigned int const MAXSTP; static double const TINY; double m_precision, m_hmin, m_hestimate; public: std::vector<double> const & rk4(std::vector<double> const & y, std::vector<double> const & dyx, double x, double h); std::vector<double> const & RungeKutta(std::vector<double> const &y0, double t1, double t2); DynamicalSystem( unsigned short NVariable, double Precision = 1.e-3, //1.e-4 double Hmin = 0.0, double Hestimate = 1.e-2): m_NVariable(NVariable), m_precision(Precision), m_hmin(Hmin), m_hestimate(Hestimate) {;}; protected: virtual std::vector<double> const &f(double, std::vector<double> &) = 0; }; #endif |
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv4223 Modified Files: VirtualBattlefield.h TerrainObject.h ScreenInfoManager.h ScreenInfo.h FLCS.h CSPSim.h Colorspace.h AeroDynamics.h Log Message: no message Index: VirtualBattlefield.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/VirtualBattlefield.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** VirtualBattlefield.h 21 Feb 2003 08:00:31 -0000 1.5 --- VirtualBattlefield.h 12 Mar 2003 21:37:34 -0000 1.6 *************** *** 27,34 **** #include <list> - #include <string> - - #include <osg/FrameStamp> - #include <osg/Group> #include <osgUtil/SceneView> --- 27,30 ---- *************** *** 36,43 **** #include "BaseController.h" #include "DynamicObject.h" - #include "ObjectRangeInfo.h" #include "TerrainObject.h" - #include <SimData/Types.h> --- 32,37 ---- *************** *** 72,76 **** simdata::Pointer<DynamicObject> getObjectFromID( unsigned int ID); simdata::Pointer<DynamicObject> getObjectFromName( std::string name ); ! BaseController * getControllerFromID(unsigned int ID); void removeObjectWithID( unsigned int ID); void removeObjectsMarkedForDelete(); --- 66,70 ---- simdata::Pointer<DynamicObject> getObjectFromID( unsigned int ID); simdata::Pointer<DynamicObject> getObjectFromName( std::string name ); ! BaseController* getControllerFromID(unsigned int ID); void removeObjectWithID( unsigned int ID); void removeObjectsMarkedForDelete(); *************** *** 144,148 **** static unsigned int latest_object_id; std::list<string> objectListHistory; ! list<BaseController *> controllerList; float m_ViewDistance; --- 138,142 ---- static unsigned int latest_object_id; std::list<string> objectListHistory; ! std::list<BaseController *> controllerList; float m_ViewDistance; Index: TerrainObject.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/TerrainObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TerrainObject.h 21 Feb 2003 08:00:30 -0000 1.3 --- TerrainObject.h 12 Mar 2003 21:37:35 -0000 1.4 *************** *** 131,135 **** Demeter::Terrain* m_pTerrain; ! Demeter::TerrainLattice* m_pTerrainLattice; Demeter::DemeterDrawable* m_pDrawable; --- 131,135 ---- Demeter::Terrain* m_pTerrain; ! mutable osg::ref_ptr<Demeter::TerrainLattice> m_pTerrainLattice; Demeter::DemeterDrawable* m_pDrawable; Index: ScreenInfoManager.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/ScreenInfoManager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScreenInfoManager.h 19 Feb 2003 23:02:27 -0000 1.1 --- ScreenInfoManager.h 12 Mar 2003 21:37:35 -0000 1.2 *************** *** 26,30 **** #define __SCREENINFOMANAGER_H__ - #include <osg/NodeVisitor> #include <osg/Projection> --- 26,29 ---- *************** *** 35,45 **** public: ScreenInfoManager(int ScreenWidth, int ScreenHeight); ! virtual ~ScreenInfoManager(){;}; void setStatus(std::string const & name, bool bvisible); bool ScreenInfoManager::getStatus(std::string const & name); private: osg::MatrixTransform* m_modelview_abs; ! ScreenInfo * getScreenInfo(std::string const & name); ! void set2dScene(osg::Group* rootNode, int ScreenWidth, int ScreenHeight); }; --- 34,44 ---- public: ScreenInfoManager(int ScreenWidth, int ScreenHeight); ! virtual ~ScreenInfoManager(){} void setStatus(std::string const & name, bool bvisible); bool ScreenInfoManager::getStatus(std::string const & name); + void changeObjectStats(int ScreenWidth, int ScreenHeight); private: osg::MatrixTransform* m_modelview_abs; ! ScreenInfo* getScreenInfo(std::string const & name); }; Index: ScreenInfo.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/ScreenInfo.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScreenInfo.h 19 Feb 2003 23:02:27 -0000 1.1 --- ScreenInfo.h 12 Mar 2003 21:37:35 -0000 1.2 *************** *** 35,44 **** std::string m_TTFPath; int m_FontSize; ! osgText::BitmapFont * m_BitmapFont; ! osgText::Text * m_Text; public: ScreenInfo(int posx,int posy, std::string const & name, std::string const & text = ""); ! virtual ~ScreenInfo() {;}; ! virtual void update(){;}; void setStatus(bool const bvisible) {if (bvisible) setNodeMask(1); else setNodeMask(0);}; bool getStatus() const {return getNodeMask() != 0;}; --- 35,44 ---- std::string m_TTFPath; int m_FontSize; ! osgText::BitmapFont* m_BitmapFont; ! osgText::Text* m_Text; public: ScreenInfo(int posx,int posy, std::string const & name, std::string const & text = ""); ! virtual ~ScreenInfo() {} ! virtual void update(){} void setStatus(bool const bvisible) {if (bvisible) setNodeMask(1); else setNodeMask(0);}; bool getStatus() const {return getNodeMask() != 0;}; *************** *** 49,55 **** { float m_minFps, m_maxFps; ! osgText::Text * m_Date; public: Framerate(int posx,int posy); virtual void update(); }; --- 49,56 ---- { float m_minFps, m_maxFps; ! osgText::Text* m_Date; public: Framerate(int posx,int posy); + virtual ~Framerate(){} virtual void update(); }; *************** *** 58,68 **** class GeneralStats: public ScreenInfo { ! osgText::Text * m_LocalPosition; ! osgText::Text * m_GlobalPosition; ! osgText::Text * m_Velocity; public: GeneralStats(int posx,int posy); virtual void update(); ! virtual ~GeneralStats() {;}; }; --- 59,69 ---- class GeneralStats: public ScreenInfo { ! osgText::Text* m_LocalPosition; ! osgText::Text* m_GlobalPosition; ! osgText::Text* m_Velocity; public: GeneralStats(int posx,int posy); virtual void update(); ! virtual ~GeneralStats(){} }; *************** *** 71,79 **** { // input device informations ! std::vector<osgText::Text *> m_ObjectStats; public: ObjectStats(int posx,int posy); virtual void update(); ! virtual ~ObjectStats() {;}; }; --- 72,80 ---- { // input device informations ! std::vector<osgText::Text*> m_ObjectStats; public: ObjectStats(int posx,int posy); virtual void update(); ! virtual ~ObjectStats(){} }; Index: FLCS.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/FLCS.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FLCS.h 26 Jan 2003 23:34:13 -0000 1.2 --- FLCS.h 12 Mar 2003 21:37:35 -0000 1.3 *************** *** 29,35 **** #include "SimObject.h" #include "HID.h" - #include "AeroDynamics.h" - - //#include "AeroDynamics.h" class FlightControlSystem: public simdata::Object --- 29,32 ---- Index: CSPSim.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/CSPSim.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CSPSim.h 22 Feb 2003 02:32:04 -0000 1.6 --- CSPSim.h 12 Mar 2003 21:37:35 -0000 1.7 *************** *** 79,83 **** void setActiveObject(simdata::Pointer<DynamicObject> object); ! simdata::Pointer<DynamicObject> const getActiveObject() const; VirtualBattlefield * const getBattlefield() const; --- 79,83 ---- void setActiveObject(simdata::Pointer<DynamicObject> object); ! simdata::Pointer<DynamicObject const> const getActiveObject() const; VirtualBattlefield * const getBattlefield() const; Index: Colorspace.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Colorspace.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Colorspace.h 19 Feb 2003 11:41:56 -0000 1.3 --- Colorspace.h 12 Mar 2003 21:37:35 -0000 1.4 *************** *** 30,38 **** #define __COLORSPACE_H__ - #include <cmath> - #include <ostream> - #include <assert.h> - - /* * Colorspace conversions and corrections. --- 30,33 ---- Index: AeroDynamics.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/AeroDynamics.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AeroDynamics.h 19 Feb 2003 11:41:56 -0000 1.3 --- AeroDynamics.h 12 Mar 2003 21:37:36 -0000 1.4 *************** *** 32,35 **** --- 32,37 ---- #include <SimData/InterfaceRegistry.h> + #include "DynamicalSystem.h" + class AircraftObject; *************** *** 45,49 **** Physics() { } virtual ~Physics() {} - virtual void initialize() = 0; virtual void doSimStep(double dt) = 0; --- 47,50 ---- *************** *** 54,58 **** * */ ! class AeroDynamics: public simdata::Object, public Physics { public: --- 55,59 ---- * */ ! class AeroDynamics: public simdata::Object, public Physics, protected DynamicalSystem { public: *************** *** 107,110 **** --- 108,112 ---- virtual void initialize(); virtual void doSimStep(double dt); + virtual void doSimStep2(double dt); protected: *************** *** 141,144 **** --- 143,148 ---- double m_CD_a; // CDa is the drag curve slope double m_CD_de; // CDde is the drag due to elevator + double m_CD_i; // CD_i is induced drag coefficient = 1 / (e * pi * lambda) where lamdba = Span^2 / Area + // and e is Osswald coefficient double m_CL0; // CLo is the reference lift at zero angle of attack *************** *** 147,150 **** --- 151,155 ---- double m_CL_q; double m_CL_de; // CLde is the lift due to elevator + double m_CL; // total lift coefficient; used by induced drag = CD_i * Cl^2 double m_CM0; // CMo is the pitch moment coefficient *************** *** 156,162 **** double m_CY_beta; // CLb - the dihedral effect double m_CY_p; // Clp - roll damping ! double m_CY_r; // CLdr - roll due to rudder ! double m_CY_da; // CLr - roll due to yaw rate// Clda - roll due to aileron ! double m_CY_dr; double m_CI_beta; --- 161,167 ---- double m_CY_beta; // CLb - the dihedral effect double m_CY_p; // Clp - roll damping ! double m_CY_r; // CLr - roll due to yaw rate ! double m_CY_da; // Clda - roll due to aileron ! double m_CY_dr; // CLdr - roll due to rudder double m_CI_beta; *************** *** 191,197 **** protected: ! simdata::Vector3 CalculateForces(double const p_qBarS); // update gforce too ! simdata::Vector3 CalculateMoments(double const p_qBarS) const; double CalculateLiftCoefficient() const; double CalculateDragCoefficient() const; --- 196,205 ---- protected: + std::vector<double> const &f(double x, std::vector<double> &y); + void bindToBody(std::vector<double> const &y); ! simdata::Vector3 const& CalculateForces(double const p_qBarS); // update gforce too ! simdata::Vector3 const& CalculateMoments(double const p_qBarS) const; ! void updateAngles(double dt); double CalculateLiftCoefficient() const; double CalculateDragCoefficient() const; *************** *** 209,217 **** simdata::Vector3 LocalToBody(const simdata::Vector3 & vec); simdata::Vector3 BodyToLocal(const simdata::Vector3 & vec); simdata::Matrix3 MakeAngularVelocityMatrix(simdata::Vector3 u); ! simdata::Vector3 LiftVector() const; ! simdata::Vector3 DragVector() const; ! simdata::Vector3 SideVector() const; /* --- 217,227 ---- simdata::Vector3 LocalToBody(const simdata::Vector3 & vec); simdata::Vector3 BodyToLocal(const simdata::Vector3 & vec); + void BodyToLocal(); + simdata::Matrix3 MakeAngularVelocityMatrix(simdata::Vector3 u); ! simdata::Vector3 const& LiftVector(); ! simdata::Vector3 const& DragVector() const; ! simdata::Vector3 const& SideVector() const; /* *************** *** 239,243 **** // calculated forces ! simdata::Vector3 m_ForceBody; simdata::Vector3 m_CurrentForceTotal; simdata::Vector3 m_GravityForce; --- 249,254 ---- // calculated forces ! double m_qBarFactor; ! simdata::Vector3 m_CurrentForceTotal; simdata::Vector3 m_GravityForce; *************** *** 247,256 **** // derived quantities ! double m_alpha; // angle of attack double m_alphaDot; // AOA rate double m_beta; // side slip angle double m_gForce; // current g acceleration ! double m_Gravity; // current gravitational acceleration simdata::Vector3 m_GravityWorld; // current gravity vector in earth coordinates --- 258,268 ---- // derived quantities ! double m_alpha; // current angle of attack ! double m_alpha0; // discrete AOA double m_alphaDot; // AOA rate double m_beta; // side slip angle double m_gForce; // current g acceleration ! double m_Gravity; // current gravitational acceleration simdata::Vector3 m_GravityWorld; // current gravity vector in earth coordinates *************** *** 264,267 **** --- 276,280 ---- simdata::Vector3 m_MomentsBody; // (L,M,N) total moment (torque) in body coordinates + simdata::Vector3 m_PositionBody; // position after integration step in body coordinates simdata::Vector3 m_AngularAccelBody; // (Pdot, Qdot, Rdot) simdata::Vector3 m_AngularAccelLocal; // angular acceleration in local coordinates |
From: <wol...@us...> - 2003-02-26 05:30:37
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Sounds In directory sc8-pr-cvs1:/tmp/cvs-serv7904 Added Files: avionturbine5.wav Log Message: a jetengine sound --- NEW FILE: avionturbine5.wav --- (This appears to be a binary file; contents omitted.) |
From: <wol...@us...> - 2003-02-22 02:45:35
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Sounds In directory sc8-pr-cvs1:/tmp/cvs-serv23767 Added Files: a.wav Log Message: readding as a binary. |
From: <wol...@us...> - 2003-02-22 02:39:41
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Sounds In directory sc8-pr-cvs1:/tmp/cvs-serv22442 Removed Files: a.wav Log Message: --- a.wav DELETED --- |
From: <wol...@us...> - 2003-02-22 02:36:49
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Sounds In directory sc8-pr-cvs1:/tmp/cvs-serv21605 Added Files: a.wav Log Message: test sound file --- NEW FILE: a.wav --- (This appears to be a binary file; contents omitted.) |
From: <wol...@us...> - 2003-02-22 02:36:06
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Sounds In directory sc8-pr-cvs1:/tmp/cvs-serv21512/Sounds Log Message: Directory /cvsroot/csp/APPLICATIONS/CSPSim/Data/Sounds added to the repository |
From: <wol...@us...> - 2003-02-22 02:35:36
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv21334 Modified Files: CSPSim.cpp Log Message: Initial sound implemention. Index: CSPSim.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CSPSim.cpp 21 Feb 2003 08:00:33 -0000 1.8 --- CSPSim.cpp 22 Feb 2003 02:35:33 -0000 1.9 *************** *** 33,36 **** --- 33,37 ---- #include <SDL/SDL.h> + #include <SDL/SDL_audio.h> #include "DemeterException.h" *************** *** 52,55 **** --- 53,59 ---- #include <SimData/DataArchive.h> + SDLWave m_audioWave; + + //////////////////////////////////////////////// // FIXME *************** *** 128,131 **** --- 132,140 ---- void CSPSim::setActiveObject(simdata::Pointer<DynamicObject> object) { + + CSP_LOG(CSP_APP, CSP_INFO, "CSPSim::setActiveObject - objectID: " << object->getObjectID() + << ", ObjectType: " << object->getObjectType() + << ", Position: " << object->getGlobalPosition()); + if (m_ActiveObject.valid()) { m_ActiveObject->setHuman(false); *************** *** 143,146 **** --- 152,159 ---- printf("map set, object bound.\n"); } + else { + CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim::setActiveObject - object was not valid"); + + } } *************** *** 232,235 **** --- 245,249 ---- //ao->AddSmoke(); + /* simdata::Pointer<DynamicObject> to = m_DataArchive->getObject("vehicles.aircraft.m2k"); *************** *** 265,268 **** --- 279,285 ---- void CSPSim::Cleanup() { + + CSP_LOG(CSP_APP, CSP_INFO, "CSPSim Cleanup..."); + assert(m_Battlefield); assert(m_ActiveTerrain.isNull() == false); *************** *** 337,340 **** --- 354,360 ---- { while (!m_bFinished) { + + CSP_LOG(CSP_APP, CSP_DEBUG, "CSPSim::Run... Starting loop iteration"); + updateTime(); float dt = m_FrameTime; *************** *** 527,531 **** g_ScreenWidth = width; ! if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) != 0) { printf("Unable to initialize SDL: %s\n", SDL_GetError()); CSP_LOG(CSP_APP, CSP_ERROR, "ERROR! Unable to initialize SDL: " << SDL_GetError()); --- 547,551 ---- g_ScreenWidth = width; ! if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) != 0) { printf("Unable to initialize SDL: %s\n", SDL_GetError()); CSP_LOG(CSP_APP, CSP_ERROR, "ERROR! Unable to initialize SDL: " << SDL_GetError()); *************** *** 565,569 **** --- 585,628 ---- SDL_EnableUNICODE(1); + if ( SDL_LoadWAV("../data/sounds/a.wav", + &m_audioWave.spec, &m_audioWave.sound, &m_audioWave.soundlen) == NULL ) { + CSP_LOG(CSP_APP, CSP_ERROR, "Couldn't load %s: %s\n", + argv[1], SDL_GetError()); + exit(1); + } + m_audioWave.spec.callback = fillerup; + + /* Initialize fillerup() variables */ + if ( SDL_OpenAudio(&m_audioWave.spec, NULL) < 0 ) { + fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); + SDL_FreeWAV(m_audioWave.sound); + exit(2); + } + SDL_PauseAudio(0); + return 0; + } + + + void fillerup(void *unused, Uint8 *stream, int len) + { + Uint8 *waveptr; + int waveleft; + + /* Set up the pointers */ + waveptr = m_audioWave.sound + m_audioWave.soundpos; + waveleft = m_audioWave.soundlen - m_audioWave.soundpos; + + /* Go! */ + while ( waveleft <= len ) { + SDL_MixAudio(stream, waveptr, waveleft, SDL_MIX_MAXVOLUME); + stream += waveleft; + len -= waveleft; + waveptr = m_audioWave.sound; + waveleft = m_audioWave.soundlen; + m_audioWave.soundpos = 0; + } + SDL_MixAudio(stream, waveptr, len, SDL_MIX_MAXVOLUME); + m_audioWave.soundpos += len; } |
From: <wol...@us...> - 2003-02-22 02:32:10
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv20437 Modified Files: CSPSim.h Log Message: Initial sound implementaion has been added. Index: CSPSim.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/CSPSim.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CSPSim.h 19 Feb 2003 22:58:00 -0000 1.5 --- CSPSim.h 22 Feb 2003 02:32:04 -0000 1.6 *************** *** 43,46 **** --- 43,55 ---- class EventMapIndex; + struct SDLWave { + SDL_AudioSpec spec; + Uint8 *sound; /* Pointer to wave data */ + Uint32 soundlen; /* Length of wave data */ + int soundpos; /* Current play position */ + }; + + void fillerup(void *unused, Uint8 *stream, int len); + /** *************** *** 89,92 **** --- 98,103 ---- void DoStartupScript(); + + private: *************** *** 100,103 **** --- 111,116 ---- GameScreen *m_GameScreen; BaseScreen *m_MainMenuScreen; + + int m_ScreenWidth; |
From: <mk...@us...> - 2003-02-21 17:23:13
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv18153/Source Modified Files: VirtualBattlefield.cpp Log Message: commented testing code in vb Index: VirtualBattlefield.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/VirtualBattlefield.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VirtualBattlefield.cpp 21 Feb 2003 08:00:40 -0000 1.8 --- VirtualBattlefield.cpp 21 Feb 2003 17:23:08 -0000 1.9 *************** *** 44,48 **** #include "Config.h" #include "Platform.h" ! #include "shadow.h" #include <SimData/Types.h> --- 44,48 ---- #include "Config.h" #include "Platform.h" ! //#include "shadow.h" #include <SimData/Types.h> |
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv627/Source Modified Files: CSPSim.cpp Makefile.in ScreenInfo.cpp Sky.cpp TerrainObject.cpp VirtualBattlefield.cpp Log Message: fixed moon billboard for high latitudes, restructured terrain node in scene in anticipation of shadow mapping Index: CSPSim.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CSPSim.cpp 20 Feb 2003 09:53:47 -0000 1.7 --- CSPSim.cpp 21 Feb 2003 08:00:33 -0000 1.8 *************** *** 232,235 **** --- 232,236 ---- //ao->AddSmoke(); + /* simdata::Pointer<DynamicObject> to = m_DataArchive->getObject("vehicles.aircraft.m2k"); assert(to.valid()); *************** *** 237,240 **** --- 238,242 ---- to->addToScene(m_Battlefield); m_Battlefield->addObject(to); + */ // create screens Index: Makefile.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.in 19 Feb 2003 21:24:16 -0000 1.3 --- Makefile.in 21 Feb 2003 08:00:34 -0000 1.4 *************** *** 44,47 **** --- 44,49 ---- ObjectRangeInfo.cpp \ Platform.cpp \ + ScreenInfo.cpp \ + ScreenInfoManager.cpp \ SimObject.cpp \ SimpleConfig.cpp \ Index: ScreenInfo.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ScreenInfo.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScreenInfo.cpp 19 Feb 2003 23:02:59 -0000 1.1 --- ScreenInfo.cpp 21 Feb 2003 08:00:36 -0000 1.2 *************** *** 134,150 **** ObjectStats::ObjectStats(int posx,int posy):ScreenInfo(posx,posy,"OBJECT STATS") { ! simdata::Pointer<DynamicObject> activeObject = CSPSim::theSim->getActiveObject(); ! if (!activeObject.isNull()) { ! std::vector<std::string> stringStats; ! activeObject->getStats(stringStats); ! for (unsigned short i = 0; i < stringStats.size(); ++i) { ! posy -= m_FontSize; ! osgText::Text* aStat = new osgText::Text(m_BitmapFont); ! aStat->setPosition(osg::Vec3(posx,posy,0)); ! m_ObjectStats.push_back(aStat); ! addDrawable( aStat ); ! } ! removeDrawable(m_Text); } }; --- 134,145 ---- ObjectStats::ObjectStats(int posx,int posy):ScreenInfo(posx,posy,"OBJECT STATS") { ! for (unsigned short i = 0; i < 10; ++i) { ! posy -= m_FontSize; ! osgText::Text* aStat = new osgText::Text(m_BitmapFont); ! aStat->setPosition(osg::Vec3(posx,posy,0)); ! m_ObjectStats.push_back(aStat); ! addDrawable( aStat ); } + removeDrawable(m_Text); }; *************** *** 155,160 **** std::vector<std::string> stringStats; activeObject->getStats(stringStats); ! for (unsigned short i = 0; i < m_ObjectStats.size(); ++i) ! m_ObjectStats[i]->setText(stringStats[i]); } ! } \ No newline at end of file --- 150,160 ---- std::vector<std::string> stringStats; activeObject->getStats(stringStats); ! unsigned int n = m_ObjectStats.size(); ! if (stringStats.size() < n) n = stringStats.size(); ! for (unsigned short i = 0; i < n; ++i) { ! m_ObjectStats[i]->setText(stringStats[i]); ! // std::cout << stringStats[i] << std::endl; ! } ! // std::cout << stringStats.size() << std::endl; } ! } Index: Sky.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Sky.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Sky.cpp 21 Feb 2003 01:58:47 -0000 1.5 --- Sky.cpp 21 Feb 2003 08:00:38 -0000 1.6 *************** *** 351,361 **** x = y*sin(A); y *= cos(A); ! _updateLighting(x, y, z, color, intensity, background); } ! void Sun::_updateLighting(float x, float y, float z, Color const &color, float intensity, float background) { float specular_scale = 1.0; float ambient = background; if (ambient > 0.1) ambient = 0.1; // ad-hoc additional darkening once the sun has set... the gl light // representing the sun should not be as bright as the horizion. --- 351,378 ---- x = y*sin(A); y *= cos(A); ! _updateLighting(x, y, z, h, color, intensity, background); } ! void Sun::_updateLighting(float x, float y, float z, float h, Color const &color, float intensity, float background) { float specular_scale = 1.0; float ambient = background; if (ambient > 0.1) ambient = 0.1; + + /* the first calculation of scale is somewhat physically based on + a plot of sunlight intensity versus angle in Preetham. the + ad-hoc one below seems better for compensating the limited + dynamic range of the monitor though, so this is currently + disabled. also, it has not been tested or tweaked. + float scale = 1.0; + { + // angle from zenith + float a = 1.0 - h / 0.5*G_PI; + a *= a; + scale = 1.0 - a*a; + float horizon_light = intensity*intensity * 25.0; + if (horizon_light > 1.0) horizon_light = 1.0; + if (horizon_light > scale) scale = horizon_light; + } + */ // ad-hoc additional darkening once the sun has set... the gl light // representing the sun should not be as bright as the horizion. *************** *** 461,474 **** Vec3 to_eye(eye_local-pos_local); Vec3 to_eye_projection = to_eye^_axis; ! float to_eye_projection_len = to_eye_projection.length(); ! if (to_eye_projection_len != 0.0) { ! to_eye_projection /= to_eye_projection_len; ! Vec3 normal_projection(_normal^_axis); ! float normal_projection_len = normal_projection.length(); ! if (normal_projection_len != 0.0f) { ! normal_projection /= normal_projection_len; ! float rotation_angle = acos(to_eye_projection*normal_projection); ! matrix.makeRotate(rotation_angle, normal_projection^to_eye_projection); ! } } matrix = _orient * matrix; --- 478,485 ---- Vec3 to_eye(eye_local-pos_local); Vec3 to_eye_projection = to_eye^_axis; ! if (to_eye_projection.normalize() > 0.0) { ! float rotation_angle = G_PI+acos(to_eye_projection*_onormal); ! Vec3 pivot = _onormal^to_eye_projection; ! matrix.makeRotate(rotation_angle, pivot); } matrix = _orient * matrix; *************** *** 488,493 **** _normal = up_ ^ (_normal ^ up_); Vec3 rot = _axis ^ up_; ! _orient.makeRotate(-acos(up_*_axis), rot); ! _normal = _orient * _normal; } --- 499,509 ---- _normal = up_ ^ (_normal ^ up_); Vec3 rot = _axis ^ up_; ! float angle = acos(up_*_axis); ! _orient.makeRotate(-angle, rot); ! Matrix inv; ! inv.makeRotate(angle, rot); ! _normal = inv * _normal; ! _onormal = _normal ^ _axis; ! _onormal.normalize(); } *************** *** 495,500 **** Moon::Moon(): AstronomicalBody() { _radius = 1738000.0; - // approximate distance for setting initial size - //_distance = 384400000.0 - 6370000.0; m_Latitude = -100.0; m_DirtyImage = true; --- 511,514 ---- *************** *** 507,511 **** m_RenderDistance = 950000.0; float x, y; ! x = y = 1.0; //_radius / _distance * m_RenderDistance; m_Image = osgDB::readImageFile("moon.png"); assert(m_Image.valid()); --- 521,525 ---- m_RenderDistance = 950000.0; float x, y; ! x = y = 1.0; m_Image = osgDB::readImageFile("moon.png"); assert(m_Image.valid()); *************** *** 530,536 **** bf->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA); dstate->setAttributeAndModes(bf, osg::StateAttribute::ON); - m_CM = new osg::ColorMatrix; - m_CM->setMatrix(osg::Matrix(1.0,0,0,0,0,1.0,0,0,0,0,1.0,0,0,0,0,0.3)); - //dstate->setAttributeAndModes(m_CM.get(), osg::StateAttribute::OVERRIDE); osg::Depth *depth = new osg::Depth; depth->setFunction(osg::Depth::ALWAYS); --- 544,547 ---- *************** *** 577,581 **** m_Transform->setStateSet(dstate); m_Transform->setCullingActive(false); - //_maskPhase(0.785); // moon->setStateSet(dstate); } --- 588,591 ---- Index: TerrainObject.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/TerrainObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TerrainObject.cpp 19 Feb 2003 12:25:23 -0000 1.6 --- TerrainObject.cpp 21 Feb 2003 08:00:39 -0000 1.7 *************** *** 179,183 **** m_Battlefield = battlefield; load(); - m_Battlefield->addNodeToScene(m_TerrainNode); m_Battlefield->setActiveTerrain(this); } --- 179,182 ---- *************** *** 191,196 **** if (m_Active) { assert(m_Battlefield); - m_Battlefield->removeNodeFromScene(m_TerrainNode); - //m_Battlefield->removeNodeFromScene(m_TerrainLatticeNode.get()); m_Battlefield->setActiveTerrain(0); m_Battlefield = NULL; --- 190,193 ---- Index: VirtualBattlefield.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/VirtualBattlefield.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** VirtualBattlefield.cpp 19 Feb 2003 23:00:32 -0000 1.7 --- VirtualBattlefield.cpp 21 Feb 2003 08:00:40 -0000 1.8 *************** *** 34,37 **** --- 34,38 ---- #include <osgUtil/CullVisitor> + #include <osgUtil/DisplayListVisitor> #include "Config.h" *************** *** 43,46 **** --- 44,48 ---- #include "Config.h" #include "Platform.h" + #include "shadow.h" #include <SimData/Types.h> *************** *** 79,82 **** --- 81,93 ---- float intensity_test = 0.0; + void setNVG(osg::ColorMatrix* cm) { + assert(cm); + // 0.212671*R + 0.71516*G + 0.072169*B; + cm->setMatrix(osg::Matrix( + 0.4*0.213, 1.0*0.213, 0.4*0.213, 0.0, + 0.4*0.715, 1.0*0.715, 0.4*0.715, 0.0, + 0.4*0.072, 1.0*0.072, 0.4*0.072, 0.0, + 0.0, 0.0, 0.0, 1.0)); + } void setCM(osg::ColorMatrix* cm, float intensity) { *************** *** 246,250 **** m_Sky = new Sky; m_EyeTransform->addChild(m_Sky.get()); //makeSky()); // bin number -2 so drawn first. - m_EyeTransform->addChild(makeBase()); // bin number -1 so draw second. // add the transform to the earth sky. --- 257,260 ---- *************** *** 284,288 **** m_rpObjectRootNode->setStateSet(pFogState); ! m_rpRootNode->addChild(m_rpObjectRootNode.get()); // light group under EyeTransform for celestial bodies (sun, moon, etc) --- 294,300 ---- m_rpObjectRootNode->setStateSet(pFogState); ! m_ShadowGroup = new osg::Group; ! m_ShadowGroup->addChild(m_rpObjectRootNode.get()); ! m_rpRootNode->addChild(m_ShadowGroup.get()); // light group under EyeTransform for celestial bodies (sun, moon, etc) *************** *** 297,305 **** assert(globalStateSet); - osg::ColorMatrix* cm = new osg::ColorMatrix; ! setCM(cm, 0.0); ! //globalStateSet->setAttributeAndModes(cm, osg::StateAttribute::OVERRIDE); ! //m_pView->setGlobalStateSet(globalStateSet); --- 309,317 ---- assert(globalStateSet); osg::ColorMatrix* cm = new osg::ColorMatrix; ! //setNVG(cm); ! globalStateSet->setAttribute(cm); ! pFogState->setAttributeAndModes(cm, osg::StateAttribute::OVERRIDE); ! m_pView->setGlobalStateSet(globalStateSet); *************** *** 341,349 **** osgUtil::CullVisitor * pCullVisitor = m_pView->getCullVisitor(); ! pCullVisitor->setComputeNearFarMode(osgUtil::CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); ! pCullVisitor->setCullingMode(osgUtil::CullVisitor::ENABLE_ALL_CULLING); m_pView->setCullVisitor(pCullVisitor); m_pView->update(); m_pView->cull(); m_pView->draw(); --- 353,364 ---- osgUtil::CullVisitor * pCullVisitor = m_pView->getCullVisitor(); ! //pCullVisitor->setComputeNearFarMode(osgUtil::CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); ! //pCullVisitor->setCullingMode(osgUtil::CullVisitor::ENABLE_ALL_CULLING); m_pView->setCullVisitor(pCullVisitor); m_pView->update(); + // segfaults... why? + //assert(pCullVisitor); + //m_TerrainNode->accept(*pCullVisitor); m_pView->cull(); m_pView->draw(); *************** *** 390,396 **** } if (m_SpinTheWorld) m_Sky->spinTheWorld(); ! //m_Sky->update(lat, lon, CSPSim::theSim->getCurrentTime()); // greenwich, england (for testing) ! m_Sky->update(0.8985, 0.0, CSPSim::theSim->getCurrentTime()); t+=1.0; } else { --- 405,411 ---- } if (m_SpinTheWorld) m_Sky->spinTheWorld(); ! m_Sky->update(lat, lon, CSPSim::theSim->getCurrentTime()); // greenwich, england (for testing) ! //m_Sky->update(0.8985, 0.0, CSPSim::theSim->getCurrentTime()); t+=1.0; } else { *************** *** 463,470 **** pFogAttr->setStart(15000.0 + eyez + 15000.0*a); pStateSet->setAttributeAndModes(pFogAttr ,osg::StateAttribute::ON); ! m_rpObjectRootNode->setStateSet(pStateSet); } ! if (1) { static bool up = false; --- 478,488 ---- pFogAttr->setStart(15000.0 + eyez + 15000.0*a); pStateSet->setAttributeAndModes(pFogAttr ,osg::StateAttribute::ON); ! //osg::ColorMatrix* cm = (osg::ColorMatrix *) pStateSet->getAttribute(osg::StateAttribute::COLORMATRIX); ! //setNVG(cm); ! //pStateSet->setAttributeAndModes(cm ,osg::StateAttribute::OVERRIDE); ! m_ShadowGroup->setStateSet(pStateSet); } ! if (0) { static bool up = false; *************** *** 478,483 **** osg::ColorMatrix* cm = (osg::ColorMatrix *) pStateSet->getAttribute(osg::StateAttribute::COLORMATRIX); //setCM(cm, I*0.4); ! //pStateSet->setAttributeAndModes(cm ,osg::StateAttribute::OVERRIDE); ! //m_pView->setGlobalStateSet(pStateSet); } --- 496,502 ---- osg::ColorMatrix* cm = (osg::ColorMatrix *) pStateSet->getAttribute(osg::StateAttribute::COLORMATRIX); //setCM(cm, I*0.4); ! setNVG(cm); ! pStateSet->setAttributeAndModes(cm ,osg::StateAttribute::OVERRIDE); ! m_pView->setGlobalStateSet(pStateSet); } *************** *** 524,533 **** } ! void VirtualBattlefield::addNodeToScene( osg::Node * pNode) { CSP_LOG(CSP_APP, CSP_INFO, "VirtualBattlefield::addNodeToScene() - NodeName: " << pNode->getName() ); // osgUtil::Optimizer optimzer; // optimzer.optimize(pNode, osgUtil::Optimizer::OptimizationOptions::ALL_OPTIMIZATIONS); - m_rpObjectRootNode->addChild(pNode); } --- 543,551 ---- } ! void VirtualBattlefield::addNodeToScene(osg::Node * pNode) { CSP_LOG(CSP_APP, CSP_INFO, "VirtualBattlefield::addNodeToScene() - NodeName: " << pNode->getName() ); // osgUtil::Optimizer optimzer; // optimzer.optimize(pNode, osgUtil::Optimizer::OptimizationOptions::ALL_OPTIMIZATIONS); m_rpObjectRootNode->addChild(pNode); } *************** *** 837,840 **** --- 855,865 ---- void VirtualBattlefield::setActiveTerrain(TerrainObject *pTerrainObject) { + if (pTerrainObject == 0) { + if (m_TerrainNode.valid()) { + m_ShadowGroup->removeChild(m_TerrainNode.get()); + } + m_TerrainNode = NULL; + } + m_ActiveTerrainObject = pTerrainObject; *************** *** 843,847 **** if (!m_ActiveTerrainObject.isNull()) { ! m_ActiveTerrainObject->setCameraPosition( xPatch, yPatch, 1000); } --- 868,894 ---- if (!m_ActiveTerrainObject.isNull()) { ! m_ActiveTerrainObject->setCameraPosition(xPatch, yPatch, 1000); ! m_TerrainNode = m_ActiveTerrainObject->getNode(); ! if (m_TerrainNode.valid()) { ! m_ShadowGroup->addChild(m_TerrainNode.get()); ! #if 0 ! osg::Group *g = new osg::Group; ! g->addChild(m_TerrainNode.get()); ! m_ShadowGroup->addChild(g); ! //m_ShadowGroup->addChild(m_TerrainNode.get()); ! osg::Vec4 ambientLightColor(0.9f,0.1f,0.1f,1.0f); ! int texture_unit = 2; ! ///osg::NodeCallback* cb = createCullCallback(m_rpObjectRootNode.get(),osg::Vec3(35000.0,51500.0,30000),ambientLightColor,texture_unit); ! ///g->setCullCallback(cb); ! /* ! g->setCullingActive(true); ! m_TerrainNode->setCullingActive(true); ! m_ShadowGroup->setCullingActive(true); ! m_rpRootNode->setCullingActive(true); ! */ ! //printf("call=%p\n", cb); ! //printf("terr=%p, shad=%p, root=%p\n", m_TerrainNode.get(), m_ShadowGroup.get(), m_rpRootNode.get()); ! #endif ! } } *************** *** 868,869 **** --- 915,917 ---- return m_Sky->getSpin(); } + |
From: <mk...@us...> - 2003-02-21 08:01:21
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID In directory sc8-pr-cvs1:/tmp/cvs-serv627/Tools/HID Modified Files: GameScreen.map Log Message: fixed moon billboard for high latitudes, restructured terrain node in scene in anticipation of shadow mapping Index: GameScreen.map =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID/GameScreen.map,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GameScreen.map 19 Feb 2003 23:03:56 -0000 1.4 --- GameScreen.map 21 Feb 2003 08:00:42 -0000 1.5 *************** *** 1,8 **** include mouse.map include keys.map ! include F16CS.map device keyboard 0 key US_keyboard ! device joystick 0 F16CS CH_F16CS device mouse 0 mouse standard_mouse --- 1,8 ---- include mouse.map include keys.map ! include x36.map device keyboard 0 key US_keyboard ! device joystick 0 x36 Saitek_X36 device mouse 0 mouse standard_mouse |
From: <mk...@us...> - 2003-02-21 08:01:10
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv627/Include Modified Files: Sky.h TerrainObject.h VirtualBattlefield.h Log Message: fixed moon billboard for high latitudes, restructured terrain node in scene in anticipation of shadow mapping Index: Sky.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Sky.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sky.h 19 Feb 2003 21:24:16 -0000 1.2 --- Sky.h 21 Feb 2003 08:00:29 -0000 1.3 *************** *** 201,205 **** virtual void updatePosition(double); void updateScene(double h, double A, Color const &color, float intensity, float background); ! void _updateLighting(float x, float y, float z, Color const &color, float intensity, float background); }; --- 201,205 ---- virtual void updatePosition(double); void updateScene(double h, double A, Color const &color, float intensity, float background); ! void _updateLighting(float x, float y, float z, float h, Color const &color, float intensity, float background); }; Index: TerrainObject.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/TerrainObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TerrainObject.h 26 Jan 2003 23:34:13 -0000 1.2 --- TerrainObject.h 21 Feb 2003 08:00:30 -0000 1.3 *************** *** 79,82 **** --- 79,83 ---- int getTerrainPolygonsRendered() const; + osg::Node *getNode() { return m_TerrainNode; } Index: VirtualBattlefield.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/VirtualBattlefield.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VirtualBattlefield.h 19 Feb 2003 22:57:58 -0000 1.4 --- VirtualBattlefield.h 21 Feb 2003 08:00:31 -0000 1.5 *************** *** 138,142 **** osg::ref_ptr<osg::Transform> m_EyeTransform; ! osg::Node * m_pTerrainNode; ObjectList objectList; --- 138,143 ---- osg::ref_ptr<osg::Transform> m_EyeTransform; ! osg::ref_ptr<osg::Node> m_TerrainNode; ! osg::ref_ptr<osg::Group> m_ShadowGroup; ObjectList objectList; |
From: <mk...@us...> - 2003-02-21 08:01:08
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Input In directory sc8-pr-cvs1:/tmp/cvs-serv627/Data/Input Modified Files: GameScreen.hid Log Message: fixed moon billboard for high latitudes, restructured terrain node in scene in anticipation of shadow mapping Index: GameScreen.hid =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/Input/GameScreen.hid,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GameScreen.hid 19 Feb 2003 11:41:55 -0000 1.1 --- GameScreen.hid 21 Feb 2003 08:00:28 -0000 1.2 *************** *** 40,43 **** --- 40,45 ---- @00.00 -01 -0001 +00 -01 PAUSE +K 0 P 0000 0000 0000 0112 00 + @00.00 -01 -0001 +00 -01 STATS + +K 0 P 0000 0000 0000 0293 00 @00.00 -01 -0001 +00 -01 CHANGE_VEHICLE +K 0 P 0000 0000 0000 0032 00 |
From: <mk...@us...> - 2003-02-21 08:01:07
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data In directory sc8-pr-cvs1:/tmp/cvs-serv627/Data Modified Files: CSPSim.ini Log Message: fixed moon billboard for high latitudes, restructured terrain node in scene in anticipation of shadow mapping Index: CSPSim.ini =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/CSPSim.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CSPSim.ini 19 Feb 2003 21:24:16 -0000 1.5 --- CSPSim.ini 21 Feb 2003 08:00:25 -0000 1.6 *************** *** 26,33 **** [Testing] ;Date = 2003-02-18 19:50:00.0 ! Date = 2000-01-01 15:00:00.0 ! Latitude = 37 ! Longitude = -122 ! SpinWorld = false ! ;Date = 2003-02-18 03:50:00.0 ! ;Date = 2003-02-5 03:20:00.0 --- 26,30 ---- [Testing] ;Date = 2003-02-18 19:50:00.0 ! Date = 2003-02-18 15:00:00.0 ! Latitude = 43.43 ! Longitude = 5.5 |
From: <wol...@us...> - 2003-02-21 01:58:51
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv13616 Added Files: Sky.cpp Log Message: readding after fixing file naming collision. |
From: <wol...@us...> - 2003-02-21 01:53:38
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv11974 Removed Files: sky.cpp Log Message: --- sky.cpp DELETED --- |
From: <wol...@us...> - 2003-02-21 01:50:16
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv10846 Removed Files: Sky.cpp Log Message: --- Sky.cpp DELETED --- |
From: <de...@us...> - 2003-02-20 09:53:50
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv30590 Modified Files: GameScreen.cpp CSPSim.cpp Log Message: Fix bug for object stats Index: GameScreen.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/GameScreen.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GameScreen.cpp 19 Feb 2003 23:01:25 -0000 1.5 --- GameScreen.cpp 20 Feb 2003 09:53:47 -0000 1.6 *************** *** 100,125 **** CSP_LOG( CSP_APP , CSP_ERROR, "No HID interface maps defined, '__gamescreen__' not found."); } - - // add a layer for texts on screen - m_rpInfosView = new osgUtil::SceneView(); - m_rpInfosView->setDefaults(); - - int ScreenWidth = CSPSim::theSim->GetSDLScreen()->w; - int ScreenHeight = CSPSim::theSim->GetSDLScreen()->h; - - m_rpInfosView->setViewport(0,0,ScreenWidth,ScreenHeight); - - osg::Depth* depth = new osg::Depth; - depth->setRange(0.0,0.0); - osg::StateSet* State = new osg::StateSet(); - State->setAttribute(depth); - - m_rpInfosView->getRenderStage()->setClearMask(0x0); - - m_ScreenInfoManager = new ScreenInfoManager(ScreenWidth,ScreenHeight); - m_ScreenInfoManager->setName("ScreenInfoManager"); - m_ScreenInfoManager->setStateSet(State); - - m_rpInfosView->setSceneData(m_ScreenInfoManager.get() ); } --- 100,103 ---- *************** *** 193,196 **** --- 171,196 ---- m_ActiveObject->ShowRepresentant(1); } + + // add a layer for texts on screen + m_rpInfosView = new osgUtil::SceneView(); + m_rpInfosView->setDefaults(); + + int ScreenWidth = CSPSim::theSim->GetSDLScreen()->w; + int ScreenHeight = CSPSim::theSim->GetSDLScreen()->h; + + m_rpInfosView->setViewport(0,0,ScreenWidth,ScreenHeight); + + osg::Depth* depth = new osg::Depth; + depth->setRange(0.0,0.0); + osg::StateSet* State = new osg::StateSet(); + State->setAttribute(depth); + + m_rpInfosView->getRenderStage()->setClearMask(0x0); + + m_ScreenInfoManager = new ScreenInfoManager(ScreenWidth,ScreenHeight); + m_ScreenInfoManager->setName("ScreenInfoManager"); + m_ScreenInfoManager->setStateSet(State); + + m_rpInfosView->setSceneData(m_ScreenInfoManager.get() ); } Index: CSPSim.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CSPSim.cpp 19 Feb 2003 23:01:27 -0000 1.6 --- CSPSim.cpp 20 Feb 2003 09:53:47 -0000 1.7 *************** *** 240,248 **** // create screens m_GameScreen = new GameScreen; - m_GameScreen->OnInit(); - m_GameScreen->SetBattlefield(m_Battlefield); // start in the aircraft setActiveObject(ao); #if 0 --- 240,250 ---- // create screens m_GameScreen = new GameScreen; // start in the aircraft setActiveObject(ao); + + // setup screens + m_GameScreen->OnInit(); + m_GameScreen->SetBattlefield(m_Battlefield); #if 0 |