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-06-29 11:42:14
|
Author: delta Date: 2004-06-29 04:42:08 -0700 (Tue, 29 Jun 2004) New Revision: 1125 Modified: trunk/CSP/CSPSim/CHANGES.current Log: See me. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1125 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-06-29 11:35:25 UTC (rev 1124) +++ trunk/CSP/CSPSim/CHANGES.current 2004-06-29 11:42:08 UTC (rev 1125) @@ -1,6 +1,30 @@ Version 0.4.0 (in progress) =========================== +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). + Added bool isInternal(). + + * Changed various Vector3 ctors to simple set method (mostly in + PhysicsModel and AircraftPhysicsModel classes). + + * Increased the number of iterations in AircraftPhysicsModel::doSimStep. + + * Various corrections related to m_PositionLocal. + + * Added a RECORD/REPLAY mode via a flag in CSPSim.ini. + Position the flag to RECORD will record the current run, saving the + events in a file (binary format). This file can be played back with + REPLAY value. Standard run is obtained by PLAY keyword (default value). +==> Linux users: add InputEvent.cpp to the build. + + * Fixed a bug with the gear sprite at initialization. + + * Minor others changes. + + * Checking mods before situation gets worse due to an svn's problem ;) + 2004-06-28: wolverine * Changed subdirectory name from Networking to SimNet. Also moved the Networking.h include file to a SimNet subdirectory. @@ -83,7 +107,6 @@ received messages. 2004-05-30: wolverine - * 2004-05-30: wolverine * Changed the router queue in NetworkMessagener to be a vector that contains a struct with a node and message pointers. This allows a destination node to be associated with each outgoing message. This @@ -119,9 +142,9 @@ 2004-05-12: delta * Removed obsolete ComputeTransformCallback in Source/VirtualScene.cpp - and replaced it by an osg::Transform (lunalog's post). + and replaced it by an osg::Transform (lunadog's post). -2004-05-09 +2004-05-09: delta * Minor cleanings in Include/CSPSim.h. * Commented out glFinish() in Source/VirtualScene.cpp which can be |
From: <sv...@ww...> - 2004-06-29 11:35:31
|
Author: delta Date: 2004-06-29 04:35:25 -0700 (Tue, 29 Jun 2004) New Revision: 1124 Modified: trunk/CSP/CSPSim/Data/CSPSim.ini Log: Added InputEvent config. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1124 Modified: trunk/CSP/CSPSim/Data/CSPSim.ini =================================================================== --- trunk/CSP/CSPSim/Data/CSPSim.ini 2004-06-29 11:34:10 UTC (rev 1123) +++ trunk/CSP/CSPSim/Data/CSPSim.ini 2004-06-29 11:35:25 UTC (rev 1124) @@ -1,51 +1,59 @@ -; CSP configuration settings - -[Debug] -LoggingLevel = 0 -Battlefield = 1 -Demeter = true - -[Screen] -Width = 1024 -Height = 768 -FullScreen = 0 - -[Paths] -CachePath = ../Data -InputMapPath = Input -DataPath = ../Data -FontPath = Fonts -ModelPath = Models -ImagePath = Images -SoundPath = Sounds -TerrainPath = Terrain -ConfigPath = ../Data - -[View] -Wireframe = false -ViewDistance = 100000 -Fog = true -FogStart = 10000 -FogEnd = 100000 - -[Testing] -Mute = true -MudBubbleRadius = 40000 -AirBubbleRadius = 80000 -VisualRadius = 40000 -Date = 2004-05-09 12:00:00 - -[Networking] -UseNetworking = true -LocalMessagePort = 3150 -LocalMessageHost = 127.0.0.1 -RemoteMessagePort = 3160 -RemoteMessageHost = 127.0.0.1 - -; balkan theater (demeter) -Theater = sim:theater.balkan - - -; northern CA theater (chunkedLod) -;Theater = sim:theater.nca -;Date = 2003-05-15 14:19:30 +; CSP configuration settings + +[Debug] +LoggingLevel = 5 +Battlefield = 1 +Demeter = true +LogFile = CSPSim.log + +[Screen] +Width = 1024 +Height = 768 +FullScreen = 0 + +[DemoMode] +FileName = Command.csp +# 0 = PLAY +# 1 = REPLAY +# 2 = RECORD +Mode = 0 + +[Paths] +CachePath = ../Data +InputMapPath = Input +DataPath = ../Data +FontPath = Fonts +ModelPath = Models +ImagePath = Images +SoundPath = Sounds +TerrainPath = Terrain +ConfigPath = ../Data + +[View] +Wireframe = false +ViewDistance = 100000 +Fog = true +FogStart = 10000 +FogEnd = 100000 + +[Testing] +Mute = true +MudBubbleRadius = 40000 +AirBubbleRadius = 80000 +VisualRadius = 40000 +Date = 2004-05-09 12:00:00 + +[Networking] +UseNetworking = true +LocalMessagePort = 3150 +LocalMessageHost = 127.0.0.1 +RemoteMessagePort = 3160 +RemoteMessageHost = 82.101.7.217 +Theater = sim:theater.balkan + +; balkan theater (demeter) + + +; northern CA theater (chunkedLod) +;Theater = sim:theater.nca +;Date = 2003-05-15 14:19:30 |
From: <sv...@ww...> - 2004-06-29 11:34:16
|
Author: delta Date: 2004-06-29 04:34:10 -0700 (Tue, 29 Jun 2004) New Revision: 1123 Modified: trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp Log: Don't validate in internal view. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1123 Modified: trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp 2004-06-29 11:32:51 UTC (rev 1122) +++ trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp 2004-06-29 11:34:10 UTC (rev 1123) @@ -47,11 +47,11 @@ void CameraAgent::validate(double dt) { VirtualScene* scene = CSPSim::theSim->getScene(); const simdata::Ref<TerrainObject> terrain = scene->getTerrain(); - double const SAFETY = 2.0; TerrainObject::IntersectionHint camera_hint = 0; + double const SAFETY = m_LookPoint.z()- terrain->getGroundElevation(m_LookPoint.x(),m_LookPoint.y(),camera_hint); float h = SAFETY + terrain->getGroundElevation(m_EyePoint.x(),m_EyePoint.y(),camera_hint); - if (m_EyePoint.z() <= h) { - double alpha_2 = simdata::toRadians(scene->getViewAngle()/2.0); + if (m_EyePoint.z() < h) { + double alpha_2 = simdata::toRadians(0.5*scene->getViewAngle()); double near_dist = scene->getNearPlane(); double aspect = scene->getAspect(); simdata::Vector3 eye_look = m_LookPoint - m_EyePoint; @@ -67,13 +67,13 @@ simdata::Vector3 edge_vector = near_dist * (eye_look_unit + tan_alpha_2 * ( i * up_vec_unit + j * aspect * right_unit)); simdata::Vector3 edge = m_EyePoint + edge_vector; - double edge_elev = edge.z()-(SAFETY+terrain->getGroundElevation(edge.x(),edge.y(),camera_hint)); + double edge_elev = edge.z()-terrain->getGroundElevation(edge.x(),edge.y(),camera_hint); if (min_elev > edge_elev) min_elev = edge_elev; } double dh = abs(h - m_LookPoint.z() - min_elev); - double angle_x = asin(dh/m_CameraKinematics.getDistance()); - if (abs(m_CameraKinematics.getAngleX()) < 0.5*simdata::PI) + 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); else m_CameraKinematics.setAngleX(simdata::PI-angle_x); @@ -98,7 +98,8 @@ if (view != m_ViewList.end()) { m_CameraKinematics.update(dt); view->second->update(m_EyePoint,m_LookPoint,m_UpVector,dt); - validate(dt); + if (!view->second->isInternal()) + validate(dt); view->second->cull(); } } |
From: <sv...@ww...> - 2004-06-29 11:32:57
|
Author: delta Date: 2004-06-29 04:32:51 -0700 (Tue, 29 Jun 2004) New Revision: 1122 Modified: trunk/CSP/CSPSim/Source/Views/View.cpp Log: Shaking bug correction in flyby view. m_InternalView renamed m_Internal. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1122 Modified: trunk/CSP/CSPSim/Source/Views/View.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/View.cpp 2004-06-29 11:31:24 UTC (rev 1121) +++ trunk/CSP/CSPSim/Source/Views/View.cpp 2004-06-29 11:32:51 UTC (rev 1122) @@ -59,17 +59,17 @@ View::View(size_t vm): m_ViewMode(vm), - m_InternalView(false) { + m_Internal(false) { } void View::cull() { VirtualScene* scene = CSPSim::theSim->getScene(); if (scene && m_ActiveObject.valid()) { bool isNear = m_ActiveObject->getNearFlag(); - if (isNear && !m_InternalView) { + if (isNear && !m_Internal) { scene->setNearObject(m_ActiveObject, false); } else - if (!isNear && m_InternalView) { + if (!isNear && m_Internal) { scene->setNearObject(m_ActiveObject, true); } } @@ -147,7 +147,7 @@ void FlybyView::update(simdata::Vector3& ep,simdata::Vector3& lp,simdata::Vector3& up,double dt) { lp = m_ActiveObject->getGlobalPosition(); ep = m_FixedCameraPosition; - if ((lp - ep).length() > 900.0) + if ((lp - ep).length() > 1000.0) newFixedCamPos(m_ActiveObject.get()); up = simdata::Vector3::ZAXIS; } @@ -155,7 +155,7 @@ void FlybyView::recalculate(simdata::Vector3& ep,simdata::Vector3& lp,simdata::Vector3& up,double dt) { VirtualScene* scene = CSPSim::theSim->getScene(); const simdata::Ref<TerrainObject> terrain = scene->getTerrain(); - const float SAFETY = 2.0; + 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; @@ -165,7 +165,7 @@ void SatelliteView::activate() { m_CameraKinematics->setAngleZ(0.0); - m_CameraKinematics->setAngleX(0.5*simdata::PI); + m_CameraKinematics->setAngleX(simdata::PI_2); m_CameraKinematics->setDistance(500.0); } @@ -177,7 +177,7 @@ PadlockView::PadlockView(size_t vm): View(vm), m_Padlock(m_ActiveObject) { - m_InternalView = true; + m_Internal = true; } void PadlockView::activate() { |
From: <sv...@ww...> - 2004-06-29 11:31:32
|
Author: delta Date: 2004-06-29 04:31:24 -0700 (Tue, 29 Jun 2004) New Revision: 1121 Modified: trunk/CSP/CSPSim/Source/System.cpp Log: Changed #include <> to "". Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1121 Modified: trunk/CSP/CSPSim/Source/System.cpp =================================================================== --- trunk/CSP/CSPSim/Source/System.cpp 2004-06-29 11:30:33 UTC (rev 1120) +++ trunk/CSP/CSPSim/Source/System.cpp 2004-06-29 11:31:24 UTC (rev 1121) @@ -25,8 +25,8 @@ **/ -#include <System.h> -#include <SystemsModel.h> +#include "System.h" +#include "SystemsModel.h" SIMDATA_REGISTER_INTERFACE(System) |
From: <sv...@ww...> - 2004-06-29 11:30:39
|
Author: delta Date: 2004-06-29 04:30:33 -0700 (Tue, 29 Jun 2004) New Revision: 1120 Modified: trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp Log: min/max workaround. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1120 Modified: trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp =================================================================== --- trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp 2004-06-29 11:29:54 UTC (rev 1119) +++ trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp 2004-06-29 11:30:33 UTC (rev 1120) @@ -22,10 +22,10 @@ * **/ - #include <SynchronousUpdate.h> + int UpdateProxy::update(double time) { if (!m_Target) return DEAD; double dt = m_Target->onUpdate(time - m_LastUpdateTime); @@ -42,7 +42,7 @@ UpdateProxy::Ref UpdateMaster::registerUpdate(UpdateTarget *target, double delay) { UpdateProxy::Ref proxy; if (target) { - delay = std::max(0.0, delay); + delay = std::max<double>(0.0, delay); proxy = new UpdateProxy(target, this, m_Time + delay); if (delay > 0.0) { m_DelayQueue.push_back(proxy); |
From: <sv...@ww...> - 2004-06-29 11:30:00
|
Author: delta Date: 2004-06-29 04:29:54 -0700 (Tue, 29 Jun 2004) New Revision: 1119 Modified: trunk/CSP/CSPSim/Source/Sky.cpp Log: ATI workaround. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1119 Modified: trunk/CSP/CSPSim/Source/Sky.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Sky.cpp 2004-06-29 11:27:36 UTC (rev 1118) +++ trunk/CSP/CSPSim/Source/Sky.cpp 2004-06-29 11:29:54 UTC (rev 1119) @@ -1097,7 +1097,9 @@ void updateHorizon(float altitude, float clip) { float a = 0.0; float da = 2.0 * simdata::PI / m_Segments; - float radius = std::min(1000000.0, std::max(1.5*clip, sqrt(2.0 * 6370000.0 * altitude))); + // XXX + //float radius = std::min(1000000.0, std::max(1.5*clip, sqrt(2.0 * 6370000.0 * altitude))); + float radius = std::min(99500.0f, std::max<float>(1.5f*clip, sqrt(2.0f * 6370000.0 * altitude))); // variation less than 2 pixels under most conditions: if (fabs(radius - m_Radius) < 0.0005 * m_Radius) return; //std::cerr << "HORIZON -> " << radius << "\n"; @@ -1160,8 +1162,9 @@ int i, j; float x, y, z; float alpha, theta; + // XXX //float radius = 1100000.0f; - float radius = 64000.0f; + float radius = 99500.0f; m_Horizon = new FalseHorizon; #ifdef TEXDOME m_Horizon->init(192); @@ -1219,8 +1222,12 @@ drawElements->push_back((i+0)*m_nseg+(j%m_nseg)); } } + + // XXX enbaling/disabling dl/vbo may impact performance m_SkyDome->setSupportsDisplayList(false); m_SkyDome->setUseDisplayList(false); + //m_SkyDome->setUseVertexBufferObjects(false); + m_SkyDome->addPrimitiveSet(drawElements); m_SkyDome->setVertexArray(&coords); m_SkyDome->setTexCoordArray(0, &tcoords); @@ -1261,6 +1268,13 @@ dome_state->setMode(GL_CULL_FACE, StateAttribute::OFF); dome_state->setMode(GL_DEPTH_TEST, StateAttribute::OFF); dome_state->setMode(GL_FOG, osg::StateAttribute::OFF); + dome_state->setMode(GL_CLIP_PLANE0, osg::StateAttribute::OFF); + dome_state->setMode(GL_CLIP_PLANE1, osg::StateAttribute::OFF); + dome_state->setMode(GL_CLIP_PLANE2, osg::StateAttribute::OFF); + dome_state->setMode(GL_CLIP_PLANE3, osg::StateAttribute::OFF); + dome_state->setMode(GL_CLIP_PLANE4, osg::StateAttribute::OFF); + dome_state->setMode(GL_CLIP_PLANE5, osg::StateAttribute::OFF); + dome_state->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); dome_state->setRenderBinDetails(-2,"RenderBin"); osg::Depth* depth = new osg::Depth; depth->setFunction(osg::Depth::ALWAYS); |
From: <sv...@ww...> - 2004-06-29 11:27:42
|
Author: delta Date: 2004-06-29 04:27:36 -0700 (Tue, 29 Jun 2004) New Revision: 1118 Modified: trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp Log: Minor changed. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1118 Modified: trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp 2004-06-29 11:24:36 UTC (rev 1117) +++ trunk/CSP/CSPSim/Source/ScreenInfoManager.cpp 2004-06-29 11:27:36 UTC (rev 1118) @@ -91,9 +91,9 @@ virtual void apply (osg::Node& node) { if (node.getName() == m_NameToFind) { m_FoundNode = &node; - return; } - traverse(node); + else + traverse(node); } void setNameToFind(const std::string& name) { m_NameToFind = name; |
From: <sv...@ww...> - 2004-06-29 11:24:42
|
Author: delta Date: 2004-06-29 04:24:36 -0700 (Tue, 29 Jun 2004) New Revision: 1117 Modified: trunk/CSP/CSPSim/Source/PhysicsModel.cpp Log: Set method replace Vector3 ctors. LocalPosition changed. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1117 Modified: trunk/CSP/CSPSim/Source/PhysicsModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/PhysicsModel.cpp 2004-06-29 11:20:27 UTC (rev 1116) +++ trunk/CSP/CSPSim/Source/PhysicsModel.cpp 2004-06-29 11:24:36 UTC (rev 1117) @@ -107,14 +107,14 @@ } void PhysicsModel::YToBody(Vector::Vectord const &y) { - m_PositionBody = simdata::Vector3(y[0],y[1],y[2]); - m_VelocityBody = simdata::Vector3(y[3],y[4],y[5]); + m_PositionBody.set(y[0],y[1],y[2]); + m_VelocityBody.set(y[3],y[4],y[5]); //m_AngularVelocityBody = m_Damping * simdata::Vector3(y[6],y[7],y[8]); - m_AngularVelocityBody = simdata::Vector3(y[6],y[7],y[8]); + m_AngularVelocityBody.set(y[6],y[7],y[8]); } void PhysicsModel::physicsBodyToLocal() { - m_PositionLocal = m_PositionLocal + bodyToLocal(m_PositionBody); + m_PositionLocal = b_Position->value() + bodyToLocal(m_PositionBody); m_VelocityLocal = bodyToLocal(m_VelocityBody); m_AngularVelocityLocal = bodyToLocal(m_AngularVelocityBody); } |
From: <sv...@ww...> - 2004-06-29 11:20:33
|
Author: delta Date: 2004-06-29 04:20:27 -0700 (Tue, 29 Jun 2004) New Revision: 1116 Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp Log: Landing gear position bug at start up. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1116 Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-06-29 11:18:18 UTC (rev 1115) +++ trunk/CSP/CSPSim/Source/ObjectModel.cpp 2004-06-29 11:20:27 UTC (rev 1116) @@ -327,9 +327,9 @@ m_Model = adjust; simdata::Matrix3 sd_adjust = simdata::fromOSG(model_orientation); //.getInverse(); for (unsigned i = 0; i < m_Contacts.size(); i++) { - m_Contacts[i] = sd_adjust * m_Contacts[i] + m_Offset; + m_Contacts[i] = sd_adjust * m_Contacts[i] + m_Offset; } - m_ViewPoint = sd_adjust * m_ViewPoint + m_Offset; + m_ViewPoint = sd_adjust * m_ViewPoint + m_Offset; } osg::BoundingSphere s = m_Model->getBound(); @@ -504,10 +504,13 @@ size_t n = m_LandingGear.size(); if (n>0) { m_GearSprites = new osg::Group; + m_GearSprites->setName("GearSprites"); makeFrontGear(m_LandingGear[0]); makeLeftGear(m_LandingGear[1]); makeRightGear(m_LandingGear[2]); m_DebugMarkers->addChild(m_GearSprites.get()); + simdata::Vector3 move[3] = {simdata::Vector3::ZERO,simdata::Vector3::ZERO,simdata::Vector3::ZERO}; + updateGearSprites(std::vector<simdata::Vector3>(move,move+3)); } } @@ -520,7 +523,7 @@ osg::Node *node = m_GearSprites->getChild(j); osg::PositionAttitudeTransform *pos = dynamic_cast<osg::PositionAttitudeTransform*>(node); if (pos && i < move.size()) { - osg::Vec3 p = osg::Vec3(m_LandingGear[i].x(),m_LandingGear[i].y(),move[i].z()); + osg::Vec3 p(m_LandingGear[i].x(),m_LandingGear[i].y(),move[i].z()); pos->setPosition(p); ++i; } |
From: <sv...@ww...> - 2004-06-29 11:18:24
|
Author: delta Date: 2004-06-29 04:18:18 -0700 (Tue, 29 Jun 2004) New Revision: 1115 Modified: trunk/CSP/CSPSim/Source/LogoScreen.cpp Log: Initializer list. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1115 Modified: trunk/CSP/CSPSim/Source/LogoScreen.cpp =================================================================== --- trunk/CSP/CSPSim/Source/LogoScreen.cpp 2004-06-29 11:17:34 UTC (rev 1114) +++ trunk/CSP/CSPSim/Source/LogoScreen.cpp 2004-06-29 11:18:18 UTC (rev 1115) @@ -46,9 +46,9 @@ //extern OpenThreads::Barrier bar; -LogoScreen::LogoScreen(int width, int height) { - m_width = width; - m_height = height; +LogoScreen::LogoScreen(int width, int height): + m_width(width), + m_height(height) { } LogoScreen::~LogoScreen() { |
From: <sv...@ww...> - 2004-06-29 11:17:41
|
Author: delta Date: 2004-06-29 04:17:34 -0700 (Tue, 29 Jun 2004) New Revision: 1114 Modified: trunk/CSP/CSPSim/Source/LandingGear.cpp Log: Used clampTo. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1114 Modified: trunk/CSP/CSPSim/Source/LandingGear.cpp =================================================================== --- trunk/CSP/CSPSim/Source/LandingGear.cpp 2004-06-29 11:16:29 UTC (rev 1113) +++ trunk/CSP/CSPSim/Source/LandingGear.cpp 2004-06-29 11:17:34 UTC (rev 1114) @@ -269,7 +269,7 @@ double vCompression = - dot(vBody, normalGroundBody) * motionNormal; // restrict to reasonable limits (faster than this means the gear will // probably break in a moment anyway) - vCompression = std::min(std::max(vCompression, -10.0), 10.0); + vCompression = simdata::clampTo(vCompression, -10.0, 10.0); // ground support (in response to strut compression + damping) double normalForce = (m_K * m_Compression + m_Beta * vCompression) * motionNormal; if (normalForce < 0.0) normalForce = 0.0; // wheel hop |
From: <sv...@ww...> - 2004-06-29 11:16:35
|
Author: delta Date: 2004-06-29 04:16:29 -0700 (Tue, 29 Jun 2004) New Revision: 1113 Modified: trunk/CSP/CSPSim/Source/GameScreen.cpp Log: A screenshot is now simply prefixed "CSP". Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1113 Modified: trunk/CSP/CSPSim/Source/GameScreen.cpp =================================================================== --- trunk/CSP/CSPSim/Source/GameScreen.cpp 2004-06-29 11:12:56 UTC (rev 1112) +++ trunk/CSP/CSPSim/Source/GameScreen.cpp 2004-06-29 11:16:29 UTC (rev 1113) @@ -132,7 +132,7 @@ } public: // XXX: next release of osg should allow saving to jpg instead of bmp - SnapImageDrawCallback(const std::string& filename = "CSPScreen",const std::string& ext = ".bmp"): + SnapImageDrawCallback(const std::string& filename = "CSP",const std::string& ext = ".bmp"): m_Filename(filename), m_Ext(".bmp"), m_SnapImageOnNextFrame(false){ @@ -167,7 +167,7 @@ SnapImageDrawCallback sn; sn.setSnapImageOnNextFrame(true); osg::ref_ptr<Producer::Camera> camera = new Producer::Camera; - sn.operator()(*camera); + sn(*camera); } void GameScreen::createCameraCommand() { |
From: <sv...@ww...> - 2004-06-29 11:13:03
|
Author: delta Date: 2004-06-29 04:12:56 -0700 (Tue, 29 Jun 2004) New Revision: 1112 Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp Log: InputEvent addition. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1112 Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp =================================================================== --- trunk/CSP/CSPSim/Source/CSPSim.cpp 2004-06-29 11:10:48 UTC (rev 1111) +++ trunk/CSP/CSPSim/Source/CSPSim.cpp 2004-06-29 11:12:56 UTC (rev 1112) @@ -104,7 +104,6 @@ SDLWave m_audioWave; - /////////////////////////////////////////////////////////////////////// // CSPSim @@ -115,9 +114,7 @@ */ CSPSim *CSPSim::theSim = 0; -CSPSim::CSPSim() -{ - +CSPSim::CSPSim() { if (theSim == 0) { theSim = this; } @@ -673,7 +670,6 @@ } } - void CSPSim::doInput(double dt) { CSP_LOG(APP, DEBUG, "CSPSim::doInput()..."); @@ -681,8 +677,9 @@ simdata::Ref<VirtualHID> screen_interface = m_CurrentScreen->getInterface(); SDL_Event event; - int doPoll = 10; - while (doPoll-- && SDL_PollEvent(&event)) { + short doPoll = 5; + while (doPoll-- && m_InputEvent(event)) { + //while (doPoll-- && SDL_PollEvent(&event)) { bool handled = false; HID::translate(event); if (event.type == SDL_QUIT) { @@ -707,6 +704,7 @@ handled = m_Interface->onEvent(event); } } + // run input scripts if (screen_interface.valid()) { screen_interface->onUpdate(dt); |
From: <sv...@ww...> - 2004-06-29 11:10:55
|
Author: delta Date: 2004-06-29 04:10:48 -0700 (Tue, 29 Jun 2004) New Revision: 1111 Modified: trunk/CSP/CSPSim/Source/Collision.cpp Log: min/max workaround. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1111 Modified: trunk/CSP/CSPSim/Source/Collision.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Collision.cpp 2004-06-29 11:10:02 UTC (rev 1110) +++ trunk/CSP/CSPSim/Source/Collision.cpp 2004-06-29 11:10:48 UTC (rev 1111) @@ -107,7 +107,7 @@ // normal spring force plus damping double normalForce = depth * m_SpringConstant + m_ImpactDamping * impactSpeed; // sanity check - normalForce = std::max(normalForce, 0.0); + normalForce = std::max<double>(normalForce, 0.0); forceBody += normalForce * normalGroundBody; // sliding frictional force simdata::Vector3 slidingVelocityBody = contactVelocityBody + impactSpeed * normalGroundBody; @@ -115,7 +115,7 @@ if (slidingSpeed > 0.0) { // in principle we should have both sliding and static friction coefficients, // but this is probably adequate for now. - double frictionLimit = std::max(0.1, m_Friction * normalForce); + double frictionLimit = std::max<double>(0.1, m_Friction * normalForce); // i'd like to do damped spring extension relative to a fixed point when not // sliding, but not sure if this will work with rk since dt doesn't accumulate // monotonic time. |
From: <sv...@ww...> - 2004-06-29 11:10:10
|
Author: delta Date: 2004-06-29 04:10:02 -0700 (Tue, 29 Jun 2004) New Revision: 1110 Modified: trunk/CSP/CSPSim/Source/ClientNode.cpp Log: Minor headers change. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1110 Modified: trunk/CSP/CSPSim/Source/ClientNode.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ClientNode.cpp 2004-06-29 11:08:02 UTC (rev 1109) +++ trunk/CSP/CSPSim/Source/ClientNode.cpp 2004-06-29 11:10:02 UTC (rev 1110) @@ -1,6 +1,6 @@ #include <SimNet/Networking.h> -#include <stdio.h> -#include <stdlib.h> +#include <cstdio> +#include <cstdlib> #include "Config.h" #include "Bus.h" @@ -114,7 +114,7 @@ ptrPayload->dump(); m_networkMessenger->queueMessage(m_remoteNode, message); - + m_networkMessenger->sendQueuedMessages(); m_networkMessenger->receiveMessages(); @@ -125,20 +125,20 @@ etime = simdata::tval(); while((etime = simdata::tval()) < 3.0 ) { simdata::tend(); - } + } } return 0; } void ClientNode::init() -{ +{ printf("Network test client starting up...\n"); printf("ClientNode::init()\n"); int level = g_Config.getInt("Debug", "LoggingLevel", 0, true); csplog().setLogCategory(CSP_ALL); csplog().setLogPriority(level); std::string logfile = g_Config.getString("Debug", "LogFile", "ClientNode.log", true); - csplog().setOutput(logfile); + csplog().setOutput(logfile); m_battlefield = new VirtualBattlefield(); m_battlefield->create(); |
From: <sv...@ww...> - 2004-06-29 11:08:19
|
Author: delta Date: 2004-06-29 04:08:02 -0700 (Tue, 29 Jun 2004) New Revision: 1109 Modified: trunk/CSP/CSPSim/Source/AircraftPhysicsModel.cpp Log: See CHANGES.current Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1109 Modified: trunk/CSP/CSPSim/Source/AircraftPhysicsModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/AircraftPhysicsModel.cpp 2004-06-29 10:55:08 UTC (rev 1108) +++ trunk/CSP/CSPSim/Source/AircraftPhysicsModel.cpp 2004-06-29 11:08:02 UTC (rev 1109) @@ -42,15 +42,14 @@ Vectord const &AircraftPhysicsModel::f(double x, Vectord &y) { // dot(p,v,w,q) = f(p,v,w,q) - // bind(y,p,v,w,q); - m_PositionLocal = b_Position->value() + bodyToLocal(simdata::Vector3(y[0],y[1],y[2])); - m_VelocityBody = simdata::Vector3(y[3],y[4],y[5]); - m_AngularVelocityBody = simdata::Vector3(y[6],y[7],y[8]); - m_Attitude = simdata::Quat(y[10],y[11],y[12],y[9]); + // bind(y,p,v,w,q) + YToBody(y); + m_Attitude.set(y[10],y[11],y[12],y[9]); double mag = m_Attitude.length(); if (mag != 0.0) { m_Attitude /= mag; } + m_PositionLocal = b_Position->value() + bodyToLocal(m_PositionBody); y[9] = m_Attitude.w(); y[10] = m_Attitude.x(); y[11] = m_Attitude.y(); y[12] = m_Attitude.z(); m_ForcesBody = m_MomentsBody = simdata::Vector3::ZERO; @@ -86,7 +85,8 @@ m_ForcesBody += m_WeightBody; // linear acceleration body: calculate v' = F/m - w^v - m_LinearAccelBody = m_ForcesBody / b_Mass->value() - (m_AngularVelocityBody^m_VelocityBody); + m_LinearAccelBody = m_ForcesBody / b_Mass->value() - (m_AngularVelocityBody ^ m_VelocityBody); + // angular acceleration body: calculate Iw' = M - w^Iw m_AngularAccelBody = b_InertiaInverse->value() * @@ -94,9 +94,9 @@ // quaternion derivative and w in body coordinates: q' = 0.5 * q * w simdata::Quat qprim = 0.5 * m_Attitude * m_AngularVelocityBody; - + // p' = v - m_dy[0] = y[3]; m_dy[1] = y[4]; m_dy[2] = y[5]; + m_dy[0] = y[3]; m_dy[1] = y[4]; m_dy[2] = y[5]; // v' m_dy[3] = m_LinearAccelBody.x(); m_dy[4] = m_LinearAccelBody.y(); m_dy[5] = m_LinearAccelBody.z(); // w' @@ -111,7 +111,7 @@ if (dt == 0.0) dt = 0.017; //unsigned short n = std::min<unsigned short>(6,static_cast<unsigned short>(180 * dt)) + 1; - unsigned short n = std::min<unsigned short>(11,static_cast<unsigned short>(850 * dt)) + 1; + unsigned short n = 15*std::min<unsigned short>(1,static_cast<unsigned short>(210*dt)) + 1; double dtlocal = dt/n; std::for_each(m_Dynamics.begin(),m_Dynamics.end(),InitializeSimulationStep(dtlocal)); @@ -140,7 +140,8 @@ for (unsigned short i = 0; i<n; ++i) { m_VelocityBody = localToBody(m_VelocityLocal); - m_AngularVelocityBody = localToBody(m_AngularVelocityLocal); + + m_AngularVelocityBody = localToBody(m_AngularVelocityLocal); Vectord y0 = bodyToY(simdata::Vector3::ZERO,m_VelocityBody,m_AngularVelocityBody,m_Attitude); @@ -152,7 +153,7 @@ Vectord y = flow(y0, 0.0, dtlocal); // update all variables - // Caution: dont permute these lines + // Caution: never permute the following lines // solution to body data members YToBody(y); @@ -171,11 +172,11 @@ std::for_each(m_Dynamics.begin(),m_Dynamics.end(),PostSimulationStep(dtlocal)); - // convert body to local coordinates + // convert position, linear velocity and angular velocity from body to local coordinates physicsBodyToLocal(); - // update attitude and force for a unit quaternion - m_Attitude = simdata::Quat(y[10],y[11],y[12],y[9]); + // update attitude and normalize the quaternion + m_Attitude.set(y[10],y[11],y[12],y[9]); double mag = m_Attitude.length(); if (mag != 0.0) m_Attitude /= mag; |
From: <sv...@ww...> - 2004-06-29 10:55:13
|
Author: delta Date: 2004-06-29 03:55:08 -0700 (Tue, 29 Jun 2004) New Revision: 1108 Added: trunk/CSP/CSPSim/Source/InputEvent.cpp Log: Addition. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1108 Added: trunk/CSP/CSPSim/Source/InputEvent.cpp =================================================================== --- trunk/CSP/CSPSim/Source/InputEvent.cpp 2004-06-29 10:54:12 UTC (rev 1107) +++ trunk/CSP/CSPSim/Source/InputEvent.cpp 2004-06-29 10:55:08 UTC (rev 1108) @@ -0,0 +1,109 @@ +// Combat Simulator Project - CSPSim +// Copyright (C) 2004 The Combat Simulator Project +// http://csp.sourceforge.net +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +/** + * @file InputEvent.cpp + * + * + */ + +#include <stdexcept> + +#include "CSPSim.h" +#include "InputEvent.h" +#include "SimpleConfig.h" + +extern SimpleConfig g_Config; + +const float Handle::m_Sampling = 1.0f/210; + +Handle::~Handle() { +} + +bool Play::operator()(SDL_Event& event) { + return SDL_PollEvent(&event) != 0; +} + +Save::Save(): + m_of(g_Config.getString("DemoMode","FileName","Record.csp",true).c_str(),std::ios_base::binary) { +} + +Save::~Save() { + m_of.close(); +} + +bool Save::operator()(SDL_Event& event) { + bool result = SDL_PollEvent(&event) != 0; + float d2 = CSPSim::theSim->getElapsedTime(); + if (d2 - m_EventTime > m_Sampling) { + m_EventTime = d2; + m_of.write(reinterpret_cast<char*>(&event),sizeof(SDL_Event)); + m_of.write(reinterpret_cast<char*>(&m_EventTime),sizeof(float)); + } + return result; +} + +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"); +} + +Replay::~Replay() { + m_if.close(); +} + +bool Replay::operator()(SDL_Event& event) { + SDL_Event e; + bool result = SDL_PollEvent(&e) !=0; + if (e.type != SDL_QUIT && (e.type != SDL_KEYDOWN || e.key.keysym.sym != SDLK_ESCAPE)) { + float d2 = CSPSim::theSim->getElapsedTime(); + if (d2 - m_EventTime > 2*m_Sampling) { + m_if.read(reinterpret_cast<char*>(&event),sizeof(SDL_Event)); + m_if.read(reinterpret_cast<char*>(&m_EventTime),sizeof(float)); + } + } + else + event = e; + return true; +} + +InputEvent::InputEvent() { + Mode mode = static_cast<Mode>(g_Config.getInt("DemoMode","Mode")); + try { + switch (mode) { + case PLAY: + m_Handle.reset(new Play); + break; + case RECORD: + m_Handle.reset(new Save); + break; + case REPLAY: + m_Handle.reset(new Replay); + break; + } + } + catch(const exception& e) { + std::cerr << "\nException caught in InputEvent::InputEvent(): " << e.what() << ".\n"; + std::cerr << "Using play handle.\n" << std::endl; + m_Handle.reset(new Play); + } +} + + |
From: <sv...@ww...> - 2004-06-29 10:54:18
|
Author: delta Date: 2004-06-29 03:54:12 -0700 (Tue, 29 Jun 2004) New Revision: 1107 Modified: trunk/CSP/CSPSim/Source/Systems/AircraftInputSystem.cpp Log: min/max workaround. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1107 Modified: trunk/CSP/CSPSim/Source/Systems/AircraftInputSystem.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Systems/AircraftInputSystem.cpp 2004-06-29 10:44:48 UTC (rev 1106) +++ trunk/CSP/CSPSim/Source/Systems/AircraftInputSystem.cpp 2004-06-29 10:54:12 UTC (rev 1107) @@ -23,7 +23,7 @@ **/ -#include <Systems/AircraftInputSystem.h> +#include "Systems/AircraftInputSystem.h" SIMDATA_REGISTER_INTERFACE(AircraftInputSystem) @@ -227,12 +227,12 @@ } void AircraftInputSystem::DecAirbrake() { - double v = std::max(0.0, m_AirbrakeInput.getValue() - 0.1); + double v = std::max<double>(0.0, m_AirbrakeInput.getValue() - 0.1); m_AirbrakeInput.setValue(v); } void AircraftInputSystem::IncAirbrake() { - double v = std::min(0.0, m_AirbrakeInput.getValue() + 0.1); + double v = std::min<double>(0.0, m_AirbrakeInput.getValue() + 0.1); m_AirbrakeInput.setValue(v); } |
From: <sv...@ww...> - 2004-06-29 10:44:53
|
Author: delta Date: 2004-06-29 03:44:48 -0700 (Tue, 29 Jun 2004) New Revision: 1106 Modified: trunk/CSP/CSPSim/Include/Projection.h Log: min/max workaround. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1106 Modified: trunk/CSP/CSPSim/Include/Projection.h =================================================================== --- trunk/CSP/CSPSim/Include/Projection.h 2004-06-29 10:42:45 UTC (rev 1105) +++ trunk/CSP/CSPSim/Include/Projection.h 2004-06-29 10:44:48 UTC (rev 1106) @@ -28,14 +28,13 @@ #ifndef __PROJECTION_H__ #define __PROJECTION_H__ - #include <SimData/Vector3.h> #include <SimData/Math.h> #include <SimData/GeoPos.h> #include <SimData/Interpolate.h> -#include <iostream> #include <cstdio> +#include <iostream> /** @@ -159,7 +158,7 @@ */ void _secantMap() { double R = 6371010.0; - double angle = 0.5 * std::max(m_SizeX, m_SizeY) / R; + double angle = 0.5 * std::max<double>(m_SizeX, m_SizeY) / R; double scale = 1.0 / cos(angle) / cos(angle); scale = 0.5 * (1.0 + scale) / scale; setRadius(R * scale); @@ -267,8 +266,8 @@ */ simdata::Vector3 getNorth(simdata::Vector3 const &pos) const { assert(m_Valid); - double x = std::min(m_SizeX, std::max(-m_SizeX, pos.x())); - double y = std::min(m_SizeY, std::max(-m_SizeY, pos.y())); + double x = simdata::clampTo(pos.x(),-m_SizeX,m_SizeX); + double y = simdata::clampTo(pos.y(),-m_SizeY, m_SizeY); return simdata::Vector3(m_NorthX.getValue(x, y), m_NorthY.getValue(x, y), 0.0); } |
From: <sv...@ww...> - 2004-06-29 10:42:53
|
Author: delta Date: 2004-06-29 03:42:45 -0700 (Tue, 29 Jun 2004) New Revision: 1105 Modified: trunk/CSP/CSPSim/Include/FlightModel.h Log: min/max workaround. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1105 Modified: trunk/CSP/CSPSim/Include/FlightModel.h =================================================================== --- trunk/CSP/CSPSim/Include/FlightModel.h 2004-06-29 10:41:44 UTC (rev 1104) +++ trunk/CSP/CSPSim/Include/FlightModel.h 2004-06-29 10:42:45 UTC (rev 1105) @@ -96,11 +96,11 @@ double airspeed, double qBar) { // prevent driving the model outside its range of validity - m_Alpha = std::max(-0.8, std::min(0.8, alpha)); + m_Alpha = simdata::clampTo(alpha,-0.8, 0.8); m_AlphaDot = alphaDot; m_Beta = beta; m_qBarS = m_HalfWingArea * qBar * airspeed * airspeed; - m_Inv2V = 0.5 / std::max(0.5, airspeed); + m_Inv2V = 0.5 / std::max<double>(0.5, airspeed); } inline void setControlSurfaces(double aileron, |
From: <sv...@ww...> - 2004-06-29 10:41:50
|
Author: delta Date: 2004-06-29 03:41:44 -0700 (Tue, 29 Jun 2004) New Revision: 1104 Added: trunk/CSP/CSPSim/Include/InputEvent.h Log: Addition. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1104 Added: trunk/CSP/CSPSim/Include/InputEvent.h =================================================================== --- trunk/CSP/CSPSim/Include/InputEvent.h 2004-06-29 10:40:02 UTC (rev 1103) +++ trunk/CSP/CSPSim/Include/InputEvent.h 2004-06-29 10:41:44 UTC (rev 1104) @@ -0,0 +1,78 @@ +// Combat Simulator Project - CSPSim +// Copyright (C) 2004 The Combat Simulator Project +// http://csp.sourceforge.net +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +/** + * @file InputEvent.h + * + * + */ + +#ifndef __INPUTEVENT_H__ +#define __INPUTEVENT_H__ + +#include <fstream> +#include <memory> + +#include <SDL/SDL_events.h> + +class Handle { +protected: + float m_EventTime; + static const float m_Sampling; +public: + Handle(): + m_EventTime(0.0f) { + } + virtual bool operator()(SDL_Event& event) = 0; + virtual ~Handle(); +}; + +class Play: public Handle { +public: + virtual bool operator()(SDL_Event& event); +}; + +class Save: public Handle { + std::ofstream m_of; +public: + Save(); + ~Save(); + virtual bool operator()(SDL_Event& event); +}; + +class Replay: public Handle { + std::ifstream m_if; +public: + Replay(); + ~Replay(); + virtual bool operator()(SDL_Event& event); +}; + +class InputEvent { + enum Mode {PLAY,REPLAY,RECORD}; + std::auto_ptr<Handle> m_Handle; +public: + InputEvent(); + bool operator()(SDL_Event& event) const { + return (*m_Handle)(event); + } +}; + +#endif + |
From: <sv...@ww...> - 2004-06-29 10:40:09
|
Author: delta Date: 2004-06-29 03:40:02 -0700 (Tue, 29 Jun 2004) New Revision: 1103 Modified: trunk/CSP/CSPSim/Include/BaseDynamics.h Log: Minor typo. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1103 Modified: trunk/CSP/CSPSim/Include/BaseDynamics.h =================================================================== --- trunk/CSP/CSPSim/Include/BaseDynamics.h 2004-06-29 10:38:45 UTC (rev 1102) +++ trunk/CSP/CSPSim/Include/BaseDynamics.h 2004-06-29 10:40:02 UTC (rev 1103) @@ -107,7 +107,7 @@ * parameter, and if you do be sure you really understand what * it means. Also, do not modify internal state variables of * the Dynamics class during the computeForceAndMoment() call. - * State changes should only occur instead in the preSimulationStep + * State changes should only occur instead in the preSimulationStep() * and postSimulationStep() methods. In particular, do not do * anything that results in discontinuous force or moment * variations that can prevent the RK solver from converging. |
From: <sv...@ww...> - 2004-06-29 10:38:54
|
Author: delta Date: 2004-06-29 03:38:45 -0700 (Tue, 29 Jun 2004) New Revision: 1102 Modified: trunk/CSP/CSPSim/Include/CSPSim.h Log: Added an InpuEvent attribute. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1102 Modified: trunk/CSP/CSPSim/Include/CSPSim.h =================================================================== --- trunk/CSP/CSPSim/Include/CSPSim.h 2004-06-29 10:37:05 UTC (rev 1101) +++ trunk/CSP/CSPSim/Include/CSPSim.h 2004-06-29 10:38:45 UTC (rev 1102) @@ -55,8 +55,10 @@ #include <SimData/DataManager.h> #include "Atmosphere.h" +#include "InputEvent.h" #include <osg/ref_ptr> + #include <SDL/SDL_joystick.h> #include <Producer/RenderSurface> @@ -83,7 +85,6 @@ void fillerup(void *unused, unsigned char *stream, int len); - /** * class CSPSim - The primary simulation engine for CSP. * @@ -206,6 +207,8 @@ bool b_networkingFlag; osg::ref_ptr<Producer::RenderSurface> m_RenderSurface; + + InputEvent m_InputEvent; }; #endif // __CSPSIM_H__ |
From: <sv...@ww...> - 2004-06-29 10:37:11
|
Author: delta Date: 2004-06-29 03:37:05 -0700 (Tue, 29 Jun 2004) New Revision: 1101 Modified: trunk/CSP/CSPSim/Include/Views/View.h Log: Added isInternal(). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1101 Modified: trunk/CSP/CSPSim/Include/Views/View.h =================================================================== --- trunk/CSP/CSPSim/Include/Views/View.h 2004-06-29 10:21:05 UTC (rev 1100) +++ trunk/CSP/CSPSim/Include/Views/View.h 2004-06-29 10:37:05 UTC (rev 1101) @@ -33,13 +33,13 @@ class CameraAgent; class CameraKinematics; +class DynamicObject; class SimObject; -class DynamicObject; class View { size_t m_ViewMode; protected: - bool m_InternalView; + bool m_Internal; simdata::Ref<DynamicObject> m_ActiveObject; CameraKinematics* m_CameraKinematics; void updateBody(simdata::Vector3& ep,simdata::Vector3& lp,simdata::Vector3& up); @@ -56,11 +56,12 @@ } void cull(); virtual ~View(); + bool isInternal() const {return m_Internal;} }; class InternalView: public View { public: - InternalView(size_t vm):View(vm){m_InternalView = true;} + InternalView(size_t vm):View(vm){m_Internal = true;} virtual void constrain(); virtual void update(simdata::Vector3& ep,simdata::Vector3& lp,simdata::Vector3& up, double dt); virtual void activate(); |