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...> - 2004-07-07 08:16:58
|
Author: mkrose Date: 2004-07-07 01:16:51 -0700 (Wed, 07 Jul 2004) New Revision: 1150 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/LandingGear.h trunk/CSP/CSPSim/Source/LandingGear.cpp Log: Move some debug/status info for landing gear from stdout to the onscreen display. Also fix brake temperature updates to continue while airborne. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1150 Diff omitted (17164 bytes). |
From: <sv...@ww...> - 2004-07-07 08:14:27
|
Author: mkrose Date: 2004-07-07 01:14:20 -0700 (Wed, 07 Jul 2004) New Revision: 1149 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/ObjectModel.cpp Log: Move some debug info from stdout to the log. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1149 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-07-07 08:13:01 UTC (rev 1148) +++ trunk/CSP/CSPSim/CHANGES.current 2004-07-07 08:14:20 UTC (rev 1149) @@ -14,6 +14,8 @@ * Fix warnings in DispatchCenter.cpp. + * Move some debug info from stdout to the log. + 2004-07-01: delta * CameraKinematics now uses spherical coordinates terminology (theta,phi,radius). Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-07-07 08:13:01 UTC (rev 1148) +++ trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-07-07 08:14:20 UTC (rev 1149) @@ -99,16 +99,16 @@ virtual void apply(osg::Transform &node) { if (!m_Animations) return; std::string name = node.getName(); - std::cout << "MODEL TRANSFORM: " << name << "\n"; + CSP_LOG(APP, DEBUG, "MODEL TRANSFORM: " << name); if (name.substr(0,6) == "ANIM: ") { simdata::Key id = name.substr(6); simdata::Link<Animation>::vector::const_iterator i = m_Animations->begin(); - std::cout << "SEARCHING FOR " << name.substr(6) << " (" << id.asString() << ")\n"; + CSP_LOG(APP, DEBUG, "SEARCHING FOR " << name.substr(6) << " (" << id.asString() << ")"); for (; i != m_Animations->end(); ++i) { - std::cout << "COMPARING TO " << (*i)->getModelID().asString() << "\n"; + CSP_LOG(APP, DEBUG, "COMPARING TO " << (*i)->getModelID().asString()); if ((*i)->getModelID() == id) { node.setUserData(new AnimationBinding(i->get())); - std::cout << "FOUND\n"; + CSP_LOG(APP, DEBUG, "FOUND"); break; } } @@ -290,11 +290,11 @@ // add animation hooks to user data field of animation // transform nodes ModelProcessor processor; - std::cout << "ANIMATIONS AVAILABLE: " << m_Animations.size() << "\n"; + CSP_LOG(APP, INFO, "ANIMATIONS AVAILABLE: " << m_Animations.size()); processor.setAnimations(&m_Animations); - std::cout << "PROCESSING MODEL\n"; + CSP_LOG(APP, INFO, "PROCESSING MODEL"); m_Model->accept(processor); - std::cout << "PROCESSING MODEL DONE\n"; + CSP_LOG(APP, INFO, "PROCESSING MODEL DONE"); assert(m_Axis0.length() > 0.0); m_Axis0.normalize(); @@ -579,7 +579,7 @@ if (binding) { osg::Node *new_node = dynamic_cast<osg::Node*>(node->clone(*this)); m_AnimationCallbacks.push_back(binding->bind(new_node)); - std::cout << "ADDED CALLBACK\n"; + CSP_LOG(APP, INFO, "ADDED CALLBACK"); return new_node; } } @@ -619,18 +619,18 @@ // XXX add effect or not model_node = addEffect(model_node); - std::cout << "MODEL COPIED\n"; + CSP_LOG(APP, DEBUG, "MODEL COPIED"); - std::cout << "MODEL animation count = " << model_copy.getAnimationCallbacks().size() << "\n"; + CSP_LOG(APP, INFO, "MODEL animation count = " << model_copy.getAnimationCallbacks().size()); m_AnimationCallbacks.resize(model_copy.getAnimationCallbacks().size()); // store all the animation update callbacks - std::copy(model_copy.getAnimationCallbacks().begin(), - model_copy.getAnimationCallbacks().end(), - m_AnimationCallbacks.begin()); + std::copy(model_copy.getAnimationCallbacks().begin(), + model_copy.getAnimationCallbacks().end(), + m_AnimationCallbacks.begin()); - std::cout << "MODEL animation count = " << m_AnimationCallbacks.size() << "\n"; + CSP_LOG(APP, INFO, "MODEL animation count = " << m_AnimationCallbacks.size()); m_Label = new osgText::Text(); m_Label->setFont("screeninfo.ttf"); |
From: <sv...@ww...> - 2004-07-07 08:13:09
|
Author: mkrose Date: 2004-07-07 01:13:01 -0700 (Wed, 07 Jul 2004) New Revision: 1148 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/DispatchCenter.cpp Log: Fix warnings in DispatchCenter.cpp. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1148 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-07-07 08:12:08 UTC (rev 1147) +++ trunk/CSP/CSPSim/CHANGES.current 2004-07-07 08:13:01 UTC (rev 1148) @@ -12,6 +12,8 @@ * Reformatted some of the network code; fixed several gcc warnings. + * Fix warnings in DispatchCenter.cpp. + 2004-07-01: delta * CameraKinematics now uses spherical coordinates terminology (theta,phi,radius). Modified: trunk/CSP/CSPSim/Source/DispatchCenter.cpp =================================================================== --- trunk/CSP/CSPSim/Source/DispatchCenter.cpp 2004-07-07 08:12:08 UTC (rev 1147) +++ trunk/CSP/CSPSim/Source/DispatchCenter.cpp 2004-07-07 08:13:01 UTC (rev 1148) @@ -60,13 +60,13 @@ // need to extend the tagged record interface to allow ids to be assigned to the // record class, and retrieved from any record instance (ie. need a class static // field --- uint16). - simdata::uint16 id = 0; // XXX + //simdata::uint16 id = 0; // XXX // TODO serialize without constructing a new writer/tagwriter each time, and // without reallocating the write buffer. simdata::StringWriter writer; simdata::TagWriter tag_writer(writer); record->serialize(tag_writer); - std::string const &buffer = writer.str(); + //std::string const &buffer = writer.str(); // TODO message initialization from the buffer data needs to be implemented // (requires changes to NetworkMessage) // message->initialize(id, buffer.data(), buffer.size()); |
From: <sv...@ww...> - 2004-07-07 08:12:15
|
Author: mkrose Date: 2004-07-07 01:12:08 -0700 (Wed, 07 Jul 2004) New Revision: 1147 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/SimNet/Networking.h trunk/CSP/CSPSim/Source/EchoServerNode.cpp trunk/CSP/CSPSim/Source/RedirectServerNode.cpp trunk/CSP/CSPSim/Source/SimNet/DispatchMessageHandler.cpp trunk/CSP/CSPSim/Source/SimNet/MessageSocketDuplex.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkMessenger.cpp Log: Reformatted some of the network code; fixed several gcc warnings. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1147 Diff omitted (68564 bytes). |
From: <sv...@ww...> - 2004-07-07 04:10:44
|
Author: mkrose Date: 2004-07-06 21:10:38 -0700 (Tue, 06 Jul 2004) New Revision: 1146 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/Makefile.in Log: Fix cc++ includes in Makefile.in; add debug symbols to cCSP_wrap.o. Add DispatchCenter.cpp to the build. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1146 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-07-07 04:08:02 UTC (rev 1145) +++ trunk/CSP/CSPSim/CHANGES.current 2004-07-07 04:10:38 UTC (rev 1146) @@ -6,6 +6,10 @@ * Updated doxygen control file to exclude */old/*. + * Fix cc++ includes in Makefile.in; add debug symbols to cCSP_wrap.o. + + * Add DispatchCenter.cpp to the build. + 2004-07-01: delta * CameraKinematics now uses spherical coordinates terminology (theta,phi,radius). Modified: trunk/CSP/CSPSim/Source/Makefile.in =================================================================== --- trunk/CSP/CSPSim/Source/Makefile.in 2004-07-07 04:08:02 UTC (rev 1145) +++ trunk/CSP/CSPSim/Source/Makefile.in 2004-07-07 04:10:38 UTC (rev 1146) @@ -18,11 +18,11 @@ LIBS = $(DEMETER_LIBRARY) $(CHUNKLOD_LIBRARY) -lccgnu2 -INCLUDE = -I$(TOPDIR)/Include $(SIMDATA_INCLUDE) $(DEMETER_INCLUDE) $(CHUNKLOD_INCLUDE) -I@PYTHON_INCLUDE@ -I/usr/local/include/cc++2 +INCLUDE = -I$(TOPDIR)/Include $(SIMDATA_INCLUDE) $(DEMETER_INCLUDE) $(CHUNKLOD_INCLUDE) -I@PYTHON_INCLUDE@ BASEFL = $(GDEBUGF) $(GCFLAGS) $(INCLUDE) @SDL_FLAGS@ @SIGC_FLAGS@ @CCGNU2_FLAGS@ CFLAGS = $(filter-out -I/usr/local/include, $(BASEFL)) -SWCXXF = $(GCFLAGS) $(INCLUDE) @SIGC_FLAGS@ +SWCXXF = $(GDEBUGF) $(GCFLAGS) $(INCLUDE) @SIGC_FLAGS@ LDOPTS = -Wl,-z,lazyload $(GLDOPTS) @LIBS@ SWOPTS = $(GSWOPTS) $(INCLUDE) EXTERN_LIBS = @LIBS@ @@ -51,6 +51,7 @@ ConsoleCommands.cpp \ CSPSim.cpp \ DemeterTerrain.cpp \ + DispatchCenter.cpp \ DynamicObject.cpp \ DynamicalSystem.cpp \ EchoServerNode.cpp \ |
From: <sv...@ww...> - 2004-07-07 04:08:10
|
Author: mkrose Date: 2004-07-06 21:08:02 -0700 (Tue, 06 Jul 2004) New Revision: 1145 Modified: trunk/CSP/tools/subcmd.py trunk/CSP/tools/sublib.py Log: Check for conflicts, with colored output and interactive submit. Fix bug parsing svn st output. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1145 Modified: trunk/CSP/tools/subcmd.py =================================================================== --- trunk/CSP/tools/subcmd.py 2004-07-07 04:03:55 UTC (rev 1144) +++ trunk/CSP/tools/subcmd.py 2004-07-07 04:08:02 UTC (rev 1145) @@ -118,6 +118,13 @@ class Changeset: + MODE_NAME = { + sublib.File.ADD: 'add', + sublib.File.DEL: 'delete', + sublib.File.MOD: 'modified', + sublib.File.CONFLICT: 'XXX conflict', + } + def __init__(self, name, files, pending=0): self._name = name self._description = [] @@ -180,7 +187,8 @@ for file in self._files: mode = file.mode path = file.path - addtext(' //%s # %s' % (path, mode.lower())) + comment = Changeset.MODE_NAME.get(mode, mode.lower()) + addtext(' //%s # %s' % (path, comment)) fileref[path] = file text = '\n'.join(text) result = edit(text, cursor) @@ -492,7 +500,13 @@ name = set._name else: name = '?' - print '%s (%s)' % (file, name) + if file.mode is sublib.File.CONFLICT: + # TODO make these escapes optional + sys.stdout.write('\033[1;31m') + print '>%s (%s)' % (file, name) + sys.stdout.write('\033[0m') + else: + print ' %s (%s)' % (file, name) return Result(0) def change(self, name, allow_default=0): @@ -561,6 +575,13 @@ return Error('Unknown changeset "%s"' % name) result = self.change(name) if not result.ok: return result + conflicts = filter(lambda x: x.mode is sublib.File.CONFLICT, sublib.svn_st()) + if conflicts: + print 'The following files have conflicts:' + for file in conflicts: print ' %s' % file.path + print 'Submit anyway [yN]? ', + input = sys.stdin.readline() + if input.rstrip() != 'y': return Error('Changeset not submitted.') result = cs.submit() if result.ok: del self._sets[name] Modified: trunk/CSP/tools/sublib.py =================================================================== --- trunk/CSP/tools/sublib.py 2004-07-07 04:03:55 UTC (rev 1144) +++ trunk/CSP/tools/sublib.py 2004-07-07 04:08:02 UTC (rev 1145) @@ -37,6 +37,7 @@ ADD = 'ADD' DEL = 'DEL' MOD = 'MOD' + CONFLICT = 'CON' def __init__(self, path, root, mode): self.mode = mode @@ -71,7 +72,7 @@ st = os.popen('svn st -q %s' % path).readlines() files = [] for line in st: - path = line[1:].strip() + path = line[7:].strip() abspath = os.path.abspath(path) assert(abspath.startswith(root)) relpath = abspath[len(root):] @@ -82,6 +83,7 @@ if line.startswith('M'): mode = File.MOD elif line.startswith('A'): mode = File.ADD elif line.startswith('D'): mode = File.DEL + elif line.startswith('C'): mode = File.CONFLICT else: continue files.append(File(relpath, root, mode)) return files |
From: <sv...@ww...> - 2004-07-07 04:04:01
|
Author: mkrose Date: 2004-07-06 21:03:55 -0700 (Tue, 06 Jul 2004) New Revision: 1144 Added: trunk/CSP/CSPSim/Include/Systems/old/ trunk/CSP/CSPSim/Include/Systems/old/AircraftDynamics.h trunk/CSP/CSPSim/Include/Systems/old/GearDynamics.h trunk/CSP/CSPSim/Include/Systems/old/LandingGear.h trunk/CSP/CSPSim/Include/old/ trunk/CSP/CSPSim/Include/old/AeroDynamics.h trunk/CSP/CSPSim/Include/old/BaseController.h trunk/CSP/CSPSim/Include/old/CON_consolecommands.h trunk/CSP/CSPSim/Include/old/DirVectorDrawable.h trunk/CSP/CSPSim/Include/old/FLCS.h trunk/CSP/CSPSim/Include/old/PrimaryAeroDynamics.h trunk/CSP/CSPSim/Include/old/StaticObject.h trunk/CSP/CSPSim/Source/old/ trunk/CSP/CSPSim/Source/old/AircraftModel.cpp trunk/CSP/CSPSim/Source/old/F16Model.cpp trunk/CSP/CSPSim/Source/old/PrimaryAeroDynamics.cpp trunk/CSP/CSPSim/Source/old/StaticObject.cpp Removed: trunk/CSP/CSPSim/Include/AeroDynamics.h trunk/CSP/CSPSim/Include/BaseController.h trunk/CSP/CSPSim/Include/CON_consolecommands.h trunk/CSP/CSPSim/Include/DirVectorDrawable.h trunk/CSP/CSPSim/Include/FLCS.h trunk/CSP/CSPSim/Include/PrimaryAeroDynamics.h trunk/CSP/CSPSim/Include/StaticObject.h trunk/CSP/CSPSim/Include/Systems/AircraftDynamics.h trunk/CSP/CSPSim/Include/Systems/GearDynamics.h trunk/CSP/CSPSim/Include/Systems/LandingGear.h trunk/CSP/CSPSim/Source/AircraftModel.cpp trunk/CSP/CSPSim/Source/F16Model.cpp trunk/CSP/CSPSim/Source/PrimaryAeroDynamics.cpp trunk/CSP/CSPSim/Source/StaticObject.cpp Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Doc/Doxyfile Log: Moved unreferenced headers and source files to old/ subdirectories. Updated doxygen control file to exclude */old/*. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1144 Diff omitted (79363 bytes). |
From: <sv...@ww...> - 2004-07-07 03:51:09
|
Author: mkrose Date: 2004-07-06 20:50:53 -0700 (Tue, 06 Jul 2004) New Revision: 1143 Modified: trunk/CSP/CSPSim/Include/Systems/AircraftDynamics.h Log: Fix VehiclePhysics inheritance. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1143 Modified: trunk/CSP/CSPSim/Include/Systems/AircraftDynamics.h =================================================================== --- trunk/CSP/CSPSim/Include/Systems/AircraftDynamics.h 2004-07-05 15:30:57 UTC (rev 1142) +++ trunk/CSP/CSPSim/Include/Systems/AircraftDynamics.h 2004-07-07 03:50:53 UTC (rev 1143) @@ -35,7 +35,7 @@ #include <KineticsChannels.h> -class VehiclePhysics: public System, public PhysicsModel { +class VehiclePhysics: public PhysicsModel { protected: void importChannels(Bus *) { b_Position = bus->getChannel(Kinetics::Position); |
From: <sv...@ww...> - 2004-07-05 15:31:03
|
Author: delta Date: 2004-07-05 08:30:57 -0700 (Mon, 05 Jul 2004) New Revision: 1142 Modified: trunk/CSP/SimData/CHANGES.current Log: Prevent conflict between winsock & winsock2. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1142 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-05 15:27:13 UTC (rev 1141) +++ trunk/CSP/SimData/CHANGES.current 2004-07-05 15:30:57 UTC (rev 1142) @@ -1,6 +1,9 @@ Version 0.4.0 (in progress) =========================== - +2004-07-02: delta + * Added a #define _WINSOCKAPI_ in AtomicCounter.h (protected + behind WIN32) to avoid conflict in the network code. + 2004-07-01: onsight * Added a simple but fast memory pool class for allocating fixed size buffers. |
From: <sv...@ww...> - 2004-07-05 15:27:19
|
Author: delta Date: 2004-07-05 08:27:13 -0700 (Mon, 05 Jul 2004) New Revision: 1141 Modified: trunk/CSP/SimData/Include/SimData/AtomicCounter.h Log: Prevent conflict between winsock & winsock2 on windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1141 Modified: trunk/CSP/SimData/Include/SimData/AtomicCounter.h =================================================================== --- trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-07-03 09:57:20 UTC (rev 1140) +++ trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-07-05 15:27:13 UTC (rev 1141) @@ -38,6 +38,7 @@ #if defined(WIN32) # define WIN_ATOMIC +# define _WINSOCKAPI_ # include <Windows.h> #else # define LIN_ATOMIC |
From: <sv...@ww...> - 2004-07-03 09:57:27
|
Author: delta Date: 2004-07-03 02:57:20 -0700 (Sat, 03 Jul 2004) New Revision: 1140 Modified: trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: Updated. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1140 Modified: trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj =================================================================== --- trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj 2004-07-02 21:03:36 UTC (rev 1139) +++ trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj 2004-07-03 09:57:20 UTC (rev 1140) @@ -756,9 +756,6 @@ RelativePath="..\..\Include\Message.h"> </File> <File - RelativePath="..\..\Include\Networking.h"> - </File> - <File RelativePath="..\..\Include\NumericalMethod.h"> </File> <File @@ -917,6 +914,13 @@ RelativePath="..\..\Include\Views\View.h"> </File> </Filter> + <Filter + Name="SimNet" + Filter=""> + <File + RelativePath="..\..\Include\SimNet\Networking.h"> + </File> + </Filter> </Filter> <Filter Name="Resource Files" |
From: <sv...@ww...> - 2004-07-02 21:03:42
|
Author: delta Date: 2004-07-02 14:03:36 -0700 (Fri, 02 Jul 2004) New Revision: 1139 Modified: trunk/CSP/CSPSim/CHANGES.current Log: Read me. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1139 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-07-02 18:18:44 UTC (rev 1138) +++ trunk/CSP/CSPSim/CHANGES.current 2004-07-02 21:03:36 UTC (rev 1139) @@ -1,6 +1,18 @@ Version 0.4.0 (in progress) =========================== +2004-07-01: delta + * CameraKinematics now uses spherical coordinates terminology + (theta,phi,radius). + + * Fixed a bug in view 3 when aircraft in the air: the camera could'nt + move below the plane. + + * Changed exception(char*) by std::runtime_error(const string&) trying + to fix a gcc syntax error. + * Added a lighting bool attribute to disable lighting in ObjectModel. + (lightint is on by default). + 2004-06-29: delta * Corrected a shaking bug in the flyby view when PAUSE was enabled. (also could solve a possible bug in internal view). |
From: <sv...@ww...> - 2004-07-02 18:18:50
|
Author: delta Date: 2004-07-02 11:18:44 -0700 (Fri, 02 Jul 2004) New Revision: 1138 Modified: trunk/CSP/CSPSim/Source/DynamicObject.cpp Log: Moved #include DynamicObject.h on top. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1138 Modified: trunk/CSP/CSPSim/Source/DynamicObject.cpp =================================================================== --- trunk/CSP/CSPSim/Source/DynamicObject.cpp 2004-07-02 18:16:29 UTC (rev 1137) +++ trunk/CSP/CSPSim/Source/DynamicObject.cpp 2004-07-02 18:18:44 UTC (rev 1138) @@ -21,10 +21,12 @@ * @file DynamicObject.cpp * **/ +#include <DynamicObject.h> +#include <SimData/Quat.h> + #include <SimNet/Networking.h> -#include <DynamicObject.h> #include <Controller.h> #include <PhysicsModel.h> #include <Log.h> @@ -34,11 +36,7 @@ #include <CSPSim.h> #include <KineticsChannels.h> -#include <SimData/Quat.h> - - - SIMDATA_REGISTER_INTERFACE(DynamicObject) |
From: <sv...@ww...> - 2004-07-02 18:16:34
|
Author: delta Date: 2004-07-02 11:16:29 -0700 (Fri, 02 Jul 2004) New Revision: 1137 Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp Log: Added m_Lighting bool attribute. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1137 Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-07-02 18:15:50 UTC (rev 1136) +++ trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-07-02 18:16:29 UTC (rev 1137) @@ -179,6 +179,7 @@ m_ElevationCorrection = true; m_PolygonOffset = 0.0; m_CullFace = -1; + m_Lighting = true; } ObjectModel::~ObjectModel() { @@ -259,6 +260,11 @@ ss->setAttributeAndModes(po, osg::StateAttribute::ON); } + if (!m_Lighting) { + osg::StateSet *ss = m_Model->getOrCreateStateSet(); + ss->setMode(GL_LIGHTING,osg::StateAttribute::OFF); + } + if (m_CullFace != 0) { // XXX should reuse a single static CullFace instance. osg::StateSet *ss = m_Model->getOrCreateStateSet(); |
From: <sv...@ww...> - 2004-07-02 18:15:56
|
Author: delta Date: 2004-07-02 11:15:50 -0700 (Fri, 02 Jul 2004) New Revision: 1136 Modified: trunk/CSP/CSPSim/Source/InputEvent.cpp Log: Changed exception(char*) to std::runtime_error(const string&) to avoid a syntax error on gcc. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1136 Modified: trunk/CSP/CSPSim/Source/InputEvent.cpp =================================================================== --- trunk/CSP/CSPSim/Source/InputEvent.cpp 2004-07-02 18:14:45 UTC (rev 1135) +++ trunk/CSP/CSPSim/Source/InputEvent.cpp 2004-07-02 18:15:50 UTC (rev 1136) @@ -62,7 +62,7 @@ Replay::Replay(): m_if(g_Config.getString("DemoMode","FileName","Record.csp",true).c_str(),std::ios_base::binary) { if (!m_if) - throw exception("Replay::Replay(): error opening record file in read mode"); + throw std::runtime_error("Replay::Replay(): error opening record file in read mode"); } Replay::~Replay() { |
From: <sv...@ww...> - 2004-07-02 18:14:51
|
Author: delta Date: 2004-07-02 11:14:45 -0700 (Fri, 02 Jul 2004) New Revision: 1135 Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp Log: Reverted to doPoll = 10. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1135 Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp =================================================================== --- trunk/CSP/CSPSim/Source/CSPSim.cpp 2004-07-02 18:12:15 UTC (rev 1134) +++ trunk/CSP/CSPSim/Source/CSPSim.cpp 2004-07-02 18:14:45 UTC (rev 1135) @@ -677,7 +677,7 @@ simdata::Ref<VirtualHID> screen_interface = m_CurrentScreen->getInterface(); SDL_Event event; - short doPoll = 5; + short doPoll = 10; while (doPoll-- && m_InputEvent(event)) { //while (doPoll-- && SDL_PollEvent(&event)) { bool handled = false; |
From: <sv...@ww...> - 2004-07-02 18:12:22
|
Author: delta Date: 2004-07-02 11:12:15 -0700 (Fri, 02 Jul 2004) New Revision: 1134 Modified: trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp trunk/CSP/CSPSim/Source/Views/View.cpp Log: Renamed attributes. Fixed a bug in view 3: camera could'nt move below the plane. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1134 Modified: trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp 2004-07-02 18:06:22 UTC (rev 1133) +++ trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp 2004-07-02 18:12:15 UTC (rev 1134) @@ -48,7 +48,7 @@ VirtualScene* scene = CSPSim::theSim->getScene(); const simdata::Ref<TerrainObject> terrain = scene->getTerrain(); TerrainObject::IntersectionHint camera_hint = 0; - double const SAFETY = m_LookPoint.z()- terrain->getGroundElevation(m_LookPoint.x(),m_LookPoint.y(),camera_hint); + double const SAFETY = 2.0; float h = SAFETY + terrain->getGroundElevation(m_EyePoint.x(),m_EyePoint.y(),camera_hint); if (m_EyePoint.z() < h) { double alpha_2 = simdata::toRadians(0.5*scene->getViewAngle()); @@ -73,16 +73,16 @@ } double dh = abs(h - m_LookPoint.z() - min_elev); double angle_x = std::max(simdata::toRadians(1.0),asin(dh/m_CameraKinematics.getDistance())); - if (abs(m_CameraKinematics.getAngleX()) < simdata::PI_2) - m_CameraKinematics.setAngleX(angle_x); + if (abs(m_CameraKinematics.getPhi()) < simdata::PI_2) + m_CameraKinematics.setPhi(angle_x); else - m_CameraKinematics.setAngleX(simdata::PI-angle_x); + m_CameraKinematics.setPhi(simdata::PI-angle_x); m_CameraKinematics.panUpDownStop(); m_ViewList[m_ViewMode]->recalculate(m_EyePoint,m_LookPoint,m_UpVector,dt); } } -void CameraAgent::set(size_t vm,CameraCommand* ck) { +void CameraAgent::set(size_t vm,CameraCommand* cc) { if (m_ViewMode != vm) { ViewList::iterator view_it = m_ViewList.find(vm); if (view_it != m_ViewList.end()) { @@ -90,7 +90,7 @@ m_ViewMode = vm; } } - m_CameraKinematics.accept(ck); + m_CameraKinematics.accept(cc); } void CameraAgent::updateCamera(double dt) { Modified: trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp 2004-07-02 18:06:22 UTC (rev 1133) +++ trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp 2004-07-02 18:12:15 UTC (rev 1134) @@ -41,8 +41,8 @@ } void CameraKinematics::update(double dt) { - rotateAboutZ(dt); - rotateAboutX(dt); + rotateTheta(dt); + rotatePhi(dt); scale(dt); } @@ -60,29 +60,29 @@ m_BaseRate(simdata::toRadians(30.0)), m_DisplacementCoefficient(0.001), m_MinimumDistanceOffset(10.0), - m_AbsoluteMaximumDistance(2000.0) { + m_AbsoluteMaximumDistance(80000.0) { reset(); } -void CameraKinematics::clampX(double& value,float min_value,float max_value, bool smooth_on) { - if (smooth_on && m_PanRateX != 0.0) { - m_PanRateX = simdata::sign(m_PanRateX)*smooth(value,min_value,max_value)*m_BaseRate; +void CameraKinematics::clampPhi(double& phi,float min_phi,float max_phi,bool smooth_on) { + if (smooth_on && m_PanRatePhi != 0.0) { + m_PanRatePhi = simdata::sign(m_PanRatePhi)*smooth(phi,min_phi,max_phi)*m_BaseRate; } - value = simdata::clampTo<double>(value,min_value,max_value); + phi = simdata::clampTo<double>(phi,min_phi,max_phi); } -void CameraKinematics::clampZ(double& value,float min_value,float max_value, bool smooth_on) { - if (smooth_on && m_PanRateZ != 0.0) { - m_PanRateZ = simdata::sign(m_PanRateZ)*smooth(value,min_value,max_value)*m_BaseRate; +void CameraKinematics::clampTheta(double& theta,float min_theta,float max_theta, bool smooth_on) { + if (smooth_on && m_PanRateTheta != 0.0) { + m_PanRateTheta = simdata::sign(m_PanRateTheta)*smooth(theta,min_theta,max_theta)*m_BaseRate; } - value = simdata::clampTo<double>(value,min_value,max_value); + theta = simdata::clampTo<double>(theta,min_theta,max_theta); } void CameraKinematics::reset() { - m_AngleRotX = 0.0; - m_AngleRotZ = 0.0; - m_PanRateX = 0.0; - m_PanRateZ = 0.0; + m_Phi = 0.0; + m_Theta = 0.0; + m_PanRatePhi = 0.0; + m_PanRateTheta = 0.0; m_ZoomRate = 0.0; resetDistance(); } @@ -97,27 +97,27 @@ } void CameraKinematics::panLeft() { - m_PanRateZ = m_BaseRate; + m_PanRateTheta = m_BaseRate; } void CameraKinematics::panRight() { - m_PanRateZ = -m_BaseRate; + m_PanRateTheta = -m_BaseRate; } void CameraKinematics::panLeftRightStop() { - m_PanRateZ = 0.0; + m_PanRateTheta = 0.0; } void CameraKinematics::panUp() { - m_PanRateX = m_BaseRate; + m_PanRatePhi = m_BaseRate; } void CameraKinematics::panDown() { - m_PanRateX = -m_BaseRate; + m_PanRatePhi = -m_BaseRate; } void CameraKinematics::panUpDownStop() { - m_PanRateX = 0.0; + m_PanRatePhi = 0.0; } void CameraKinematics::zoomIn() { @@ -145,18 +145,18 @@ } void CameraKinematics::displacement(int x, int y, int dx, int dy) { - m_PanRateX = 0.0; - m_PanRateZ = 0.0; - m_AngleRotZ -= dx * m_DisplacementCoefficient; - m_AngleRotX -= dy * m_DisplacementCoefficient; + m_PanRatePhi = 0.0; + m_PanRateTheta = 0.0; + m_Theta -= dx * m_DisplacementCoefficient; + m_Phi -= dy * m_DisplacementCoefficient; } -void CameraKinematics::accept(CameraCommand* cm) { - if (cm) { - if (std::find(m_CameraCommandList.begin(),m_CameraCommandList.end(),cm) == m_CameraCommandList.end()) { - m_CameraCommandList.push_back(cm); - cm->setCameraKinematics(this); +void CameraKinematics::accept(CameraCommand* cc) { + if (cc) { + if (std::find(m_CameraCommandList.begin(),m_CameraCommandList.end(),cc) == m_CameraCommandList.end()) { + m_CameraCommandList.push_back(cc); + cc->setCameraKinematics(this); } - cm->execute(); + cc->execute(); } } Modified: trunk/CSP/CSPSim/Source/Views/View.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/View.cpp 2004-07-02 18:06:22 UTC (rev 1133) +++ trunk/CSP/CSPSim/Source/Views/View.cpp 2004-07-02 18:12:15 UTC (rev 1134) @@ -40,7 +40,7 @@ void View::updateBody(simdata::Vector3& ep,simdata::Vector3& lp,simdata::Vector3& up) { simdata::Vector3 object_up = m_ActiveObject->getUpDirection(); simdata::Vector3 object_dir = m_ActiveObject->getDirection(); - simdata::Quat q = simdata::Quat(-m_CameraKinematics->getAngleZ(),object_up,-m_CameraKinematics->getAngleX(), + simdata::Quat q = simdata::Quat(-m_CameraKinematics->getTheta(),object_up,-m_CameraKinematics->getPhi(), object_dir^object_up,0.0,object_dir); simdata::Vector3 object_pos = m_ActiveObject->getGlobalPosition(); ep = object_pos + m_CameraKinematics->getDistance() * q.rotate(-object_dir); @@ -49,7 +49,7 @@ } void View::updateWorld(simdata::Vector3& ep,simdata::Vector3& lp,simdata::Vector3& up) { - simdata::Quat q = simdata::Quat(-m_CameraKinematics->getAngleZ(),simdata::Vector3::ZAXIS,-m_CameraKinematics->getAngleX(), + simdata::Quat q = simdata::Quat(-m_CameraKinematics->getTheta(),simdata::Vector3::ZAXIS,-m_CameraKinematics->getPhi(), simdata::Vector3::XAXIS,0.0,simdata::Vector3::YAXIS); simdata::Vector3 object_pos = m_ActiveObject->getGlobalPosition(); ep = object_pos + m_CameraKinematics->getDistance() * q.rotate(-simdata::Vector3::YAXIS); @@ -77,15 +77,15 @@ void InternalView::constrain() { float limit = simdata::PI_2; - m_CameraKinematics->clampX(m_CameraKinematics->getAngleX(),-limit,limit); - m_CameraKinematics->clampZ(m_CameraKinematics->getAngleZ(),-limit,limit); + m_CameraKinematics->clampPhi(m_CameraKinematics->getPhi(),-limit,limit); + m_CameraKinematics->clampTheta(m_CameraKinematics->getTheta(),-limit,limit); } void InternalView::update(simdata::Vector3& ep,simdata::Vector3& lp,simdata::Vector3& up,double dt) { constrain(); simdata::Vector3 object_up = m_ActiveObject->getUpDirection(); simdata::Vector3 object_dir = m_ActiveObject->getDirection(); - simdata::Quat q = simdata::Quat(m_CameraKinematics->getAngleZ(),object_up,m_CameraKinematics->getAngleX(), + simdata::Quat q = simdata::Quat(m_CameraKinematics->getTheta(),object_up,m_CameraKinematics->getPhi(), object_dir^object_up,0.0,object_dir); simdata::Vector3 object_pos = m_ActiveObject->getGlobalPosition(); ep = object_pos + m_ActiveObject->getViewPoint(); @@ -164,8 +164,8 @@ } void SatelliteView::activate() { - m_CameraKinematics->setAngleZ(0.0); - m_CameraKinematics->setAngleX(simdata::PI_2); + m_CameraKinematics->setTheta(0.0); + m_CameraKinematics->setPhi(simdata::PI_2); m_CameraKinematics->setDistance(500.0); } @@ -188,8 +188,8 @@ m_Padlock = battlefield->getNextUnit(m_Padlock, -1, -1, -1); } if (m_Padlock != m_ActiveObject) { - m_NeckTheta = m_CameraKinematics->getAngleX() - 0.5*simdata::PI; - m_NeckPhi = m_CameraKinematics->getAngleZ(); + m_NeckTheta = m_CameraKinematics->getPhi() - 0.5*simdata::PI; + m_NeckPhi = m_CameraKinematics->getTheta(); } } |
From: <sv...@ww...> - 2004-07-02 18:06:28
|
Author: delta Date: 2004-07-02 11:06:22 -0700 (Fri, 02 Jul 2004) New Revision: 1133 Modified: trunk/CSP/CSPSim/Include/ObjectModel.h Log: Added m_Lighting bool attribute with default value true. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1133 Modified: trunk/CSP/CSPSim/Include/ObjectModel.h =================================================================== --- trunk/CSP/CSPSim/Include/ObjectModel.h 2004-07-02 18:04:50 UTC (rev 1132) +++ trunk/CSP/CSPSim/Include/ObjectModel.h 2004-07-02 18:06:22 UTC (rev 1133) @@ -83,6 +83,7 @@ SIMDATA_XML("elevation_correction", ObjectModel::m_ElevationCorrection, false) SIMDATA_XML("polygon_offset", ObjectModel::m_PolygonOffset, false) SIMDATA_XML("cull_face", ObjectModel::m_CullFace, false) + SIMDATA_XML("lighting", ObjectModel::m_Lighting, false) SIMDATA_XML("landing_gear", ObjectModel::m_LandingGear, false) SIMDATA_XML("animations", ObjectModel::m_Animations, false) END_SIMDATA_XML_INTERFACE @@ -122,6 +123,7 @@ bool m_ElevationCorrection; float m_PolygonOffset; int m_CullFace; + bool m_Lighting; ContactList m_Contacts; std::vector<simdata::Vector3> m_LandingGear; simdata::Link<Animation>::vector m_Animations; |
From: <sv...@ww...> - 2004-07-02 18:04:57
|
Author: delta Date: 2004-07-02 11:04:50 -0700 (Fri, 02 Jul 2004) New Revision: 1132 Modified: trunk/CSP/CSPSim/Include/DataRecorder.h Log: Added #include "SimData/Vector3.h" Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1132 Modified: trunk/CSP/CSPSim/Include/DataRecorder.h =================================================================== --- trunk/CSP/CSPSim/Include/DataRecorder.h 2004-07-02 18:03:41 UTC (rev 1131) +++ trunk/CSP/CSPSim/Include/DataRecorder.h 2004-07-02 18:04:50 UTC (rev 1132) @@ -29,6 +29,7 @@ #include <cstdio> +#include "SimData/Vector3.h" #include <Bus.h> |
From: <sv...@ww...> - 2004-07-02 18:03:47
|
Author: delta Date: 2004-07-02 11:03:41 -0700 (Fri, 02 Jul 2004) New Revision: 1131 Modified: trunk/CSP/CSPSim/Include/Views/CameraAgent.h trunk/CSP/CSPSim/Include/Views/CameraKinematics.h Log: Renamed attributes. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1131 Modified: trunk/CSP/CSPSim/Include/Views/CameraAgent.h =================================================================== --- trunk/CSP/CSPSim/Include/Views/CameraAgent.h 2004-07-02 06:58:42 UTC (rev 1130) +++ trunk/CSP/CSPSim/Include/Views/CameraAgent.h 2004-07-02 18:03:41 UTC (rev 1131) @@ -46,7 +46,7 @@ CameraAgent(const ViewFactory& vf); ~CameraAgent(); void attach(size_t mode,View* vm); - void set(size_t vm, CameraCommand* ck = 0); + void set(size_t vm, CameraCommand* cc = 0); void setObject(const simdata::Ref<DynamicObject> object); void updateCamera(double dt); const simdata::Vector3& getEyePoint() const {return m_EyePoint;} Modified: trunk/CSP/CSPSim/Include/Views/CameraKinematics.h =================================================================== --- trunk/CSP/CSPSim/Include/Views/CameraKinematics.h 2004-07-02 06:58:42 UTC (rev 1130) +++ trunk/CSP/CSPSim/Include/Views/CameraKinematics.h 2004-07-02 18:03:41 UTC (rev 1131) @@ -37,18 +37,18 @@ const float m_BaseRate, m_DisplacementCoefficient; const float m_MinimumDistanceOffset, m_AbsoluteMaximumDistance; - double m_AngleRotX, m_AngleRotZ; - float m_PanRateX, m_PanRateZ, m_ZoomRate; + double m_Phi, m_Theta; + float m_PanRatePhi, m_PanRateTheta, m_ZoomRate; double m_DistanceToObject, m_MinimumDistance; - void rotateAboutZ(double dt) {m_AngleRotZ += m_PanRateZ * dt;} - void rotateAboutX(double dt) {m_AngleRotX += m_PanRateX * dt;} + void rotateTheta(double dt) {m_Theta += m_PanRateTheta * dt;} + void rotatePhi(double dt) {m_Phi += m_PanRatePhi * dt;} void scale(double dt); float smooth(double value, float min_value,float max_value) const; public: CameraKinematics(); virtual ~CameraKinematics(){} - void clampX(double& value,float min_value,float max_value, bool smooth_on = true); - void clampZ(double& value,float min_value,float max_value, bool smooth_on = true); + void clampPhi(double& phi,float min_phi,float max_phi, bool smooth_on = true); + void clampTheta(double& theta,float min_theta,float max_theta, bool smooth_on = true); void reset(); void resetDistance(); void update(double dt); @@ -64,13 +64,13 @@ void zoomStepIn(); void zoomStepOut(); void displacement(int x, int y, int dx, int dy); - void setAngleX(double angle_x) {m_AngleRotX = angle_x;} - double& getAngleX() {return m_AngleRotX;} - void setAngleZ(double angle_z) {m_AngleRotZ = angle_z;} - double& getAngleZ() {return m_AngleRotZ;} + void setPhi(double phi) {m_Phi = phi;} + double& getPhi() {return m_Phi;} + void setTheta(double theta) {m_Theta = theta;} + double& getTheta() {return m_Theta;} void setDistance(float d) {m_DistanceToObject = d;} double getDistance() const {return m_DistanceToObject;} - void accept(CameraCommand* cm); + void accept(CameraCommand* cc); }; #endif //__CAMERAKINEMATICS_H__ |
From: <sv...@ww...> - 2004-07-02 06:58:47
|
Author: mkrose Date: 2004-07-01 23:58:42 -0700 (Thu, 01 Jul 2004) New Revision: 1130 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/ScopedPointer.h Log: Fixed typo in ScopedPointer.h. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1130 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-07-02 06:57:12 UTC (rev 1129) +++ trunk/CSP/SimData/CHANGES.current 2004-07-02 06:58:42 UTC (rev 1130) @@ -5,6 +5,8 @@ * Added a simple but fast memory pool class for allocating fixed size buffers. + * Fixed typo in ScopedPointer.h + 2004-06-28: delta. Mainly vs .net's fixes. Here's a few details: * Added Source/Timing.cpp, ThreadBase.cpp to the vs .net build. Modified: trunk/CSP/SimData/Include/SimData/ScopedPointer.h =================================================================== --- trunk/CSP/SimData/Include/SimData/ScopedPointer.h 2004-07-02 06:57:12 UTC (rev 1129) +++ trunk/CSP/SimData/Include/SimData/ScopedPointer.h 2004-07-02 06:58:42 UTC (rev 1130) @@ -71,13 +71,13 @@ * * Will abort if the pointer is null. */ - inline T & operator*() const { assert(ptr); return *_ptr; } + inline T & operator*() const { assert(_ptr); return *_ptr; } /** Dereference the pointer. * * Will abort if the pointer is null. */ - inline T * operator->() const { assert(ptr); return _ptr; } + inline T * operator->() const { assert(_ptr); return _ptr; } /** Get the raw pointer. */ |
From: <sv...@ww...> - 2004-07-02 06:57:18
|
Author: mkrose Date: 2004-07-01 23:57:12 -0700 (Thu, 01 Jul 2004) New Revision: 1129 Added: trunk/CSP/SimData/Include/SimData/BufferPool.h Modified: trunk/CSP/SimData/CHANGES.current Log: Added a simple but fast memory pool class for allocating fixed size buffers. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1129 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-06-29 12:05:57 UTC (rev 1128) +++ trunk/CSP/SimData/CHANGES.current 2004-07-02 06:57:12 UTC (rev 1129) @@ -1,18 +1,22 @@ Version 0.4.0 (in progress) =========================== +2004-07-01: onsight + * Added a simple but fast memory pool class for allocating fixed + size buffers. + 2004-06-28: delta. Mainly vs .net's fixes. Here's a few details: * Added Source/Timing.cpp, ThreadBase.cpp to the vs .net build. - + * Added pthread (linked against pthreadVC.lib for now) to the build. ==> Windows users need to update their dev pack. - + * Changed min/max macros to std::min/std::max in Interpolate.cpp. - + * Added export symbols in Include/Timing.h - + * Moved public keyword outside #ifdef ___GNUC___ in class Trace. - + * Changed macro min/max to using std:min/max in Interpolate.cpp. 2004-06-27: onsight Added: trunk/CSP/SimData/Include/SimData/BufferPool.h =================================================================== --- trunk/CSP/SimData/Include/SimData/BufferPool.h 2004-06-29 12:05:57 UTC (rev 1128) +++ trunk/CSP/SimData/Include/SimData/BufferPool.h 2004-07-02 06:57:12 UTC (rev 1129) @@ -0,0 +1,155 @@ +/* SimData: Data Infrastructure for Simulations + * Copyright (C) 2004 Mark Rose <mk...@us...> + * + * 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 + * 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 BufferPool.h + * @brief A fixed size, fixed capacity buffer pool. + * + * Pool allocation and deallocation of memory buffers is roughly 10 + * times faster then new[] and delete[], and 7 times faster than + * malloc and free (benchmarked with gcc -O2). Pools also help to + * prevent memory fragmentation. + * + */ + + +#ifndef __SIMDATA_BUFFERPOOL_H__ +#define __SIMDATA_BUFFERPOOL_H__ + +#include <SimData/Uniform.h> +#include <cassert> + +NAMESPACE_SIMDATA + + +/** A fixed size, fixed capacity memory buffer pool. + * + * BufferPool provides high performance allocation and deallocation of + * fixed size buffers. When using BufferPools, care must be taken to + * properly manage the raw buffer pointers. In particular, buffers + * allocated from a pool must be returned to the pool, either by calling + * the release() method of the pool instance, or the static free() method + * of the BufferPool class. Under no circumstances should the C++ new or + * delete operators be used with pool buffers (same goes for malloc/free). + * + * Buffers that are not released will result in a memory leak. As long + * as tryAllocate is used for allocation, the leaked buffers be reclaimed + * when the pool is destroyed. If allocate() is used, however, it is + * possible that some of the buffers will be allocated individually from + * the free store, and these cannot be reclaimed by deleting the pool. + * + * In general, you should try to keep the code that allocates and releases + * buffers as localized as possible. The ScopedBuffer class can help with + * this, by providing automatic buffer release the end of the scope in + * which it is defined. Using ScopedBuffers also ensures that buffers are + * properly released in the event an exception is thrown. + */ +class BufferPool: public NonCopyable { + + typedef BufferPool* Prefix; + static const int OFFSET = sizeof(Prefix); + + uint8* m_buffer; + uint8** m_index; + uint32 m_count; + uint32 m_size; + +public: + + /** Create a new pool. + * + * @param size the size of each buffer + * @param count the number of buffers in the pool. + */ + BufferPool(uint32 size, uint32 count): m_buffer(0), m_index(0), m_count(count), m_size(size) { + const int bsize = size + OFFSET; + m_buffer = new uint8[n * bsize]; + m_index = new (uint8*)[n]; + uint8* binit = m_buffer; + for (uint32 i = 0; i < n; i++, binit += bsize) { + m_index[i] = binit + OFFSET; + *(reinterpret_cast<Prefix*>(binit)) = this; + } + } + + uint32 size() const { return m_size; } + uint32 count() const { return m_count; } + + ~BufferPool() { + delete[] m_index; + delete[] m_buffer; + } + + inline uint8 *tryAllocate() { + return (m_count) ? m_index[--m_count] : 0; + } + + inline uint8 *allocate() { + if (m_count) { + return m_index[--m_count]; + } + uint8 *new_buffer = new uint8[m_size]; + *(reinterpret_cast<Prefix*>(new_buffer)) = 0; + return new_buffer + OFFSET; + } + + inline uint8 *allocateAndClear() { + uint8 *buffer = allocate(); + memset(buffer, 0, m_size); + return buffer; + } + + inline void release(uint8 *buffer) { + BufferPool::Prefix *base = reinterpret_cast<BufferPool::Prefix*>(buffer) - 1; + assert(*base == this); + m_index[m_count++] = buffer; + } + + static inline void free(uint8 *buffer) { + if (buffer == 0) return; + BufferPool::Prefix *base = reinterpret_cast<BufferPool::Prefix*>(buffer) - 1; + if (*base) { + (*base)->_release(buffer); + } else { + delete[] reinterpret_cast<uint8*>(base); + } + }; + +private: + inline void _release(uint8 *buffer) { + m_index[m_count++] = buffer; + } + +}; + + +class ScopedBuffer: public NonCopyable { + uint8 *m_buffer; +public: + ScopedBuffer(uint8* buffer): m_buffer(buffer) { } + ~ScopedBuffer() { BufferPool::free(m_buffer); } + inline uint8 *get() const { return m_buffer; } +}; + + +NAMESPACE_SIMDATA_END + +#endif // __SIMDATA_BUFFERPOOL_H__ |
From: <sv...@ww...> - 2004-06-29 12:06:10
|
Author: delta Date: 2004-06-29 05:05:57 -0700 (Tue, 29 Jun 2004) New Revision: 1128 Modified: trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: See CHANGES.current Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1128 Diff omitted (10550 bytes). |
From: <sv...@ww...> - 2004-06-29 12:05:21
|
Author: delta Date: 2004-06-29 05:05:15 -0700 (Tue, 29 Jun 2004) New Revision: 1127 Modified: trunk/CSP/CSPSim/Source/DynamicObject.cpp Log: Include Networking.h before others for now. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1127 Modified: trunk/CSP/CSPSim/Source/DynamicObject.cpp =================================================================== --- trunk/CSP/CSPSim/Source/DynamicObject.cpp 2004-06-29 12:04:05 UTC (rev 1126) +++ trunk/CSP/CSPSim/Source/DynamicObject.cpp 2004-06-29 12:05:15 UTC (rev 1127) @@ -22,6 +22,7 @@ * **/ +#include <SimNet/Networking.h> #include <DynamicObject.h> #include <Controller.h> @@ -35,9 +36,9 @@ #include <SimData/Quat.h> -#include <SimNet/Networking.h> + SIMDATA_REGISTER_INTERFACE(DynamicObject) |
From: <sv...@ww...> - 2004-06-29 12:04:11
|
Author: delta Date: 2004-06-29 05:04:05 -0700 (Tue, 29 Jun 2004) New Revision: 1126 Modified: trunk/CSP/CSPSim/Source/SimNet/MessageSocketDuplex.cpp trunk/CSP/CSPSim/Source/SimNet/NetworkMessenger.cpp Log: Added "return 0" to methods returning nothing. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1126 Modified: trunk/CSP/CSPSim/Source/SimNet/MessageSocketDuplex.cpp =================================================================== --- trunk/CSP/CSPSim/Source/SimNet/MessageSocketDuplex.cpp 2004-06-29 11:42:08 UTC (rev 1125) +++ trunk/CSP/CSPSim/Source/SimNet/MessageSocketDuplex.cpp 2004-06-29 12:04:05 UTC (rev 1126) @@ -125,7 +125,7 @@ int MessageSocketDuplex::sendto(std::vector<RoutedMessage> * sendArray, int count) { - + return 0; } int MessageSocketDuplex::recvfrom(std::vector<RoutedMessage> * receiveArray, int * count) Modified: trunk/CSP/CSPSim/Source/SimNet/NetworkMessenger.cpp =================================================================== --- trunk/CSP/CSPSim/Source/SimNet/NetworkMessenger.cpp 2004-06-29 11:42:08 UTC (rev 1125) +++ trunk/CSP/CSPSim/Source/SimNet/NetworkMessenger.cpp 2004-06-29 12:04:05 UTC (rev 1126) @@ -343,7 +343,7 @@ int NetworkMessenger::sendto(std::vector<RoutedMessage> * sendArray, int count) { CSP_LOG(APP, DEBUG, "NetworkMessenger::sendto(RoutedMessageArray,Count) - Sending Network Packet"); - + return 0; } int NetworkMessenger::recvfrom(std::vector<RoutedMessage> * receiveArray, int * count) |