From: Oliver O. <fr...@us...> - 2007-06-22 14:10:00
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6379 Modified Files: Tag: projectx spark.rb Log Message: - some updates from rcssserver3D - some changes for new visualisation (conditional) Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.5.2.4.2.1 retrieving revision 1.5.2.4.2.2 diff -C2 -d -r1.5.2.4.2.1 -r1.5.2.4.2.2 *** spark.rb 5 Apr 2007 03:53:58 -0000 1.5.2.4.2.1 --- spark.rb 22 Jun 2007 14:09:57 -0000 1.5.2.4.2.2 *************** *** 10,27 **** # ! # the default InputSystem used to read keyboard, mouse and timer input ! $defaultInputSystem = 'InputSystemSDL' ! # the name of the default bundle that contains the default InputSystem ! $defaultInputSystemBundle = 'inputsdl' ! # (OpenGL rendering) ! # ! # the default OpenGLSystem used for rendering ! $defaultOpenGLSystem = 'OpenGLSystemSDL' - # the name of the bundle that contains the default OpenGLSystem - $defaultOpenGLBundle = 'openglsyssdl' # (MonitorControl) constants --- 10,42 ---- # ! rendering = 'SDL' ! #rendering = 'OGRE' ! ! if ( rendering == 'SDL' ) ! # the default InputSystem used to read keyboard, mouse and timer input ! $defaultInputSystem = 'InputSystemSDL' ! # the name of the default bundle that contains the default InputSystem ! $defaultInputSystemBundle = 'inputsdl' ! # (OpenGL rendering) ! # the default OpenGLSystem used for rendering ! $defaultOpenGLSystem = 'OpenGLSystemSDL' ! # the name of the bundle that contains the default OpenGLSystem ! $defaultOpenGLBundle = 'openglsyssdl' ! else ! # the default InputSystem used to read keyboard, mouse and timer input ! $defaultInputSystem = 'InputSystemOIS' ! # the name of the default bundle that contains the default InputSystem ! $defaultInputSystemBundle = 'inputois' ! # (OpenGL rendering) ! # the default OpenGLSystem used for rendering ! $defaultOpenGLSystem = 'OpenGLSystemOGRE' ! # the name of the bundle that contains the default OpenGLSystem ! $defaultOpenGLBundle = 'openglsysogre' ! ! end # (MonitorControl) constants *************** *** 59,62 **** --- 74,80 ---- world.setGravity(0.0, 0.0, $physicsGlobalGravity) world.setCFM($physicsGlobalCFM) + world.setAutoDisableFlag(true) + world.setContactSurfaceLayer(0.001) + new('oxygen/Space', $scenePath+'space') *************** *** 68,71 **** --- 86,93 ---- sceneServer = get($serverPath+'scene') sceneServer.setActiveScene($scenePath) + + # reset simulation time + simulationServer = get($serverPath+'simulation'); + simulationServer.resetTime() end *************** *** 75,79 **** # add the agent control node simulationServer = get($serverPath+'simulation'); ! monitorClient = new('SparkMonitorClient', $serverPath+'simulation/SparkMonitorClient') --- 97,101 ---- # add the agent control node simulationServer = get($serverPath+'simulation'); ! simulationServer.setMultiThreads(false); monitorClient = new('SparkMonitorClient', $serverPath+'simulation/SparkMonitorClient') *************** *** 96,99 **** --- 118,136 ---- end + def sparkSetupMonitorLogPlayer + print "(spark.rb) sparkSetupMonitorLogPlayer\n" + + # add the agent control node + simulationServer = get($serverPath+'simulation'); + simulationServer.setMultiThreads(false); + monitorClient = new('SparkMonitorLogFileServer', + $serverPath+'simulation/SparkMonitorLogFileServer') + monitorClient.setFileName($logPlayerFile) + monitorClient.setStepDelay(33000) + + rubySceneImporter = get($serverPath+'scene/RubySceneImporter') + rubySceneImporter.setUnlinkOnCompleteScenes(true); + end + # # install a class below the SparkMonitorClient that implementes the *************** *** 137,142 **** --- 174,196 ---- # add the agent control node simulationServer = get($serverPath+'simulation'); + simulationServer.setMultiThreads(false); simulationServer.initControlNode('oxygen/AgentControl','AgentControl') + # set port and socket type for agent control + agentControl = get($serverPath+'simulation/AgentControl'); + agentControl.setServerPort($agentPort) + agentControl.setStep($agentStep) + + if ($agentType == 'udp') + agentControl.setServerTypeUDP() + else if ($agentType == 'tcp') + agentControl.setServerTypeTCP() + else + print "(spark.rb) unknown agent socket type " + print $agentType + print "\n" + end + end + monitorControl = new('oxygen/MonitorControl', $serverPath+'simulation/MonitorControl') *************** *** 154,157 **** --- 208,221 ---- end end + + # + # log recording setup + + if ($recordLogfile == true) + print "(spark.rb) recording Logfile as 'sparkmonitor.log'\n" + monitorLogger = new('oxygen/MonitorLogger', + $serverPath+'simulation/MonitorLogger') + monitorLogger.setMonitorLoggerInterval($monitorInterval) + end end *************** *** 161,168 **** # - # setup the GeometryServer - geometryServer = new('oxygen/GeometryServer', $serverPath+'geometry') - - # # setup the kerosin render framework --- 225,228 ---- *************** *** 172,182 **** importBundle($defaultOpenGLBundle) end - openGLServer.init(openGLSystem) ! ! new('kerosin/RenderServer', $serverPath+'render'); new('kerosin/ImageServer', $serverPath+'image'); new('kerosin/TextureServer', $serverPath+'texture'); - # # setup the InputServer --- 232,249 ---- importBundle($defaultOpenGLBundle) end openGLServer.init(openGLSystem) ! ! if (openGLSystem == 'OpenGLSystemOGRE') ! # register ogremeshexporter ! geometryServer.initMeshExporter('OgreMeshExporter') ! materialServer = get($serverPath+'material') ! materialServer.initMaterialExporter("OgreMaterialExporter"); ! new('OgreRenderServer', $serverPath+'render'); ! else ! new('kerosin/RenderServer', $serverPath+'render'); ! end ! new('kerosin/ImageServer', $serverPath+'image'); new('kerosin/TextureServer', $serverPath+'texture'); # # setup the InputServer *************** *** 225,229 **** x = 0.0, y = 0.0, z = 4, maxSpeed = 15.0, ! accel = 40.0, drag = 4, addCollider = false, --- 292,296 ---- x = 0.0, y = 0.0, z = 4, maxSpeed = 15.0, ! accel = 20.0, drag = 4, addCollider = false, *************** *** 340,345 **** # # setup the GeometryServer ! # geometryServer = new('oxygen/GeometryServer', $serverPath+'geometry') ! # use the ruby scene importer to import scenes importBundle 'rubysceneimporter' --- 407,416 ---- # # setup the GeometryServer ! geometryServer = new('oxygen/GeometryServer', $serverPath+'geometry') ! importBundle 'voidmeshimporter' ! geometryServer.initMeshImporter('VoidMeshImporter'); ! importBundle 'objimporter' ! geometryServer.initMeshImporter('ObjImporter'); ! # use the ruby scene importer to import scenes importBundle 'rubysceneimporter' *************** *** 384,396 **** # import the spark perceptors and effector set importBundle "sparkagent" - - - - - - - - - - - --- 455,456 ---- |