From: Oliver O. <fr...@us...> - 2007-03-15 07:26:33
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/spark Modified Files: spark-config.in spark.cpp spark.h spark.rb Added Files: spark.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) Index: spark.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** spark.cpp 8 Mar 2006 18:17:03 -0000 1.3 --- spark.cpp 15 Mar 2007 07:26:29 -0000 1.4 *************** *** 52,55 **** --- 52,60 ---- // reset shared ptr to objects in the zeitgeist hierarchy before // the zeitgeist core is shutdown + ResetCached(); + } + + void Spark::ResetCached() + { mLogServer.reset(); mScriptServer.reset(); *************** *** 58,69 **** } ! bool ! Spark::Init(int argc, char** argv) { mLogServer = mZeitgeist->GetCore()->GetLogServer(); if (mLogServer.get() == 0) { cerr << "(Spark) ERROR: LogServer not found\n"; ! return false; } --- 63,75 ---- } ! bool Spark::UpdateCached() { + bool ok = true; + mLogServer = mZeitgeist->GetCore()->GetLogServer(); if (mLogServer.get() == 0) { cerr << "(Spark) ERROR: LogServer not found\n"; ! ok = false; } *************** *** 72,86 **** { mLogServer->Error() << "(Spark) ERROR: ScriptServer not found\n"; ! return false; } - // run the spark init script - mZeitgeist->GetCore()->GetRoot()->GetScript()->RunInitScript - ( - "spark.rb", - "lib/spark", - ScriptServer::IS_COMMON - ); - mSceneServer = shared_dynamic_cast<SceneServer> (mZeitgeist->GetCore()->Get("/sys/server/scene")); --- 78,84 ---- { mLogServer->Error() << "(Spark) ERROR: ScriptServer not found\n"; ! ok = false; } mSceneServer = shared_dynamic_cast<SceneServer> (mZeitgeist->GetCore()->Get("/sys/server/scene")); *************** *** 89,93 **** { mLogServer->Error() << "(Spark) ERROR: SceneServer not found\n"; ! return false; } --- 87,91 ---- { mLogServer->Error() << "(Spark) ERROR: SceneServer not found\n"; ! ok = false; } *************** *** 98,109 **** { mLogServer->Error() << "(Spark) ERROR: SimulationServer not found\n"; ! return false; } // run the app defined init return InitApp(argc,argv); } ! bool Spark::InitApp(int /*argc*/, char** /*argv*/) { --- 96,123 ---- { mLogServer->Error() << "(Spark) ERROR: SimulationServer not found\n"; ! ok = false; } + return ok; + } + + bool + Spark::Init(int argc, char** argv) + { + // run the spark init script + mZeitgeist->GetCore()->GetScriptServer()->RunInitScript + ( + "spark.rb", + "lib/spark", + ScriptServer::IS_COMMON + ); + + UpdateCached(); + // run the app defined init return InitApp(argc,argv); } ! bool Spark::InitApp(int /*argc*/, char** /*argv*/) { *************** *** 111,115 **** } ! Zeitgeist& Spark::GetZeitgeist() { --- 125,129 ---- } ! Zeitgeist& Spark::GetZeitgeist() { *************** *** 117,121 **** } ! shared_ptr<Core> Spark::GetCore() { --- 131,135 ---- } ! shared_ptr<Core> Spark::GetCore() { *************** *** 123,127 **** } ! shared_ptr<zeitgeist::LogServer> Spark::GetLog() { --- 137,141 ---- } ! shared_ptr<zeitgeist::LogServer> Spark::GetLog() { *************** *** 129,133 **** } ! shared_ptr<SceneServer> Spark::GetSceneServer() { --- 143,147 ---- } ! shared_ptr<SceneServer> Spark::GetSceneServer() { *************** *** 135,139 **** } ! shared_ptr<SimulationServer> Spark::GetSimulationServer() { --- 149,153 ---- } ! shared_ptr<SimulationServer> Spark::GetSimulationServer() { *************** *** 142,146 **** #if HAVE_KEROSIN_H ! shared_ptr<InputControl> Spark::GetInputControl() { --- 156,160 ---- #if HAVE_KEROSIN_H ! shared_ptr<InputControl> Spark::GetInputControl() { *************** *** 154,158 **** } ! shared_ptr<InputServer> Spark::GetInputServer() { --- 168,172 ---- } ! shared_ptr<InputServer> Spark::GetInputServer() { *************** *** 161,165 **** } ! shared_ptr<RenderControl> Spark::GetRenderControl() { --- 175,179 ---- } ! shared_ptr<RenderControl> Spark::GetRenderControl() { *************** *** 174,178 **** #endif // HAVE_KEROSIN_H ! shared_ptr<ScriptServer> Spark::GetScriptServer() { --- 188,192 ---- #endif // HAVE_KEROSIN_H ! shared_ptr<ScriptServer> Spark::GetScriptServer() { *************** *** 180,184 **** } ! shared_ptr<Scene> Spark::GetActiveScene() { --- 194,198 ---- } ! shared_ptr<Scene> Spark::GetActiveScene() { *************** *** 187,191 **** if (scene.get() == 0) { ! mLogServer->Warning() << "(Spark) Warning: no active scene registered\n"; } --- 201,205 ---- if (scene.get() == 0) { ! mLogServer->Warning() << "(Spark) Warning: no active scene registered\n"; } Index: spark-config.in =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark-config.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** spark-config.in 25 Dec 2005 14:55:52 -0000 1.1 --- spark-config.in 15 Mar 2007 07:26:29 -0000 1.2 *************** *** 94,100 **** if test "$echo_libs" = "yes" ; then if test "@debug@" = "true"; then ! libs="-lspark_debug @SPARK_LIBADD@" else ! libs="-lspark @SPARK_LIBADD@" fi echo -L@libdir@/simspark $libs --- 94,100 ---- if test "$echo_libs" = "yes" ; then if test "@debug@" = "true"; then ! libs="-lspark_debug" else ! libs="-lspark" fi echo -L@libdir@/simspark $libs Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** spark.rb 15 Feb 2006 01:08:19 -0000 1.5 --- spark.rb 15 Mar 2007 07:26:29 -0000 1.6 *************** *** 41,47 **** --- 41,73 ---- $monitorType = 'tcp' + # (Global Physics / World) constants + # + $physicsGlobalCFM = 0.001 + $physicsGlobalGravity = -9.81 + # # below is a set of utility functions for the user app # + + # rebuild scene and update all cached references + def sparkResetScene + scene = get($scenePath) + scene.unlinkChildren() + + # (re-)create world and space aspects + world = new('oxygen/World', $scenePath+'world') + world.setGravity(0.0, 0.0, $physicsGlobalGravity) + world.setCFM($physicsGlobalCFM) + new('oxygen/Space', $scenePath+'space') + + # invalidate all cached references + scriptServer = get($serverPath+'script') + scriptServer.updateCachedAllNodes() + + # force update references to scene objects (world, space etc.) + sceneServer = get($serverPath+'scene') + sceneServer.setActiveScene($scenePath) + end + def sparkSetupMonitor print "(spark.rb) sparkSetupMonitor\n" *************** *** 224,227 **** --- 250,254 ---- fpsController = new('oxygen/FPSController',path+'/physics/controller') fpsController.setAcceleration(accel) + fpsController.setVAngle(30.0) inputControl = get($serverPath+'simulation/InputControl') inputControl.setFPSController(path+'/physics/controller') *************** *** 284,288 **** # logs all output to 'fileName' ! def sparkLogAllToFile(filenName) sparkEnableLog(fileName, 'eAll') end --- 311,315 ---- # logs all output to 'fileName' ! def sparkLogAllToFile(fileName) sparkEnableLog(fileName, 'eAll') end *************** *** 323,330 **** sceneServer.initSceneImporter("RosImporter"); ! # create world and space aspects ! world = new('oxygen/World', $scenePath+'world') ! world.setGravity(0.0, 0.0, -9.81) ! new('oxygen/Space', $scenePath+'space') # --- 350,355 ---- sceneServer.initSceneImporter("RosImporter"); ! # prepare scene ! sparkResetScene() # Index: spark.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** spark.h 8 Mar 2006 18:17:03 -0000 1.3 --- spark.h 15 Mar 2007 07:26:29 -0000 1.4 *************** *** 72,75 **** --- 72,81 ---- bool Init(int argc, char** argv); + /** resets all cached object references */ + void ResetCached(); + + /** updated all cached object references */ + bool UpdateCached(); + // // user callbacks --- NEW FILE: spark.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="spark" ProjectGUID="{87C2BFBA-8299-432F-B2E6-08E650E74230}" RootNamespace="spark" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\win32;..\;sceneserver/helper;..\utility" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\win32;..\;sceneserver/helper;..\utility" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <File RelativePath=".\spark.cpp" > </File> <File RelativePath=".\spark.h" > </File> </Files> <Globals> </Globals> </VisualStudioProject> |