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: <sv...@ww...> - 2005-06-06 07:07:22
|
Author: mkrose Date: 2005-06-06 00:07:16 -0700 (Mon, 06 Jun 2005) New Revision: 1553 Modified: trunk/CSP/CSPSim/Source/Views/View.cpp Log: Add a newline at the end of the file. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1553 Modified: trunk/CSP/CSPSim/Source/Views/View.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/View.cpp 2005-06-06 07:05:40 UTC (rev 1552) +++ trunk/CSP/CSPSim/Source/Views/View.cpp 2005-06-06 07:07:16 UTC (rev 1553) @@ -189,4 +189,5 @@ ca->attach(7, createView_7()); ca->attach(8, createView_8()); ca->attach(9, createView_9()); -} \ No newline at end of file +} + |
From: <sv...@ww...> - 2005-06-06 07:05:48
|
Author: mkrose Date: 2005-06-06 00:05:40 -0700 (Mon, 06 Jun 2005) New Revision: 1552 Added: trunk/CSP/CSPSim/Include/CockpitInterface.h trunk/CSP/CSPSim/Source/CockpitInterface.cpp Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/systems.xml trunk/CSP/CSPSim/Source/F16/F16HUD.cpp trunk/CSP/CSPSim/Source/F16/F16HUD.h trunk/CSP/CSPSim/Source/SConscript trunk/CSP/CSPSim/Tools/HID/Maps/aircraft-core.map trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: Deprecate PanelHUD and use the new CockpitInterface classes to define the hud panel switches. Add input hooks for testing a couple of the switches. ==> ALL USERS: CompileData.py and regenerate Inputs/aircraft.hid. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1552 Diff omitted (16321 bytes). |
From: <sv...@ww...> - 2005-06-06 06:55:52
|
Author: mkrose Date: 2005-06-05 23:55:43 -0700 (Sun, 05 Jun 2005) New Revision: 1551 Modified: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/model.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml trunk/CSP/CSPSim/Source/LandingGear.cpp Log: Fix the model_id type which is now a string instead of a key. Also fix the tire rotation angle to map to the default animation limits. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1551 Diff omitted (28430 bytes). |
Author: mkrose Date: 2005-06-05 23:06:08 -0700 (Sun, 05 Jun 2005) New Revision: 1550 Added: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/channel_mirrors.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/channel_mirrors.xml trunk/CSP/CSPSim/Include/ChannelMirror.h trunk/CSP/CSPSim/Source/DoubleChannelMirror.cpp Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/model.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/remote.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/systems.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/remote.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/systems.xml trunk/CSP/CSPSim/Include/Animation.h trunk/CSP/CSPSim/Include/Controller.h trunk/CSP/CSPSim/Include/GameScreen.h trunk/CSP/CSPSim/Include/ObjectModel.h trunk/CSP/CSPSim/Include/VirtualScene.h trunk/CSP/CSPSim/Source/Animation.cpp trunk/CSP/CSPSim/Source/Controller.cpp trunk/CSP/CSPSim/Source/GameScreen.cpp trunk/CSP/CSPSim/Source/ObjectModel.cpp trunk/CSP/CSPSim/Source/SConscript trunk/CSP/CSPSim/Source/VirtualScene.cpp trunk/CSP/CSPSim/Tools/HID/Maps/gamescreen-core.map trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: Big refactoring of the animation code. Moves most of the code out of Animation.h, and hopefully simplifies the classes and increases their flexibility at the expense of a bit more verbosity. Adds support for mouse picking. Also adds several new animation classes to support new cockpit animiations. The system for mirroring animations on remote machines during network play has been rewritten as well. The new approach requires explicit exporting of channels, but is considerably more flexible. ==> ALL USERS: RebuildData.py and regenerate Inputs/gamescreen.hid. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1550 Diff omitted (141471 bytes). |
From: <sv...@ww...> - 2005-06-06 05:48:47
|
Author: mkrose Date: 2005-06-05 22:48:41 -0700 (Sun, 05 Jun 2005) New Revision: 1549 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/InputInterface.h trunk/CSP/CSPSim/Source/InputInterface.cpp Log: Add support for instance-specific event dispatch handlers. Previously all handlers were static class properties. The new handlers are implemented using sigc callbacks. The initial use case is for cockpit elements that auto-declare multiple event handlers. For example, a 3-state switch can declare events to set each state directly, as well as cycle forward and cycle backward. If the event prefix was named MASTER_ARM, the generated events might be MASTER_ARM_OFF, MASTER_ARM_SIM, MASTER_ARM_ON, MASTER_ARM_CYCLE_NEXT, MASTER_ARM_CYCLE_PREV. This avoids having to manually declare five events and the corresponding handlers, and automatically adjusts when new states are added. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1549 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-06-06 05:36:05 UTC (rev 1548) +++ trunk/CSP/CSPSim/CHANGES.current 2005-06-06 05:48:41 UTC (rev 1549) @@ -7,6 +7,19 @@ rendering, which is helpful when running multiple instances on the same machine to test networking. + * Add support for instance-specific event dispatch handlers. + Previously all handlers were static class properties. The + new handlers are implemented using sigc callbacks. The initial + use case is for cockpit elements that auto-declare multiple + event handlers. For example, a 3-state switch can declare events + to set each state directly, as well as cycle forward and cycle + backward. If the event prefix was named MASTER_ARM, the + generated events might be MASTER_ARM_OFF, MASTER_ARM_SIM, + MASTER_ARM_ON, MASTER_ARM_CYCLE_NEXT, MASTER_ARM_CYCLE_PREV. + This avoids having to manually declare five events and the + corresponding handlers, and automatically adjusts when new + states are added. + 2005-05-14: onsight * Add a list of contacts to SimObject of nearby vehicles that is maintained by the Battlefield. The battlefield was already Modified: trunk/CSP/CSPSim/Include/InputInterface.h =================================================================== --- trunk/CSP/CSPSim/Include/InputInterface.h 2005-06-06 05:36:05 UTC (rev 1548) +++ trunk/CSP/CSPSim/Include/InputInterface.h 2005-06-06 05:48:41 UTC (rev 1549) @@ -37,8 +37,10 @@ #ifndef __INPUTINTERFACE_H__ #define __INPUTINTERFACE_H__ +#include <map> #include <string> #include <cassert> +#include <sigc++/sigc++.h> #include <SDL/SDL_events.h> #include <SimData/HashUtility.h> @@ -50,6 +52,14 @@ class InputInterface; +typedef SigC::Slot2<void, int, int> ActionEventSlot; +typedef SigC::Signal2<void, int, int> ActionEventSignal; +typedef SigC::Slot4<void, int, int, int, int> MotionEventSlot; +typedef SigC::Signal4<void, int, int, int, int> MotionEventSignal; +typedef SigC::Slot1<void, double> AxisEventSlot; +typedef SigC::Signal1<void, double> AxisEventSignal; + + /** Abstract adapter for action event handlers (internal) */ struct ActionAdapter { @@ -139,8 +149,33 @@ }; +/** A dispatch mapping that is instance specific and constructed at runtime (as + * opposed to InputInterfaceDispatch which is a static class property). This + * dispatcher uses arbitrary sigc callbacks, so the handlers do not have to be + * InputInterface subclass methods. + */ +class RuntimeDispatch { +public: + bool onMapEvent(MapEvent const &); + void bindAction(std::string const &id, ActionEventSlot const &callback); + void bindMotion(std::string const &id, MotionEventSlot const &callback); + void bindAxis(std::string const &id, AxisEventSlot const &callback); +private: + typedef std::map<std::string, ActionEventSignal> ActionCallbacks; + typedef std::map<std::string, MotionEventSignal> MotionCallbacks; + typedef std::map<std::string, AxisEventSignal> AxisCallbacks; + ActionCallbacks m_ActionCallbacks; + MotionCallbacks m_MotionCallbacks; + AxisCallbacks m_AxisCallbacks; +}; + + /** Mappings for dispatching input events to handlers defined in InputInterface - * subclasses. (internal) + * subclasses. (internal) This mapping is class static, such that it is + * defined at compile time for a class using the DECLARE_INPUT_INTERFACE + * macros below. Static dispatch maps conserve space since they are shared + * by all instances of an InputInterface subclass. InputInterface instances + * may also have dynamic dispatch maps if needed. */ class InputInterfaceDispatch { private: @@ -251,6 +286,14 @@ /** Interface for classes that can handle input events. * + * InputInterface subclasses can define class-specific handlers using the + * various BIND macros. These bindings map events to methods within the + * InputInterface subclass, and do not incur any per-instance runtime + * storage costs. InputInterface also supports dynamic event handlers + * that are created at runtime. There is a per-instance storage cost for + * dynamic handlers. Dynamic handlers override static handlers for the + * same event id. + * * The following is a minimal example of a class that defines handlers * for a few events. More elaborate behavior can be achieved by overriding * some of the virtual methods in this interface. The definition of the @@ -307,7 +350,8 @@ */ class InputInterface { public: - virtual ~InputInterface() {} + InputInterface(); + virtual ~InputInterface(); /** These methods are called by VirtualHID to allow the InputInterface to access * the raw input events. The default implementation returns false, which causes @@ -329,6 +373,29 @@ */ virtual bool onMapEvent(MapEvent const &); + /** Bind a handler to an action event at runtime. Using runtime + * handlers (as opposed to the class handlers set by the BIND + * macros) incurs storage costs per instance. + */ + void bindActionEvent(std::string const &id, ActionEventSlot const &slot) { + runtimeDispatch()->bindAction(id, slot); + } + + /** Bind a handler to an axis event at runtime. Using runtime + * handlers (as opposed to the class handlers set by the BIND + * macros) incurs storage costs per instance. + */ + void bindAxisEvent(std::string const &id, AxisEventSlot const &slot) { + runtimeDispatch()->bindAxis(id, slot); + } + + /** Bind a handler to a motion event at runtime. Using runtime + * handlers (as opposed to the class handlers set by the BIND + * macros) incurs storage costs per instance. + */ + void bindMotionEvent(std::string const &id, MotionEventSlot const &slot) { + runtimeDispatch()->bindMotion(id, slot); + } protected: /** Internal */ @@ -341,6 +408,12 @@ bool onCommand(std::string const &id, int x, int y); bool onAxis(std::string const &id, double value); bool onMotion(std::string const &id, int x, int y, int dx, int dy); + + RuntimeDispatch *runtimeDispatch() { + if (!m_RuntimeDispatch) m_RuntimeDispatch = new RuntimeDispatch; + return m_RuntimeDispatch; + } + RuntimeDispatch *m_RuntimeDispatch; }; Modified: trunk/CSP/CSPSim/Source/InputInterface.cpp =================================================================== --- trunk/CSP/CSPSim/Source/InputInterface.cpp 2005-06-06 05:36:05 UTC (rev 1548) +++ trunk/CSP/CSPSim/Source/InputInterface.cpp 2005-06-06 05:48:41 UTC (rev 1549) @@ -40,6 +40,12 @@ } } +InputInterface::InputInterface(): m_RuntimeDispatch(0) { } + +InputInterface::~InputInterface() { + delete m_RuntimeDispatch; // ok if null +} + bool InputInterface::onCommand(std::string const &id, int x, int y) { InputInterfaceDispatch *map = _getInputInterfaceDispatch(); if (!map) return false; @@ -59,6 +65,9 @@ } bool InputInterface::onMapEvent(MapEvent const &event) { + if (m_RuntimeDispatch) { + return m_RuntimeDispatch->onMapEvent(event); + } switch (event.type) { case MapEvent::ID_COMMAND_EVENT: return onCommand(event.id, event.id_command.x, event.id_command.y); @@ -72,3 +81,41 @@ return false; } +bool RuntimeDispatch::onMapEvent(MapEvent const &event) { + ActionCallbacks::iterator action_iter; + MotionCallbacks::iterator motion_iter; + AxisCallbacks::iterator axis_iter; + switch (event.type) { + case MapEvent::ID_COMMAND_EVENT: + action_iter = m_ActionCallbacks.find(event.id); + if (action_iter == m_ActionCallbacks.end()) return false; + action_iter->second.emit(event.id_command.x, event.id_command.y); + return true; + case MapEvent::ID_AXIS_EVENT: + axis_iter = m_AxisCallbacks.find(event.id); + if (axis_iter == m_AxisCallbacks.end()) return false; + axis_iter->second.emit(event.id_axis.value); + return true; + case MapEvent::ID_MOTION_EVENT: + motion_iter = m_MotionCallbacks.find(event.id); + if (motion_iter == m_MotionCallbacks.end()) return false; + motion_iter->second.emit(event.id_motion.x, event.id_motion.y, event.id_motion.dx, event.id_motion.dy); + return true; + default: + break; + } + return false; +}; + +void RuntimeDispatch::bindAction(std::string const &id, ActionEventSlot const &callback) { + m_ActionCallbacks[id].connect(callback); +} + +void RuntimeDispatch::bindMotion(std::string const &id, MotionEventSlot const &callback) { + m_MotionCallbacks[id].connect(callback); +} + +void RuntimeDispatch::bindAxis(std::string const &id, AxisEventSlot const &callback) { + m_AxisCallbacks[id].connect(callback); +} + |
From: <sv...@ww...> - 2005-06-06 05:36:13
|
Author: mkrose Date: 2005-06-05 22:36:05 -0700 (Sun, 05 Jun 2005) New Revision: 1548 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/ChunkLodTerrain.h trunk/CSP/CSPSim/Include/DemeterTerrain.h trunk/CSP/CSPSim/Include/TerrainObject.h trunk/CSP/CSPSim/Source/CSPSim.cpp trunk/CSP/CSPSim/Source/ChunkLodTerrain.cpp trunk/CSP/CSPSim/Source/DemeterTerrain.cpp trunk/CSP/CSPSim/Source/TerrainObject.cpp Log: Finally remove screen size globals. Add screen size hints to terrain classes. Also add an debug config flag to disable rendering, which is helpful when running multiple instances on the same machine to test networking. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1548 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-05-15 08:13:23 UTC (rev 1547) +++ trunk/CSP/CSPSim/CHANGES.current 2005-06-06 05:36:05 UTC (rev 1548) @@ -1,6 +1,12 @@ Version 0.4.0 (in progress) =========================== +2005-06-05: onsight + * Finally remove screen size globals. Add screen size hints + to terrain classes. Also add an debug config flag to disable + rendering, which is helpful when running multiple instances + on the same machine to test networking. + 2005-05-14: onsight * Add a list of contacts to SimObject of nearby vehicles that is maintained by the Battlefield. The battlefield was already Modified: trunk/CSP/CSPSim/Include/ChunkLodTerrain.h =================================================================== --- trunk/CSP/CSPSim/Include/ChunkLodTerrain.h 2005-05-15 08:13:23 UTC (rev 1547) +++ trunk/CSP/CSPSim/Include/ChunkLodTerrain.h 2005-06-06 05:36:05 UTC (rev 1548) @@ -85,6 +85,7 @@ virtual float getGroundElevation(double x, double y, IntersectionHint &); void setCameraPosition(double, double, double); + virtual void setScreenSizeHint(int width, int height); int getTerrainPolygonsRendered() const; osg::Node *getNode(); @@ -106,7 +107,9 @@ float m_LatticeWidth; float m_LatticeHeight; simdata::Vector3 m_Origin; - + int m_ScreenWidth; + int m_ScreenHeight; + protected: virtual void postCreate(); Modified: trunk/CSP/CSPSim/Include/DemeterTerrain.h =================================================================== --- trunk/CSP/CSPSim/Include/DemeterTerrain.h 2005-05-15 08:13:23 UTC (rev 1547) +++ trunk/CSP/CSPSim/Include/DemeterTerrain.h 2005-06-06 05:36:05 UTC (rev 1548) @@ -100,8 +100,10 @@ simdata::Vector3 getOrigin(simdata::Vector3 const &) const; virtual void endDraw(); + virtual void setScreenSizeHint(int width, int height); + protected: - + bool m_DynamicTextures; bool m_TextureCompression; bool m_PreloadTextures; @@ -121,8 +123,10 @@ int m_LatticeHeight; simdata::Vector3 m_Offset; float m_CellWidth, m_CellHeight; + int m_ScreenWidth; + int m_ScreenHeight; - + protected: virtual void postCreate(); Modified: trunk/CSP/CSPSim/Include/TerrainObject.h =================================================================== --- trunk/CSP/CSPSim/Include/TerrainObject.h 2005-05-15 08:13:23 UTC (rev 1547) +++ trunk/CSP/CSPSim/Include/TerrainObject.h 2005-06-06 05:36:05 UTC (rev 1548) @@ -110,6 +110,7 @@ virtual void activate() = 0; virtual void deactivate() = 0; virtual bool isActive() = 0; + virtual void setScreenSizeHint(int, int) {} virtual void setCameraPosition(double, double, double) = 0; virtual void testLineOfSight(Intersection &, IntersectionHint &) = 0; virtual float getGroundElevation(double x, double y, simdata::Vector3 &normal, IntersectionHint &) = 0; Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp =================================================================== --- trunk/CSP/CSPSim/Source/CSPSim.cpp 2005-05-15 08:13:23 UTC (rev 1547) +++ trunk/CSP/CSPSim/Source/CSPSim.cpp 2005-06-06 05:36:05 UTC (rev 1548) @@ -103,8 +103,9 @@ #endif -int g_ScreenWidth = 0; -int g_ScreenHeight = 0; +// For network testing on a single box it's convenient to disable rendering on +// one of the sims. Using a global here just because we're lazy. +bool g_DisableRender = false; struct SDLWave { @@ -142,6 +143,8 @@ std::string logfile = g_Config.getString("Debug", "LogFile", "CSPSim.log", true); csplog().setOutput(logfile); + g_DisableRender = g_Config.getBool("Debug", "DisableRender", false, false); + CSP_LOG(APP, INFO, "Constructing CSPSim Object..."); m_Clean = true; @@ -310,6 +313,7 @@ assert(m_Theater.valid()); m_Terrain = m_Theater->getTerrain(); assert(m_Terrain.valid()); + m_Terrain->setScreenSizeHint(m_ScreenWidth, m_ScreenHeight); m_Terrain->activate(); // configure the atmosphere for the theater location @@ -578,7 +582,9 @@ m_CurrentScreen->onUpdate(dt); PROF1(_screen_update, 60); PROF0(_screen_render); - m_CurrentScreen->onRender(); + if (!g_DisableRender) { + m_CurrentScreen->onRender(); + } PROF1(_screen_render, 60); } @@ -670,7 +676,7 @@ SDL_Event event; short doPoll = 10; while (doPoll-- && (*m_InputEvent)(event)) { - //while (doPoll-- && SDL_PollEvent(&event)) { + //while (doPoll-- && SDL_PollEvent(&event)) { bool handled = false; HID::translate(event); if (event.type == SDL_QUIT) { @@ -693,7 +699,7 @@ } } if (!handled && m_Interface.valid()) { - CSP_LOG(APP, DEBUG, "CSPSim::doInput()-Calling m_Interface->onEvent()"); + CSP_LOG(APP, DEBUG, "CSPSim::doInput()-Calling m_Interface->onEvent()"); handled = m_Interface->onEvent(event); } } @@ -733,9 +739,6 @@ m_ScreenHeight = height; m_ScreenWidth = width; - - g_ScreenHeight = height; - g_ScreenWidth = width; if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) != 0) { std::cerr << "Unable to initialize SDL: " << SDL_GetError() << "\n"; Modified: trunk/CSP/CSPSim/Source/ChunkLodTerrain.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ChunkLodTerrain.cpp 2005-05-15 08:13:23 UTC (rev 1547) +++ trunk/CSP/CSPSim/Source/ChunkLodTerrain.cpp 2005-06-06 05:36:05 UTC (rev 1548) @@ -43,10 +43,7 @@ * signal handler for screen size and fov changes */ -extern int g_ScreenWidth; -extern int g_ScreenHeight; - SIMDATA_REGISTER_INTERFACE(ChunkLodTerrain) @@ -85,6 +82,10 @@ //m_ElevationScale; m_LatticeWidth = 8000.0; m_LatticeHeight = 8000.0; + + // arbitrary default + m_ScreenWidth = 1280; + m_ScreenHeight = 1024; } ChunkLodTerrain::~ChunkLodTerrain() @@ -118,6 +119,14 @@ } } +void ChunkLodTerrain::setScreenSizeHint(int width, int height) { + m_ScreenWidth = width; + m_ScreenHeight = height; + if (m_Loaded) { + m_Terrain->setCameraParameters(width, 60.0); // XXX + } +} + void ChunkLodTerrain::load() { if (m_Loaded) return; std::string terrain_path = getDataPath("TerrainPath"); @@ -129,7 +138,7 @@ m_Terrain = new osgChunkLod::ChunkLodTree(chu_file.c_str(), m_Texture, m_ElevationMap.get(), scale); m_Terrain->loaderUseThread(m_UseLoaderThread); m_Terrain->setQuality(m_BaseScreenError, m_BaseTexelSize); - m_Terrain->setCameraParameters(g_ScreenWidth, 60.0); // XXX + m_Terrain->setCameraParameters(m_ScreenWidth, 60.0); // XXX m_Terrain->setLatticeDimensions(m_LatticeWidth, m_LatticeHeight); std::cout << "TERRAIN CREATED\n"; Modified: trunk/CSP/CSPSim/Source/DemeterTerrain.cpp =================================================================== --- trunk/CSP/CSPSim/Source/DemeterTerrain.cpp 2005-05-15 08:13:23 UTC (rev 1547) +++ trunk/CSP/CSPSim/Source/DemeterTerrain.cpp 2005-06-06 05:36:05 UTC (rev 1548) @@ -39,10 +39,6 @@ #include <osg/StateSet> -extern int g_ScreenWidth; -extern int g_ScreenHeight; - - SIMDATA_REGISTER_INTERFACE(DemeterTerrain) @@ -85,6 +81,10 @@ m_LatticeTexExt = ""; m_LatticeWidth = 0; m_LatticeHeight = 0; + + // arbitrary default + m_ScreenWidth = 1280; + m_ScreenHeight = 1024; } DemeterTerrain::~DemeterTerrain() @@ -376,14 +376,22 @@ } } +void DemeterTerrain::setScreenSizeHint(int width, int height) { + m_ScreenWidth = width; + m_ScreenHeight = height; + if (m_Loaded) { + Demeter::Settings::GetInstance()->SetScreenWidth(width); + Demeter::Settings::GetInstance()->SetScreenHeight(height); + } +} void DemeterTerrain::updateDemeterSettings() { std::string terrain_path = getDataPath("TerrainPath"); bool verbose = g_Config.getBool("Debug", "Demeter", false, true); Demeter::Settings::GetInstance()->SetMediaPath(terrain_path.c_str()); Demeter::Settings::GetInstance()->SetVerbose(verbose); - Demeter::Settings::GetInstance()->SetScreenWidth(g_ScreenWidth); - Demeter::Settings::GetInstance()->SetScreenHeight(g_ScreenHeight); + Demeter::Settings::GetInstance()->SetScreenWidth(m_ScreenWidth); + Demeter::Settings::GetInstance()->SetScreenHeight(m_ScreenHeight); Demeter::Settings::GetInstance()->SetPreloadTextures(m_PreloadTextures); Demeter::Settings::GetInstance()->SetTextureCompression(m_TextureCompression); Demeter::Settings::GetInstance()->SetUseDynamicTextures(m_DynamicTextures); Modified: trunk/CSP/CSPSim/Source/TerrainObject.cpp =================================================================== --- trunk/CSP/CSPSim/Source/TerrainObject.cpp 2005-05-15 08:13:23 UTC (rev 1547) +++ trunk/CSP/CSPSim/Source/TerrainObject.cpp 2005-06-06 05:36:05 UTC (rev 1548) @@ -26,20 +26,9 @@ #include "TerrainObject.h" #include "Config.h" -#include <SimCore/Util/Log.h> - #include <osg/LineSegment> -/*// -#include "Terrain.h" -#include "DemeterDrawable.h" -#include "TerrainTextureFactory.h" -#include <osg/Geode> -#include <osg/StateSet> -extern int g_ScreenWidth; -extern int g_ScreenHeight; -*/ - +#include <SimCore/Util/Log.h> #include <SimData/InterfaceRegistry.h> #include <SimData/osg.h> |
From: <sv...@ww...> - 2005-05-15 08:13:30
|
Author: delta Date: 2005-05-15 01:13:23 -0700 (Sun, 15 May 2005) New Revision: 1547 Modified: trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp trunk/CSP/CSPSim/Source/Views/View.cpp Log: * Temporary fix for forward decalrations of class (vc++). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1547 Modified: trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp 2005-05-14 22:25:01 UTC (rev 1546) +++ trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp 2005-05-15 08:13:23 UTC (rev 1547) @@ -27,8 +27,12 @@ #include "Views/CameraAgent.h" #include "Views/CameraKinematics.h" +// FIXME: why Animation class definition is needed here (vc++ error) +#include "Animation.h" #include "CSPSim.h" #include "DynamicObject.h" +// FIXME: why ObjetModel class definition is needed here (vc++ error) +#include "ObjectModel.h" #include <SimData/Noise.h> @@ -127,7 +131,7 @@ const float SAFETY = 2.0f; TerrainObject::IntersectionHint camera_hint = 0; float h = SAFETY + terrain->getGroundElevation(ep.x(), ep.y(), camera_hint); - float d = ep.z() - h; + float d = static_cast<float>(ep.z() - h); if (d<0) ep.z() -= d; } } Modified: trunk/CSP/CSPSim/Source/Views/View.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/View.cpp 2005-05-14 22:25:01 UTC (rev 1546) +++ trunk/CSP/CSPSim/Source/Views/View.cpp 2005-05-15 08:13:23 UTC (rev 1547) @@ -29,8 +29,12 @@ #include "Views/InternalView.h" #include "Views/ExternalViews.h" +// FIXME: why Animation class definition is needed here (vc++ error) +#include "Animation.h" #include "CSPSim.h" #include "DynamicObject.h" +// FIXME: why ObjetModel class definition is needed here (vc++ error) +#include "ObjectModel.h" #include "VirtualScene.h" #include <SimCore/Battlefield/LocalBattlefield.h> @@ -185,4 +189,4 @@ ca->attach(7, createView_7()); ca->attach(8, createView_8()); ca->attach(9, createView_9()); -} +} \ No newline at end of file |
From: <sv...@ww...> - 2005-05-14 22:25:12
|
Author: mkrose Date: 2005-05-14 15:25:01 -0700 (Sat, 14 May 2005) New Revision: 1546 Added: trunk/CSP/CSPSim/Include/Views/ExternalViews.h trunk/CSP/CSPSim/Include/Views/InternalView.h trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp trunk/CSP/CSPSim/Source/Views/InternalView.cpp Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/gear.xml trunk/CSP/CSPSim/Include/GameScreen.h trunk/CSP/CSPSim/Include/Views/CameraAgent.h trunk/CSP/CSPSim/Include/Views/CameraCommand.h trunk/CSP/CSPSim/Include/Views/CameraKinematics.h trunk/CSP/CSPSim/Include/Views/View.h trunk/CSP/CSPSim/Source/GameScreen.cpp trunk/CSP/CSPSim/Source/SConscript trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp trunk/CSP/CSPSim/Source/Views/View.cpp trunk/CSP/CSPSim/Tools/HID/Maps/gamescreen-core.map trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: * Refactor the view classes slightly and combine the internal view with the padlock view. Add a separate camera manipulator for each view. Implement somewhat more realistic motion of the pilot's view point. Add new view manipulation and padlock events. Some of the new features include: - Model eye, head, and torso movements separately. Each has its own limits of motion, slew rate, and affect on the view point. - Torso and neck movements are slowed/restricted at high G. - Move the view point in response to aircraft acceleration. - Padlock limited to nearby vehicles within 30 deg of the view direction. The max padlock range depends on the size of the target and its aspect. Other features (such as los, light level, atmospheric conditions will be implemented later). - Re-padlocking cycles between objects within 5 degrees of the view direction. ==> ALL USERS: RebuildData.py and regenerate Inputs/gamescreen.hid. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1546 Diff omitted (63614 bytes). |
From: <sv...@ww...> - 2005-05-14 22:08:39
|
Author: mkrose Date: 2005-05-14 15:08:32 -0700 (Sat, 14 May 2005) New Revision: 1545 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/theater/balkan/runway/model.xml trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Include/ObjectModel.h trunk/CSP/CSPSim/Source/DynamicObject.cpp trunk/CSP/CSPSim/Source/ObjectModel.cpp Log: * Clean up HUD binding to scene model to make it easier the set the hud perspective from the view point. * Disable depth buffer writes for models that use polygon offset and increase the offset factor. Change the polygon offset value for the runway as well. This should eliminate z-fighting with the terrain while not interfering with objects positioned just above the runway. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1545 Diff omitted (10341 bytes). |
From: <sv...@ww...> - 2005-05-14 20:19:54
|
Author: mkrose Date: 2005-05-14 13:19:42 -0700 (Sat, 14 May 2005) New Revision: 1544 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/SimCore/Battlefield/Battlefield.cpp trunk/CSP/SimCore/Battlefield/Battlefield.h trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp trunk/CSP/SimCore/Battlefield/LocalBattlefield.h trunk/CSP/SimCore/Battlefield/SimObject.cpp trunk/CSP/SimCore/Battlefield/SimObject.h Log: Add a list of contacts to SimObject of nearby vehicles that is maintained by the Battlefield. The battlefield was already compiling this list, it just wasn't easily accessible from within a SimObject class. Currently the list is updated every few seconds, and there is a hash of the ids in the list to make it easy to detect when the list has changed. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1544 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-05-14 19:54:53 UTC (rev 1543) +++ trunk/CSP/CSPSim/CHANGES.current 2005-05-14 20:19:42 UTC (rev 1544) @@ -1,10 +1,18 @@ Version 0.4.0 (in progress) =========================== +2005-05-14: onsight + * Add a list of contacts to SimObject of nearby vehicles that is + maintained by the Battlefield. The battlefield was already + compiling this list, it just wasn't easily accessible from + within a SimObject class. Currently the list is updated every + few seconds, and there is a hash of the ids in the list to make + it easy to detect when the list has changed. + 2005-05-04: delta * Replace 'remainder' by 'fmod'. - - * Protect hud binding when no bus is defined (in + + * Protect hud binding when no bus is defined (in SceneModel::bindAnimationChannels). 2005-05-03: onsight Modified: trunk/CSP/SimCore/Battlefield/Battlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/Battlefield.cpp 2005-05-14 19:54:53 UTC (rev 1543) +++ trunk/CSP/SimCore/Battlefield/Battlefield.cpp 2005-05-14 20:19:42 UTC (rev 1544) @@ -291,6 +291,11 @@ } } +Battlefield::Unit Battlefield::getUnitById(ObjectId id) { + UnitWrapper *wrapper = findUnitWrapper(id); + return wrapper ? wrapper->unit() : 0; +} + Battlefield::UnitWrapper *Battlefield::findUnitWrapper(ObjectId id) { UnitMap::iterator iter = m_UnitMap.find(id); if (iter == m_UnitMap.end()) return 0; Modified: trunk/CSP/SimCore/Battlefield/Battlefield.h =================================================================== --- trunk/CSP/SimCore/Battlefield/Battlefield.h 2005-05-14 19:54:53 UTC (rev 1543) +++ trunk/CSP/SimCore/Battlefield/Battlefield.h 2005-05-14 20:19:42 UTC (rev 1544) @@ -119,6 +119,9 @@ */ Unit getNextUnit(Unit const &unit, int human, int local, int category); + /** Lookup a unit by its id. + */ + Unit getUnitById(ObjectId id); protected: Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2005-05-14 19:54:53 UTC (rev 1543) +++ trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2005-05-14 20:19:42 UTC (rev 1544) @@ -237,15 +237,20 @@ dynamicIndex()->query(region, contacts); const unsigned n_contacts = contacts.size(); std::vector<PeerContact> peer_contacts; + unit->m_ContactList.resize(0); peer_contacts.reserve(n_contacts); simdata::Vector3 unit_position = unit->getGlobalPosition(); + simdata::uint32 signature = 0; for (unsigned i=0; i < n_contacts; ++i) { LocalUnitWrapper *contact = static_cast<LocalUnitWrapper*>(contacts[i]); if (contact->id() == wrapper->id()) continue; if (!contact->unit()) continue; float distance = static_cast<float>((contact->unit()->getGlobalPosition() - unit_position).length2()); peer_contacts.push_back(PeerContact(contact->owner(), distance)); + unit->m_ContactList.push_back(contact->id()); + signature = simdata::make_unordered_fingerprint(signature, simdata::hash_uint32(static_cast<uint32>(contact->id()))); } + unit->m_ContactSignature = signature; CSP_LOG(BATTLEFIELD, INFO, "found " << peer_contacts.size() << " nearby units"); if (!peer_contacts.empty()) { std::sort(peer_contacts.begin(), peer_contacts.end(), PeerContactSorter()); Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.h =================================================================== --- trunk/CSP/SimCore/Battlefield/LocalBattlefield.h 2005-05-14 19:54:53 UTC (rev 1543) +++ trunk/CSP/SimCore/Battlefield/LocalBattlefield.h 2005-05-14 20:19:42 UTC (rev 1544) @@ -185,7 +185,13 @@ int m_ScanSignature; std::vector<Unit> m_ScanUnits; + // Perform a spatial query for objects near the specified unit. Updates + // the unit's contact list and the rate at which position messages are + // sent to peers. Called by continueUnitScan. void scanUnit(LocalUnitWrapper *wrapper); + + // Continue a slow iteration through all units in the battlefield, calling + // scanUnit on each. This method should be called once per time step. void continueUnitScan(double dt); simdata::ScopedPointer<simcore::Signal2<int, const std::string&> > m_PlayerJoinSignal; Modified: trunk/CSP/SimCore/Battlefield/SimObject.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/SimObject.cpp 2005-05-14 19:54:53 UTC (rev 1543) +++ trunk/CSP/SimCore/Battlefield/SimObject.cpp 2005-05-14 20:19:42 UTC (rev 1544) @@ -35,7 +35,8 @@ m_Flags(0), // remote agent m_Name("?"), m_AirBubble(0), - m_GroundBubble(0) + m_GroundBubble(0), + m_ContactSignature(0) { CSP_LOG(BATTLEFIELD, DEBUG, "SimObject::SimObject(): " << _debugId()); // XXX battlefield should set this! Modified: trunk/CSP/SimCore/Battlefield/SimObject.h =================================================================== --- trunk/CSP/SimCore/Battlefield/SimObject.h 2005-05-14 19:54:53 UTC (rev 1543) +++ trunk/CSP/SimCore/Battlefield/SimObject.h 2005-05-14 20:19:42 UTC (rev 1544) @@ -73,6 +73,9 @@ int m_AirBubble; int m_GroundBubble; + std::vector<ObjectId> m_ContactList; + simdata::uint32 m_ContactSignature; + inline void setFlags(int flag, bool on) { if (on) m_Flags |= flag; else m_Flags &= ~flag; } @@ -310,6 +313,19 @@ // get the object state to be sent to remote mirrors of the object virtual simdata::Ref<simnet::NetworkMessage> getState(simcore::TimeStamp /*current_time*/, simdata::SimTime /*interval*/, int /*detail*/) const { return 0; } + // retrieve a list of ids of nearby objects. this list is periodically + // updated by the battlefield. the battlefield updates are synchronous, + // so iterators are safe to use for the duration of an object update + // method, but should not be may not remain valid across multiple updates. + // see also contactSignature(). + std::vector<ObjectId> const &getContacts() const { return m_ContactList; } + + // return a signature of the ids in the list returned by getContacts. this + // signature changes whenever objects are added or removed from the contact + // list. contact lists with the same ids have identical signatures, although + // the order of the ids may differ. + int contactSignature() const { return m_ContactSignature; } + protected: virtual void onNewContact(simdata::Ref<SimObject> const &/*contact*/) { } |
From: <sv...@ww...> - 2005-05-14 19:55:01
|
Author: mkrose Date: 2005-05-14 12:54:53 -0700 (Sat, 14 May 2005) New Revision: 1543 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/HashUtility.h trunk/CSP/SimData/Source/HashUtility.cpp Log: Add helper functions for producing 32-bit hashes for integer and string types. These all use the original newhash function to do the work. Add functions for combining 32-bit hashes to produce ordered and un- ordered fingerprints. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1543 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2005-05-04 12:07:26 UTC (rev 1542) +++ trunk/CSP/SimData/CHANGES.current 2005-05-14 19:54:53 UTC (rev 1543) @@ -1,6 +1,12 @@ Version 0.4.0 (in progress) =========================== +2005-05-14: onsight + * Add helper functions for producing 32-bit hashes for integer and string + types. These all use the original newhash function to do the work. + Add functions for combining 32-bit hashes to produce ordered and un- + ordered fingerprints. + 2005-04-02: onsight * Add a few convenience methods to LLA. Modified: trunk/CSP/SimData/Include/SimData/HashUtility.h =================================================================== --- trunk/CSP/SimData/Include/SimData/HashUtility.h 2005-05-04 12:07:26 UTC (rev 1542) +++ trunk/CSP/SimData/Include/SimData/HashUtility.h 2005-05-14 19:54:53 UTC (rev 1543) @@ -1,5 +1,5 @@ /* SimData: Data Infrastructure for Simulations - * Copyright (C) 2002 Mark Rose <tm...@st...> + * Copyright (C) 2002, 2005 Mark Rose <tm...@st...> * * This file is part of SimData. * @@ -56,7 +56,14 @@ extern SIMDATA_EXPORT uint32 newhash4_cstring(std::string const &); extern SIMDATA_EXPORT HashT newhasht_cstring(std::string const &); +/** SimData standard 32-bit hash functions. + */ +extern SIMDATA_EXPORT uint32 hash_uint32(uint32); +extern SIMDATA_EXPORT uint32 hash_uint32(uint64); +extern SIMDATA_EXPORT uint32 hash_uint32(std::string const &); +extern SIMDATA_EXPORT uint32 hash_uint32(const char *buffer, const int len); + /** A 64-bit hash value. */ struct SIMDATA_EXPORT HashT { @@ -305,6 +312,19 @@ extern std::ostream & operator<<(std::ostream &o, const hasht &x); +// Combine 32 bit hashes to produce a fingerprint that depends on the +// order of the values. +inline uint32 make_ordered_fingerprint(uint32 x, uint32 y) { + return (x << 11) ^ (x >> 21) ^ y; +} + + +// Combine 32 bit hashes to produce a fingerprint that is independent +// of the order of the values. +inline uint32 make_unordered_fingerprint(uint32 x, uint32 y) { + return x + y; +} + //@} Modified: trunk/CSP/SimData/Source/HashUtility.cpp =================================================================== --- trunk/CSP/SimData/Source/HashUtility.cpp 2005-05-04 12:07:26 UTC (rev 1542) +++ trunk/CSP/SimData/Source/HashUtility.cpp 2005-05-14 19:54:53 UTC (rev 1543) @@ -1,7 +1,7 @@ -/* SimDataCSP: Data Infrastructure for Simulations - * Copyright (C) 2002 Mark Rose <tm...@st...> +/* SimData: Data Infrastructure for Simulations + * Copyright (C) 2002, 2005 Mark Rose <tm...@st...> * - * This file is part of SimDataCSP. + * This file is part of SimData. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -24,16 +24,16 @@ * Hash functions utilities * * The hash functions coded here are from "Hash Functions for Hash - * Table Lookup" by Robert J. Jenokins Jr., and are Public Domain. + * Table Lookup" by Robert J. Jenkins Jr., and are Public Domain. * See <http://burtleburtle.net/bob/hash/evahash.html> */ + #include <sstream> #include <iomanip> #include <SimData/HashUtility.h> - NAMESPACE_SIMDATA HASH<const char*> hashstring::h; @@ -41,15 +41,15 @@ // The mixing step #define mix(a,b,c) \ { \ - a=a-b; a=a-c; a=a^(c>>13); \ - b=b-c; b=b-a; b=b^(a<<8); \ - c=c-a; c=c-b; c=c^(b>>13); \ - a=a-b; a=a-c; a=a^(c>>12); \ - b=b-c; b=b-a; b=b^(a<<16); \ - c=c-a; c=c-b; c=c^(b>>5); \ - a=a-b; a=a-c; a=a^(c>>3); \ - b=b-c; b=b-a; b=b^(a<<10); \ - c=c-a; c=c-b; c=c^(b>>15); \ + a=a-b; a=a-c; a=a^(c>>13); \ + b=b-c; b=b-a; b=b^(a<<8); \ + c=c-a; c=c-b; c=c^(b>>13); \ + a=a-b; a=a-c; a=a^(c>>12); \ + b=b-c; b=b-a; b=b^(a<<16); \ + c=c-a; c=c-b; c=c^(b>>5); \ + a=a-b; a=a-c; a=a^(c>>3); \ + b=b-c; b=b-a; b=b^(a<<10); \ + c=c-a; c=c-b; c=c^(b>>15); \ } /** A character string to 32-bit hash function. @@ -60,47 +60,46 @@ * @param length the length of the string in bytes. * @param initval the previous hash, or an arbitrary value */ -uint32 newhash(register uint8 const *k, uint32 length, uint32 initval) +inline uint32 newhash(register uint8 const *k, uint32 length, uint32 initval) { - register uint32 a,b,c; // the internal state - uint32 len; // how many key bytes still need mixing + register uint32 a,b,c; // the internal state + uint32 len; // how many key bytes still need mixing - // Set up the internal state - len = length; - a = b = 0x9e3779b9; // the golden ratio; an arbitrary value - c = initval; // variable initialization of internal state + // Set up the internal state + len = length; + a = b = 0x9e3779b9; // the golden ratio; an arbitrary value + c = initval; // variable initialization of internal state - // handle most of the key + // handle most of the key - while (len >= 12) - { - a=a+(k[0]+((uint32)k[1]<<8)+((uint32)k[2]<<16) +((uint32)k[3]<<24)); - b=b+(k[4]+((uint32)k[5]<<8)+((uint32)k[6]<<16) +((uint32)k[7]<<24)); - c=c+(k[8]+((uint32)k[9]<<8)+((uint32)k[10]<<16)+((uint32)k[11]<<24)); - mix(a,b,c); - k = k+12; len = len-12; - } + while (len >= 12) { + a=a+(k[0]+((uint32)k[1]<<8)+((uint32)k[2]<<16) +((uint32)k[3]<<24)); + b=b+(k[4]+((uint32)k[5]<<8)+((uint32)k[6]<<16) +((uint32)k[7]<<24)); + c=c+(k[8]+((uint32)k[9]<<8)+((uint32)k[10]<<16)+((uint32)k[11]<<24)); + mix(a,b,c); + k = k+12; len = len-12; + } - // handle the last 11 bytes - c = c+length; - switch(len) { // all the case statements fall through - case 11: c=c+((uint32)k[10]<<24); - case 10: c=c+((uint32)k[9]<<16); - case 9 : c=c+((uint32)k[8]<<8); - // the first byte of c is reserved for the length - case 8 : b=b+((uint32)k[7]<<24); - case 7 : b=b+((uint32)k[6]<<16); - case 6 : b=b+((uint32)k[5]<<8); - case 5 : b=b+k[4]; - case 4 : a=a+((uint32)k[3]<<24); - case 3 : a=a+((uint32)k[2]<<16); - case 2 : a=a+((uint32)k[1]<<8); - case 1 : a=a+k[0]; - // case 0: nothing left to add - } - mix(a,b,c); - // report the result - return c; + // handle the last 11 bytes + c = c+length; + switch(len) { // all the case statements fall through + case 11: c=c+((uint32)k[10]<<24); + case 10: c=c+((uint32)k[9]<<16); + case 9 : c=c+((uint32)k[8]<<8); + // the first byte of c is reserved for the length + case 8 : b=b+((uint32)k[7]<<24); + case 7 : b=b+((uint32)k[6]<<16); + case 6 : b=b+((uint32)k[5]<<8); + case 5 : b=b+k[4]; + case 4 : a=a+((uint32)k[3]<<24); + case 3 : a=a+((uint32)k[2]<<16); + case 2 : a=a+((uint32)k[1]<<8); + case 1 : a=a+k[0]; + // case 0: nothing left to add + } + mix(a,b,c); + // report the result + return c; } @@ -114,11 +113,30 @@ */ HashT newhasht_cstring(std::string const &str) { uint32 h0, h1; - h0 = newhash((uint8 const*)str.c_str(), str.size(), 0); - h1 = newhash((uint8 const*)str.c_str(), str.size(), 1); + h0 = newhash(reinterpret_cast<uint8 const*>(str.c_str()), str.size(), 0); + h1 = newhash(reinterpret_cast<uint8 const*>(str.c_str()), str.size(), 1); return HashT(h1, h0); } +// 32-bit hash helpers + +uint32 hash_uint32(uint32 x) { + return newhash(reinterpret_cast<uint8 const*>(&x), 4, 0); +} + +uint32 hash_uint32(uint64 x) { + return newhash(reinterpret_cast<uint8 const*>(&x), 8, 0); +} + +uint32 hash_uint32(std::string const &x) { + return newhash(reinterpret_cast<uint8 const*>(x.c_str()), x.size(), 0); +} + +uint32 hash_uint32(const char *buffer, const int len) { + return newhash(reinterpret_cast<uint8 const*>(buffer), len, 0); +} + + std::string HashT::str() const { std::stringstream repr; repr << *this; |
From: <sv...@ww...> - 2005-05-04 12:07:37
|
Author: delta Date: 2005-05-04 05:07:26 -0700 (Wed, 04 May 2005) New Revision: 1542 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/LandingGear.cpp trunk/CSP/CSPSim/Source/ObjectModel.cpp Log: * Replace 'remainder' by 'fmod'. * Protect hud binding when no bus is defined (in SceneModel::bindAnimationChannels). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1542 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-05-04 06:37:37 UTC (rev 1541) +++ trunk/CSP/CSPSim/CHANGES.current 2005-05-04 12:07:26 UTC (rev 1542) @@ -1,6 +1,12 @@ Version 0.4.0 (in progress) =========================== +2005-05-04: delta + * Replace 'remainder' by 'fmod'. + + * Protect hud binding when no bus is defined (in + SceneModel::bindAnimationChannels). + 2005-05-03: onsight * Replace the object update message with a new format that provides much better support for animations. Animations that need to be Modified: trunk/CSP/CSPSim/Source/LandingGear.cpp =================================================================== --- trunk/CSP/CSPSim/Source/LandingGear.cpp 2005-05-04 06:37:37 UTC (rev 1541) +++ trunk/CSP/CSPSim/Source/LandingGear.cpp 2005-05-04 12:07:26 UTC (rev 1542) @@ -348,8 +348,8 @@ void LandingGear::updateAnimation(double dt) { if (m_GearAnimation.valid()) { m_GearAnimation->update(dt); - m_GearAnimation->setCompression(m_Compression / m_CompressionLimit); - m_GearAnimation->setTireRotation(remainder(m_TireRotation, 2.0*simdata::PI)); + m_GearAnimation->setCompression(m_Compression / m_CompressionLimit); + m_GearAnimation->setTireRotation(fmod(m_TireRotation, 2.0*simdata::PI)); if (m_SteeringLimit > 0.0) { m_GearAnimation->setSteeringAngle(toRadians(m_SteeringAngle)); } Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ObjectModel.cpp 2005-05-04 06:37:37 UTC (rev 1541) +++ trunk/CSP/CSPSim/Source/ObjectModel.cpp 2005-05-04 12:07:26 UTC (rev 1542) @@ -747,22 +747,23 @@ CSP_LOG(OBJECT, ERROR, "bindAnimationChannels: animation channel '" << name << "' type not supported; skipping"); } } + + // XXX Hack for testing + CSP_LOG(OBJECT, DEBUG, "Trying to bind HUD"); + DataChannel<HUD*>::CRef hud_channel = bus->getChannel("HUD", false); + if (hud_channel.valid()) { + HUD *hud = hud_channel->value(); + CSP_LOG(OBJECT, DEBUG, "Found HUD"); + m_3dHud = hud->hud(); + m_3dHud->setPosition(simdata::toOSG(m_Model->getHudPlacement())); + m_CenterOfMassOffset->addChild(hud->hud()); + hud->setOrigin(simdata::toOSG(m_Model->getHudPlacement())); + hud->setViewPoint(simdata::toOSG(m_Model->getViewPoint())); + hud->setDimensions(m_Model->getHudWidth(), m_Model->getHudHeight()); + CSP_LOG(OBJECT, DEBUG, "HUD added to model"); + } + CSP_LOG(OBJECT, DEBUG, "bindAnimationChannels complete"); } - // XXX Hack for testing - CSP_LOG(OBJECT, DEBUG, "Trying to bind HUD"); - DataChannel<HUD*>::CRef hud_channel = bus->getChannel("HUD", false); - if (hud_channel.valid()) { - HUD *hud = hud_channel->value(); - CSP_LOG(OBJECT, DEBUG, "Found HUD"); - m_3dHud = hud->hud(); - m_3dHud->setPosition(simdata::toOSG(m_Model->getHudPlacement())); - m_CenterOfMassOffset->addChild(hud->hud()); - hud->setOrigin(simdata::toOSG(m_Model->getHudPlacement())); - hud->setViewPoint(simdata::toOSG(m_Model->getViewPoint())); - hud->setDimensions(m_Model->getHudWidth(), m_Model->getHudHeight()); - CSP_LOG(OBJECT, DEBUG, "HUD added to model"); - } - CSP_LOG(OBJECT, DEBUG, "bindAnimationChannels complete"); } void SceneModel::onViewMode(bool internal) { |
Author: mkrose Date: 2005-05-03 23:37:37 -0700 (Tue, 03 May 2005) New Revision: 1541 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/model.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/systems.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16DJ.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml trunk/CSP/CSPSim/Include/AircraftObject.h trunk/CSP/CSPSim/Include/Animation.h trunk/CSP/CSPSim/Include/Controller.h trunk/CSP/CSPSim/Include/GearAnimation.h trunk/CSP/CSPSim/Include/ObjectModel.h trunk/CSP/CSPSim/Include/System.h trunk/CSP/CSPSim/Include/SystemsModel.h trunk/CSP/CSPSim/Source/AircraftObject.cpp trunk/CSP/CSPSim/Source/Animation.cpp trunk/CSP/CSPSim/Source/Controller.cpp trunk/CSP/CSPSim/Source/F16/F16System.cpp trunk/CSP/CSPSim/Source/F16/F16System.h trunk/CSP/CSPSim/Source/GearAnimation.cpp trunk/CSP/CSPSim/Source/LandingGear.cpp trunk/CSP/CSPSim/Source/ObjectUpdate.net trunk/CSP/CSPSim/Source/System.cpp Log: * Replace the object update message with a new format that provides much better support for animations. Animations that need to be transmitted to remote hosts are now extracted automatically from the object model and send as needed based on state changes and lod. Model files now specify lod limits and control channel ranges for each animation. The latter are used to scale the channel data down to 8 bits for transmission. Note that only scalar data channels are supported for animations (no vector channels). Animations at lod level >= 10 will not be sent (and should be used for small details such as cockpit switches). * Convert the m2k gear compression animation to use a scalar channel. * Move the canopy and fuel door animation drivers and event handlers from AircraftObject to F16System. * Systems now register channels in a single pass, after the parent object (DynamicObject subclass) registers its channels. This is faster and allows the Controller system to access the ObjectModel when registering animation channels. ===> ALL USERS: RebuildData.py ===> NOTE that these changes are incompatible previous versions for mulitplayer network communications. Do not mix and match binaries with and without this change for multiplayer testing. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1541 Diff omitted (68778 bytes). |
From: <sv...@ww...> - 2005-05-01 15:54:36
|
Author: mkrose Date: 2005-05-01 08:54:29 -0700 (Sun, 01 May 2005) New Revision: 1540 Modified: trunk/CSP/SimNet/PeerInfo.cpp Log: Increase the timeout for inactive peers, since the sim initialization after establishish a connection to the index server can take more than 15s. This is just a temporary fix; we should never block for so long. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1540 Modified: trunk/CSP/SimNet/PeerInfo.cpp =================================================================== --- trunk/CSP/SimNet/PeerInfo.cpp 2005-05-01 15:52:35 UTC (rev 1539) +++ trunk/CSP/SimNet/PeerInfo.cpp 2005-05-01 15:54:29 UTC (rev 1540) @@ -350,7 +350,7 @@ ni->resend(packet); } bool remove = false; - if (peer->getDeadTime() > 15.0) { + if (peer->getDeadTime() > 30.0) { SIMNET_LOG(PEER, ALERT, "dead time expired for peer " << peer->getId() << " (" << peer->getDeadTime() << " s)"); if (ni->handleDeadPeer(peer)) remove = true; } |
From: <sv...@ww...> - 2005-05-01 15:52:41
|
Author: mkrose Date: 2005-05-01 08:52:35 -0700 (Sun, 01 May 2005) New Revision: 1539 Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h Log: Fix global battlefield so that it doesn't send add/remove unit messages to the client that owns the unit. This issue arises when a client has multiple local units. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1539 Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h =================================================================== --- trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h 2005-05-01 15:43:07 UTC (rev 1538) +++ trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h 2005-05-01 15:52:35 UTC (rev 1539) @@ -465,23 +465,28 @@ ContactWrapper *cfrom = static_cast<ContactWrapper*>(from); CSP_LOG(BATTLEFIELD, DEBUG, "INCREMENT: " << *(from->unit()) << " -> " << *(to->unit())); if (cfrom->incrementCount(to->owner())) { - CSP_LOG(BATTLEFIELD, INFO, "sending add unit " << from->unit()->id() << " to client " << to->owner()); - { // tell OWNER[to] to expect updates from OWNER[from] - CommandAddUnit::Ref msg = new CommandAddUnit(); - msg->set_unit_id(from->id()); - msg->set_unit_class(simdata::Path(from->unit()->getObjectPath())); - msg->set_unit_type(static_cast<const simdata::uint8>(from->unit()->type())); - msg->set_owner_id(from->owner()); - msg->set_grid_x(from->point().x()); - msg->set_grid_y(from->point().y()); - sendClientCommand(msg, to->owner()); + // if the units are owned by the same client we still reference count + // but we don't send an update. both units will already be present in + // the client's local battlefield. + if (from->owner() != to->owner()) { + CSP_LOG(BATTLEFIELD, INFO, "sending add unit " << from->unit()->id() << " to client " << to->owner()); + { // tell OWNER[to] to expect updates from OWNER[from] + CommandAddUnit::Ref msg = new CommandAddUnit(); + msg->set_unit_id(from->id()); + msg->set_unit_class(simdata::Path(from->unit()->getObjectPath())); + msg->set_unit_type(static_cast<const simdata::uint8>(from->unit()->type())); + msg->set_owner_id(from->owner()); + msg->set_grid_x(from->point().x()); + msg->set_grid_y(from->point().y()); + sendClientCommand(msg, to->owner()); + } + { // tell OWNER[from] to update OWNER[to] + CommandUpdatePeer::Ref msg = new CommandUpdatePeer(); + msg->set_unit_id(from->id()); + msg->set_peer_id(to->owner()); + sendClientCommand(msg, from->owner()); + } } - { // tell OWNER[from] to update OWNER[to] - CommandUpdatePeer::Ref msg = new CommandUpdatePeer(); - msg->set_unit_id(from->id()); - msg->set_peer_id(to->owner()); - sendClientCommand(msg, from->owner()); - } } } @@ -489,19 +494,24 @@ ContactWrapper *cfrom = static_cast<ContactWrapper*>(from); CSP_LOG(BATTLEFIELD, DEBUG, "DECREMENT: " << *(from->unit()) << " -> " << *(to->unit())); if (cfrom->decrementCount(to->owner())) { - CSP_LOG(BATTLEFIELD, INFO, "sending remove unit " << from->unit()->id() << " to client " << to->owner()); - { - CommandRemoveUnit::Ref msg = new CommandRemoveUnit(); - msg->set_unit_id(from->id()); - sendClientCommand(msg, to->owner()); + // if the units are owned by the same client we still reference count + // but we don't send an update. removal and notification of local units + // has already been done in the client's battlefield. + if (from->owner() != to->owner()) { + CSP_LOG(BATTLEFIELD, INFO, "sending remove unit " << from->unit()->id() << " to client " << to->owner()); + { + CommandRemoveUnit::Ref msg = new CommandRemoveUnit(); + msg->set_unit_id(from->id()); + sendClientCommand(msg, to->owner()); + } + { + CommandUpdatePeer::Ref msg = new CommandUpdatePeer(); + msg->set_unit_id(from->id()); + msg->set_peer_id(to->owner()); + msg->set_stop(true); + sendClientCommand(msg, from->owner()); + } } - { - CommandUpdatePeer::Ref msg = new CommandUpdatePeer(); - msg->set_unit_id(from->id()); - msg->set_peer_id(to->owner()); - msg->set_stop(true); - sendClientCommand(msg, from->owner()); - } } } |
From: <sv...@ww...> - 2005-05-01 15:43:15
|
Author: mkrose Date: 2005-05-01 08:43:07 -0700 (Sun, 01 May 2005) New Revision: 1538 Modified: trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Source/FlightModel.cpp trunk/CSP/SimCore/Battlefield/test-client.cpp trunk/CSP/SimData/Include/SimData/Referenced.h trunk/CSP/SimData/Source/LogStream.cpp Log: Fix compiler errors under gcc 3.4 targeting x86-64. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1538 Modified: trunk/CSP/CSPSim/Include/DynamicObject.h =================================================================== --- trunk/CSP/CSPSim/Include/DynamicObject.h 2005-05-01 09:13:08 UTC (rev 1537) +++ trunk/CSP/CSPSim/Include/DynamicObject.h 2005-05-01 15:43:07 UTC (rev 1538) @@ -143,8 +143,8 @@ virtual simdata::Vector3 getViewPoint() const; - virtual void onAggregate() { CSP_LOG(APP, INFO, "aggregate @ " << int(this)); } - virtual void onDeaggregate() { CSP_LOG(APP, INFO, "deaggregate @ " << int(this)); } + virtual void onAggregate() { CSP_LOG(APP, INFO, "aggregate @ " << *this); } + virtual void onDeaggregate() { CSP_LOG(APP, INFO, "deaggregate @ " << *this); } bool isNearGround(); Modified: trunk/CSP/CSPSim/Source/FlightModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/FlightModel.cpp 2005-05-01 09:13:08 UTC (rev 1537) +++ trunk/CSP/CSPSim/Source/FlightModel.cpp 2005-05-01 15:43:07 UTC (rev 1538) @@ -96,10 +96,12 @@ double CL = m_CL - 0.04; //m_CL_md; - //m_CD = m_CD0 + \ - // m_CD_de * fabs(m_Elevator) + \ - // m_CD_db * fabs(m_Airbrake) + \ - // m_CD_i * CL * CL; + /* + m_CD = m_CD0 + \ + m_CD_de * fabs(m_Elevator) + \ + m_CD_db * fabs(m_Airbrake) + \ + m_CD_i * CL * CL; + */ m_CD = m_CD_m_a[m_AirSpeedM][m_Alpha_float] + m_CD_de * fabs(m_Elevator) + \ Modified: trunk/CSP/SimCore/Battlefield/test-client.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/test-client.cpp 2005-05-01 09:13:08 UTC (rev 1537) +++ trunk/CSP/SimCore/Battlefield/test-client.cpp 2005-05-01 15:43:07 UTC (rev 1538) @@ -69,7 +69,7 @@ }; TestUnitState::Ref Unit::mirror_msg; -SIMDATA_REGISTER_INTERFACE(Unit); +SIMDATA_REGISTER_INTERFACE(Unit) void makeDataArchive() { simdata::Ref<Unit> unit = new Unit; Modified: trunk/CSP/SimData/Include/SimData/Referenced.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Referenced.h 2005-05-01 09:13:08 UTC (rev 1537) +++ trunk/CSP/SimData/Include/SimData/Referenced.h 2005-05-01 15:43:07 UTC (rev 1538) @@ -49,7 +49,7 @@ template <class T> class Ref; class ReferencePointer; -void SIMDATA_EXPORT _log_reference_count_error(int count, int pointer); +void SIMDATA_EXPORT _log_reference_count_error(int count, void* pointer); /** Base class for reference counted objects. @@ -69,7 +69,7 @@ } virtual ~ReferencedBase() { - if (__count != 0) _log_reference_count_error(__count, reinterpret_cast<int>(this)); + if (__count != 0) _log_reference_count_error(__count, reinterpret_cast<void*>(this)); } private: Modified: trunk/CSP/SimData/Source/LogStream.cpp =================================================================== --- trunk/CSP/SimData/Source/LogStream.cpp 2005-05-01 09:13:08 UTC (rev 1537) +++ trunk/CSP/SimData/Source/LogStream.cpp 2005-05-01 15:43:07 UTC (rev 1538) @@ -127,8 +127,8 @@ } // not really the right place for this, but convenient. -void SIMDATA_EXPORT _log_reference_count_error(int count, int pointer) { - SIMDATA_LOG(LOG_ALL, LOG_ERROR, "simdata::ReferencedBase(" << std::hex << pointer << ") deleted with non-zero reference count (" << count << "): memory corruption possible."); +void SIMDATA_EXPORT _log_reference_count_error(int count, void *pointer) { + SIMDATA_LOG(LOG_ALL, LOG_ERROR, "simdata::ReferencedBase(" << pointer << ") deleted with non-zero reference count (" << count << "): memory corruption possible."); } // not really the right place for this, but convenient. |
From: <sv...@ww...> - 2005-05-01 09:13:16
|
Author: delta Date: 2005-05-01 02:13:08 -0700 (Sun, 01 May 2005) New Revision: 1537 Modified: trunk/CSP/CSPSim/Include/Steerpoint.h trunk/CSP/CSPSim/Include/Theater/IsoContour.h trunk/CSP/CSPSim/Source/Atmosphere.cpp trunk/CSP/CSPSim/Source/FlightControlSystem.cpp trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: * Fix a few minor warnings under vc++. * Add more headers to vcproj include folder. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1537 Modified: trunk/CSP/CSPSim/Include/Steerpoint.h =================================================================== --- trunk/CSP/CSPSim/Include/Steerpoint.h 2005-05-01 06:36:15 UTC (rev 1536) +++ trunk/CSP/CSPSim/Include/Steerpoint.h 2005-05-01 09:13:08 UTC (rev 1537) @@ -61,7 +61,7 @@ virtual simdata::DateZulu const &time() const { return m_Time; } virtual simdata::Vector3 const &position() const { return m_Position; } virtual simdata::LLA const &lla() const { return m_LLA; } - virtual float altitude() const { return m_LLA.altitude(); } + virtual float altitude() const { return static_cast<float>(m_LLA.altitude()); } virtual void setAltitude(float altitude) { m_LLA.set(m_LLA.latitude(), m_LLA.longitude(), altitude); updatePosition(); } virtual void setPosition(simdata::Vector3 const &position) { m_Position = position; updateLLA(); } Modified: trunk/CSP/CSPSim/Include/Theater/IsoContour.h =================================================================== --- trunk/CSP/CSPSim/Include/Theater/IsoContour.h 2005-05-01 06:36:15 UTC (rev 1536) +++ trunk/CSP/CSPSim/Include/Theater/IsoContour.h 2005-05-01 09:13:08 UTC (rev 1537) @@ -65,7 +65,7 @@ return simdata::Vector3(m_Radius * x, m_Radius * y, 0.0f); } virtual float getArea() const { - return simdata::PI * m_Radius * m_Radius; + return static_cast<float>(simdata::PI * m_Radius * m_Radius); } virtual ~Circle() {} }; Modified: trunk/CSP/CSPSim/Source/Atmosphere.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Atmosphere.cpp 2005-05-01 06:36:15 UTC (rev 1536) +++ trunk/CSP/CSPSim/Source/Atmosphere.cpp 2005-05-01 09:13:08 UTC (rev 1537) @@ -204,7 +204,7 @@ noise.randomize(); m_WindAltY = noise.generate(100, false, 8.0, 1.0, 0.0); for (i = 0; i < 100; ++i) { - const double alt_scale = 1.0 + i * i * 0.0025; + const float alt_scale = 1.0f + i * i * 0.0025f; m_WindAltX[i] *= alt_scale; m_WindAltY[i] *= alt_scale; } @@ -304,7 +304,7 @@ m_GustIndex += dt * 3.0; const int index = static_cast<int>(m_GustIndex); const float f = static_cast<float>(m_GustIndex - index); - const float gust = m_GustTime[index%1000] * (1.0 - f) + m_GustTime[(index+1)%1000] * f; + const float gust = m_GustTime[index%1000] * (1.0f - f) + m_GustTime[(index+1)%1000] * f; m_GustModulation = std::max(1.0, 1.0 + gust); //std::cout << getWind(simdata::Vector3::ZERO) << " " << m_GustModulation << std::endl; if (m_FastUpdate < 3.0) return false; Modified: trunk/CSP/CSPSim/Source/FlightControlSystem.cpp =================================================================== --- trunk/CSP/CSPSim/Source/FlightControlSystem.cpp 2005-05-01 06:36:15 UTC (rev 1536) +++ trunk/CSP/CSPSim/Source/FlightControlSystem.cpp 2005-05-01 09:13:08 UTC (rev 1537) @@ -348,7 +348,7 @@ Schedule1() {} private: virtual void evaluate(Timer const &timer) { - setOutput(m_Schedule[getInput(timer)], timer); + setOutput(m_Schedule[static_cast<float>(getInput(timer))], timer); } }; @@ -369,7 +369,7 @@ Schedule2() {} private: virtual void evaluate(Timer const &timer) { - setOutput(getInputA(timer) * m_Schedule[getInputB(timer)], timer); + setOutput(getInputA(timer) * m_Schedule[static_cast<float>(getInputB(timer))], timer); } }; Modified: trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj =================================================================== --- trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj 2005-05-01 06:36:15 UTC (rev 1536) +++ trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj 2005-05-01 09:13:08 UTC (rev 1537) @@ -658,6 +658,9 @@ RelativePath="..\..\Include\SmokeEffects.h"> </File> <File + RelativePath="..\..\Include\Steerpoint.h"> + </File> + <File RelativePath="..\..\Include\System.h"> </File> <File @@ -781,6 +784,64 @@ RelativePath="..\..\Include\Views\View.h"> </File> </Filter> + <Filter + Name="F16" + Filter=""> + <File + RelativePath="..\..\Source\F16\AlphaNumericDisplay.h"> + </File> + <File + RelativePath="..\..\Source\F16\DataEntry.h"> + </File> + <File + RelativePath="..\..\Source\F16\DataEntryPage.h"> + </File> + <File + RelativePath="..\..\Source\F16\F16Channels.h"> + </File> + <File + RelativePath="..\..\Source\F16\F16GearDynamics.h"> + </File> + <File + RelativePath="..\..\Source\F16\F16HUD.h"> + </File> + <File + RelativePath="..\..\Source\F16\F16InputSystem.h"> + </File> + <File + RelativePath="..\..\Source\F16\F16System.h"> + </File> + <File + RelativePath="..\..\Source\F16\GroundAvoidanceAdvisory.h"> + </File> + <File + RelativePath="..\..\Source\F16\NavigationSystem.h"> + </File> + <File + RelativePath="..\..\Source\F16\PageALOW.h"> + </File> + <File + RelativePath="..\..\Source\F16\PageCNI.h"> + </File> + <File + RelativePath="..\..\Source\F16\PageLIST.h"> + </File> + <File + RelativePath="..\..\Source\F16\PageSTPT.h"> + </File> + <File + RelativePath="..\..\Source\F16\PanelHUD.h"> + </File> + <File + RelativePath="..\..\Source\F16\Radio.h"> + </File> + <File + RelativePath="..\..\Source\F16\SpecialFonts.h"> + </File> + <File + RelativePath="..\..\Source\F16\UpFrontControls.h"> + </File> + </Filter> </Filter> <Filter Name="Resource Files" |
From: <sv...@ww...> - 2005-05-01 06:36:24
|
Author: mkrose Date: 2005-04-30 23:36:15 -0700 (Sat, 30 Apr 2005) New Revision: 1536 Modified: trunk/CSP/CSPSim/Data/Models/F16/DJ/F16DJ.osg Log: Fix texture paths for the F16 3D model under Linux (should still work under windows). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1536 Modified: trunk/CSP/CSPSim/Data/Models/F16/DJ/F16DJ.osg =================================================================== --- trunk/CSP/CSPSim/Data/Models/F16/DJ/F16DJ.osg 2005-05-01 06:35:12 UTC (rev 1535) +++ trunk/CSP/CSPSim/Data/Models/F16/DJ/F16DJ.osg 2005-05-01 06:36:15 UTC (rev 1536) @@ -60,7 +60,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "images\T3.tga" + file "images/T3.tga" wrap_s CLAMP_TO_EDGE wrap_t CLAMP_TO_EDGE wrap_r CLAMP_TO_EDGE @@ -405,7 +405,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "images\T2.tga" + file "images/T2.tga" wrap_s REPEAT wrap_t REPEAT wrap_r CLAMP_TO_EDGE @@ -6885,7 +6885,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "images\T4.tga" + file "images/T4.tga" wrap_s CLAMP_TO_EDGE wrap_t CLAMP_TO_EDGE wrap_r CLAMP_TO_EDGE @@ -28558,7 +28558,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "images\T1.tga" + file "images/T1.tga" wrap_s CLAMP_TO_EDGE wrap_t CLAMP_TO_EDGE wrap_r CLAMP_TO_EDGE @@ -43150,7 +43150,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "images\T5.tga" + file "images/T5.tga" wrap_s CLAMP_TO_EDGE wrap_t CLAMP_TO_EDGE wrap_r CLAMP_TO_EDGE @@ -59850,7 +59850,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "images\f16-lak.tga" + file "images/f16-lak.tga" wrap_s CLAMP_TO_EDGE wrap_t CLAMP_TO_EDGE wrap_r CLAMP_TO_EDGE @@ -93083,7 +93083,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "images\f16-lak.tga" + file "images/f16-lak.tga" wrap_s CLAMP_TO_EDGE wrap_t CLAMP_TO_EDGE wrap_r CLAMP_TO_EDGE @@ -159951,7 +159951,7 @@ GL_TEXTURE_2D ON Texture2D { DataVariance STATIC - file "images\T6.tga" + file "images/T6.tga" wrap_s CLAMP_TO_EDGE wrap_t CLAMP_TO_EDGE wrap_r CLAMP_TO_EDGE |
From: <sv...@ww...> - 2005-05-01 06:35:20
|
Author: mkrose Date: 2005-04-30 23:35:12 -0700 (Sat, 30 Apr 2005) New Revision: 1535 Added: trunk/CSP/SimData/Include/SimData/LogConstants.h trunk/CSP/SimData/Include/SimData/Referenced.h Modified: trunk/CSP/CSPChunkLod/include/osgChunkLod/ChunkLodDrawable trunk/CSP/CSPSim/Include/Animation.h trunk/CSP/CSPSim/Include/Bus.h trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Include/Exception.h trunk/CSP/CSPSim/Include/LogoScreen.h trunk/CSP/CSPSim/Include/NumericalMethod.h trunk/CSP/CSPSim/Source/AircraftObject.cpp trunk/CSP/CSPSim/Source/Colorspace.cpp trunk/CSP/CSPSim/Source/F16/DataEntry.h trunk/CSP/CSPSim/Source/F16/F16HUD.cpp trunk/CSP/CSPSim/Source/F16/F16System.cpp trunk/CSP/CSPSim/Source/F16/PanelHUD.cpp trunk/CSP/CSPSim/Source/F16/UpFrontControls.cpp trunk/CSP/CSPSim/Source/GameScreen.cpp trunk/CSP/CSPSim/Source/HUD/HUD.h trunk/CSP/CSPSim/Source/HUD/PitchLadder.cpp trunk/CSP/CSPSim/Source/HUD/Tape.cpp trunk/CSP/CSPSim/Source/LandingGear.cpp trunk/CSP/CSPSim/Source/Sky.cpp trunk/CSP/CSPSim/Source/Systems/AircraftInputSystem.cpp trunk/CSP/Demeter/DemeterDrawable.h trunk/CSP/Demeter/Terrain.cpp trunk/CSP/Demeter/TerrainTextureFactory.h trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h trunk/CSP/SimData/Include/SimData/Archive.h trunk/CSP/SimData/Include/SimData/AtomicCounter.h trunk/CSP/SimData/Include/SimData/Composite.h trunk/CSP/SimData/Include/SimData/DataArchive.h trunk/CSP/SimData/Include/SimData/Date.h trunk/CSP/SimData/Include/SimData/Enum.h trunk/CSP/SimData/Include/SimData/ExceptionBase.h trunk/CSP/SimData/Include/SimData/LUT.h trunk/CSP/SimData/Include/SimData/List.h trunk/CSP/SimData/Include/SimData/Log.h trunk/CSP/SimData/Include/SimData/Log.i trunk/CSP/SimData/Include/SimData/Object.h trunk/CSP/SimData/Include/SimData/ObjectInterface.h trunk/CSP/SimData/Include/SimData/PTS.h trunk/CSP/SimData/Include/SimData/Ref.h trunk/CSP/SimData/Include/SimData/ThreadUtil.h trunk/CSP/SimData/Include/SimData/Uniform.h trunk/CSP/SimData/SimData/Tests/test_Cache.cpp trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp trunk/CSP/SimData/SimData/Tests/test_File.cpp trunk/CSP/SimData/SimData/Tests/test_Object.cpp trunk/CSP/SimData/SimData/Tests/test_Ref.cpp trunk/CSP/SimData/Source/LUT.cpp trunk/CSP/SimData/Source/SConscript trunk/CSP/SimData/VisualStudio/SimData.vcproj trunk/CSP/SimData/VisualStudio2003/SimData.vcproj Log: Fix compiler errors under gcc-3.4. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1535 Diff omitted (49042 bytes). |
From: <sv...@ww...> - 2005-04-30 13:39:20
|
Author: delta Date: 2005-04-30 06:39:12 -0700 (Sat, 30 Apr 2005) New Revision: 1534 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Demo/Win/TestObjects.py trunk/CSP/CSPSim/Demo/Win/py2exe_cspsim_setup.py trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Include/GameScreen.h trunk/CSP/CSPSim/Include/ObjectModel.h trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h trunk/CSP/CSPSim/Include/Views/CameraAgent.h trunk/CSP/CSPSim/Include/Views/View.h trunk/CSP/CSPSim/Source/DynamicObject.cpp trunk/CSP/CSPSim/Source/GameScreen.cpp trunk/CSP/CSPSim/Source/ObjectModel.cpp trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp trunk/CSP/CSPSim/Source/Systems/AircraftSimpleFCS.cpp trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp trunk/CSP/CSPSim/Source/Views/View.cpp trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: * Fix a small bug when switching from f16 to m2k, the specific screeninfos were not updated correctly. * Mask the hud in external view. * Fix a small bug when controlling control surfaces with keyboard. * Minor other changes and clean up. * Minor update to vcproj. * Tweak py2exe files. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1534 Diff omitted (18276 bytes). |
From: <sv...@ww...> - 2005-04-30 03:39:55
|
Author: mkrose Date: 2005-04-29 20:39:45 -0700 (Fri, 29 Apr 2005) New Revision: 1533 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/Atmosphere.h trunk/CSP/CSPSim/Source/Atmosphere.cpp Log: Reduce hurricane force winds by increasing the timescale for average pressure variations and reducing the gust scaling factor. Clean and add documentation to the Atmosphere class. Also dump the noise functions to disk on start up. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1533 Diff omitted (16323 bytes). |
From: <sv...@ww...> - 2005-04-29 02:29:15
|
Author: mkrose Date: 2005-04-28 19:29:07 -0700 (Thu, 28 Apr 2005) New Revision: 1532 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16DJ.xml Log: Fix canopy and fuel door animations for the F16 (broke the channel names in a previous update). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1532 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-04-29 02:09:37 UTC (rev 1531) +++ trunk/CSP/CSPSim/CHANGES.current 2005-04-29 02:29:07 UTC (rev 1532) @@ -22,6 +22,9 @@ add gear debug points and fix the view point and gear positions for the m2k. + * Fix canopy and fuel door animations for the F16 (broke the channel names + in a previous update). + 2005-04-27: onsight * Remove dead code from PhysicsModel and BaseDynamics. Modified: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16DJ.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16DJ.xml 2005-04-29 02:09:37 UTC (rev 1531) +++ trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16DJ.xml 2005-04-29 02:29:07 UTC (rev 1532) @@ -28,12 +28,13 @@ <Object class="TimedSequence" name="fuel_door_sequence"> <Float name="initial_key">0.0</Float> <Float name="final_key">3.0</Float> - <String name="sequence_channel">Aircraft.FuelDoorSequence</String> + <String name="sequence_channel">Aircraft.FuelDoorSequence.ReferenceTime</String> + <String name="normalized_channel">Aircraft.FuelDoorSequence.NormalizedTime</String> </Object> <Object class="TimedSequence" name="canopy_sequence"> <Float name="initial_key">0.0</Float> <Float name="final_key">6.0</Float> - <String name="sequence_channel">Aircraft.CanopySequence</String> + <String name="sequence_channel">Aircraft.CanopySequence.ReferenceTime</String> </Object> </Object> |
From: <sv...@ww...> - 2005-04-29 02:09:44
|
Author: mkrose Date: 2005-04-28 19:09:37 -0700 (Thu, 28 Apr 2005) New Revision: 1531 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/model.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/gear.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml Log: Remove the view point contact markers and make them debug points. Also add gear debug points and fix the view point and gear positions for the m2k. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1531 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-04-29 01:45:25 UTC (rev 1530) +++ trunk/CSP/CSPSim/CHANGES.current 2005-04-29 02:09:37 UTC (rev 1531) @@ -18,6 +18,10 @@ establishing a connection to the index server and starting the main sim loop was creating a large artificial clock skew. Needs testing though. + * Remove the view point contact markers and make them debug points. Also + add gear debug points and fix the view point and gear positions for the + m2k. + 2005-04-27: onsight * Remove dead code from PhysicsModel and BaseDynamics. Modified: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/model.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/model.xml 2005-04-29 01:45:25 UTC (rev 1530) +++ trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/model.xml 2005-04-29 02:09:37 UTC (rev 1531) @@ -25,7 +25,6 @@ <Vector>0.0 -5.2 3.504</Vector> <Vector>0.0 3.8 -0.60</Vector> <Vector>0.0 -0.5 -0.65</Vector> - <Vector>0.0 4.45 1.19</Vector> </List> <List name="debug_points"> <!-- view point --> Modified: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/gear.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/gear.xml 2005-04-29 01:45:25 UTC (rev 1530) +++ trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/gear.xml 2005-04-29 02:09:37 UTC (rev 1531) @@ -9,7 +9,8 @@ <!-- all of these values are complete guesses for testing only! --> <Object class="LandingGear"> <!-- nosewheel --> <String name="gear_name">FrontGear</String> - <Vector name="max_position">0.0 4.123 -1.600</Vector> + <!--Vector name="max_position">0.0 4.123 -1.600</Vector--> + <Vector name="max_position">0.0 4.420 -1.600</Vector> <Vector name="motion">0 0 1.0</Vector> <Real name="damage_limit">80000.0:10000.0</Real> <Float name="compression_limit">0.5</Float> @@ -38,7 +39,8 @@ </Object> <Object class="LandingGear"> <!-- left main --> <String name="gear_name">LeftGear</String> - <Vector name="max_position">-1.815 -0.796 -1.721</Vector> + <!--Vector name="max_position">-1.815 -0.796 -1.721</Vector--> + <Vector name="max_position">-1.780 -0.500 -1.680</Vector> <Vector name="motion">-0.122 0 0.993</Vector> <Real name="damage_limit">80000.0</Real> <Float name="compression_limit">0.5</Float> @@ -66,7 +68,8 @@ </Object> <Object class="LandingGear"> <!-- right main --> <String name="gear_name">RightGear</String> - <Vector name="max_position">1.815 -0.796 -1.721</Vector> + <!--Vector name="max_position">1.815 -0.796 -1.721</Vector--> + <Vector name="max_position">1.780 -0.500 -1.680</Vector> <Vector name="motion">0.122 0 0.993</Vector> <Real name="damage_limit">80000.0:10000.0</Real> <Float name="compression_limit">0.5</Float> Modified: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml =================================================================== --- trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml 2005-04-29 01:45:25 UTC (rev 1530) +++ trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml 2005-04-29 02:09:37 UTC (rev 1531) @@ -1,11 +1,10 @@ <?xml version="1.0" standalone="no"?> <Object class="ObjectModel"> - <External name="model_path">Mirage2000/model.osg</External> + <External name="model_path">Mirage2000/model.osg</External> <Vector name="axis_0">1 0 0</Vector> <Vector name="axis_1">0 1 0</Vector> - <!--Vector name="view_point">0.0 4.1 1.17</Vector--> - <Vector name="view_point">0.0 4.1 1.1</Vector> + <Vector name="view_point">0.0 4.3 1.12</Vector> <Bool name="smooth">false</Bool> <Enum name="effect">SpecularHighlights</Enum> <List name="contacts"> @@ -18,8 +17,14 @@ <Vector>0.0 -5.1 3.604</Vector> <Vector>0.0 6.46 -0.335</Vector> <Vector>0.0 -0.49 -0.327</Vector> + </List> + <List name="debug_points"> <!-- view point --> - <Vector>0.0 4.1 1.17</Vector> + <Vector>0.0 4.3 1.12</Vector> + <!-- gear max positions --> + <Vector>0.0 4.420 -1.600</Vector> + <Vector>-1.780 -0.500 -1.680</Vector> + <Vector>1.780 -0.500 -1.680</Vector> </List> <List name="animations"> <Object class="DrivenRotation"> |
From: <sv...@ww...> - 2005-04-29 01:45:39
|
Author: mkrose Date: 2005-04-28 18:45:25 -0700 (Thu, 28 Apr 2005) New Revision: 1530 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/NetworkInterface.h Log: Disable timing statistics updates after long delays between calls to process incoming packets. This should significantly improve the time skew detection that is critical for proper multiplayer synchronization. In particular, the long delay (due mainly to terrain loading) between establishing a connection to the index server and starting the main sim loop was creating a large artificial clock skew. Needs testing though. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1530 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-04-29 01:38:51 UTC (rev 1529) +++ trunk/CSP/CSPSim/CHANGES.current 2005-04-29 01:45:25 UTC (rev 1530) @@ -11,6 +11,13 @@ * Remove debugging cruft from stdout. + * Disable timing statistics updates after long delays between calls to + process incoming packets. This should significantly improve the time + skew detection that is critical for proper multiplayer synchronization. + In particular, the long delay (due mainly to terrain loading) between + establishing a connection to the index server and starting the main sim + loop was creating a large artificial clock skew. Needs testing though. + 2005-04-27: onsight * Remove dead code from PhysicsModel and BaseDynamics. Modified: trunk/CSP/SimNet/NetworkInterface.cpp =================================================================== --- trunk/CSP/SimNet/NetworkInterface.cpp 2005-04-29 01:38:51 UTC (rev 1529) +++ trunk/CSP/SimNet/NetworkInterface.cpp 2005-04-29 01:45:25 UTC (rev 1530) @@ -507,7 +507,9 @@ } int latency = static_cast<int>(t_latency); assert(latency == t_latency); - peer->updateTiming(latency, last_ping_latency); + if (m_DiscardTiming == 0) { + peer->updateTiming(latency, last_ping_latency); + } } else { SIMNET_LOG(PEER, ERROR, "Ping packet does not contain timing payload"); } @@ -585,6 +587,23 @@ double start_time = simdata::get_realtime(); + // if we haven't processed incoming packets for a while then we + // shouldn't trust any timing data they may contain. + if (start_time - m_LastUpdate > 0.2) { + // discard timing data until all stale packets are processed or + // this many successive calls to processIncoming have been made + // without long delays. hopefully by then all the original + // stale packets from this iteration will have either been + // processed or dropped. + m_DiscardTiming = 100; + } else { + // if there was a long pause recently keep dropping timing + // data. once the count reaches zero we will start using + // the timing data again. + if (m_DiscardTiming > 0) --m_DiscardTiming; + } + assert(m_DiscardTiming >= 0); // paranoia + // spend up to 60% of our time slice receiving messages from the // socket. if the socket runs dry early (which it should in most // cases), we will have extra time to process those messages. @@ -619,7 +638,10 @@ queue_idx = (queue_idx - 1) & 3; queue = m_RxQueues[queue_idx]; } while (++n <= 4 && queue->isEmpty()); - if (n > 4) break; // all empty + if (n > 4) { // all empty + m_DiscardTiming = 0; // all stale packets gone! + break; + } // if only one queue isn't empty then forget about counts count = (n==4) ? 100000 : process_count[queue_idx]; } @@ -681,6 +703,7 @@ m_ActivePeers(new ActivePeerList), m_AllowUnknownPeers(false), m_Initialized(false), + m_DiscardTiming(0), m_IncomingBandwidth(0), m_OutgoingBandwidth(0), m_PacketHandlers(new PacketHandlerSet) Modified: trunk/CSP/SimNet/NetworkInterface.h =================================================================== --- trunk/CSP/SimNet/NetworkInterface.h 2005-04-29 01:38:51 UTC (rev 1529) +++ trunk/CSP/SimNet/NetworkInterface.h 2005-04-29 01:45:25 UTC (rev 1530) @@ -135,6 +135,11 @@ // Indicates whether initialize() has been called. bool m_Initialized; + // Counter indicating whether timing data should be discarded because + // processIncoming has not been called recently. Timing data should + // only be considered valid if m_DiscardTiming is zero. + int m_DiscardTiming; + // Nominal bandwidths in bytes/sec. int m_IncomingBandwidth; int m_OutgoingBandwidth; |
From: <sv...@ww...> - 2005-04-29 01:38:57
|
Author: mkrose Date: 2005-04-28 18:38:51 -0700 (Thu, 28 Apr 2005) New Revision: 1529 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/F16/DataEntry.h trunk/CSP/CSPSim/Source/F16/F16HUD.cpp trunk/CSP/CSPSim/Source/F16/PageCNI.cpp trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp Log: Remove debugging cruft from stdout. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1529 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-04-29 01:37:10 UTC (rev 1528) +++ trunk/CSP/CSPSim/CHANGES.current 2005-04-29 01:38:51 UTC (rev 1529) @@ -9,6 +9,8 @@ * Move the m2k center of mass forward to put more weight on the nose gear, which was slipping/skidding far too easily. + * Remove debugging cruft from stdout. + 2005-04-27: onsight * Remove dead code from PhysicsModel and BaseDynamics. Modified: trunk/CSP/CSPSim/Source/F16/DataEntry.h =================================================================== --- trunk/CSP/CSPSim/Source/F16/DataEntry.h 2005-04-29 01:37:10 UTC (rev 1528) +++ trunk/CSP/CSPSim/Source/F16/DataEntry.h 2005-04-29 01:38:51 UTC (rev 1529) @@ -771,7 +771,7 @@ std::string::size_type colon = token.find(':'); if (colon != std::string::npos && colon < token.size()) { m_LabelMap[token.substr(0, colon)] = token.substr(colon + 1); - std::cout << token.substr(0, colon) << " -> " << token.substr(colon + 1) << "\n"; + //std::cout << token.substr(0, colon) << " -> " << token.substr(colon + 1) << "\n"; } } } Modified: trunk/CSP/CSPSim/Source/F16/F16HUD.cpp =================================================================== --- trunk/CSP/CSPSim/Source/F16/F16HUD.cpp 2005-04-29 01:37:10 UTC (rev 1528) +++ trunk/CSP/CSPSim/Source/F16/F16HUD.cpp 2005-04-29 01:38:51 UTC (rev 1529) @@ -304,7 +304,7 @@ DEDReadout(simdata::Ref<const AlphaNumericDisplay> display, osg::ref_ptr<HUDFont> font): m_Display(display) { assert(font.valid()); unsigned lines = m_Display->height(); - std::cout << "DEDReadout: " << lines << " lines\n"; + CSP_LOG(APP, DEBUG, "DEDReadout: " << lines << " lines"); m_Lines = new osgText::Text*[lines]; for (unsigned i = 0; i < lines; ++i) { m_Lines[i] = addText(); Modified: trunk/CSP/CSPSim/Source/F16/PageCNI.cpp =================================================================== --- trunk/CSP/CSPSim/Source/F16/PageCNI.cpp 2005-04-29 01:37:10 UTC (rev 1528) +++ trunk/CSP/CSPSim/Source/F16/PageCNI.cpp 2005-04-29 01:38:51 UTC (rev 1529) @@ -85,7 +85,6 @@ ded.write(8, 4, "7500"); ded.write(16, 4, "MAN"); ded.write(21, 4, "T123X"); - std::cout << "UPDATE\n"; } double PageCNI::update() { Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2005-04-29 01:37:10 UTC (rev 1528) +++ trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2005-04-29 01:38:51 UTC (rev 1529) @@ -295,7 +295,10 @@ // large jumps right after the connection is established), so we filter the offset // to spread the jumps out over a few seconds. m_ServerTimeOffset = m_ServerTimeOffset * (1.0 - filter) + filter * offset; - { static int XXX = 0; if ((++XXX % 100) == 0) std::cout << "server time offset = " << m_ServerTimeOffset << "\n"; } // XXX + if (m_NetworkClient.valid()) { + static int XXX = 0; + if ((++XXX % 1000) == 0) std::cout << "LocalBattlefield.cpp: server time offset = " << m_ServerTimeOffset << "s\n"; + } m_CurrentTime = simdata::getCalibratedRealTime() + m_ServerTimeOffset; m_CurrentTimeStamp = simcore::getTimeStamp(m_CurrentTime); if (m_NetworkClient.valid()) { |