From: <ah...@un...> - 2010-02-22 07:20:04
|
Hi, I am now one step closer to having the ODE classes as a plugin. I use the PhysicsServer for testing for now, because this is a class that is actually used, as opposed to the AngularMotor, and thus obviously more suited for testing. PhysicsServerImp now shows up in the scenegraph; the key was to build odeimps not as a library, but as a module (which is the desired method anyway, as building it as a library was merely a workaround). I changed spark.rb a bit so that it imports the odeimps bundle at the very beginning. The relevant part now looks like this: ----- begin excerpt from spark.rb ----- # # setup spark # print "(spark.rb) setup\n" #import the implementations of the desired physics engine #currently supported: odeimps (uses Open Dynamics Engine) importBundle "odeimps" print "(spark.rb) using ODE, to change the physics engine go to line 559 in spark.rb\n" # # set up logging logServer = get($serverPath+'log') if (logServer != nil) logServer.addStream(':cerr', 'eError') end # # setup the PhysicsServer sparkGetPhysicsServer() ----- end excerpt from spark.rb ----- Here's a screenshot of rsgedit which proves that the odeimps bundle gets imported correctly, and also showcases that the PhysicsServerImp shows up at "/classes/PhysicsServerImp": http://www.uni-koblenz.de/~aheld/rsgeditscreen.png Since I can now be 100% sure that PhysicsServerImp is now registered at /classes/PhysicsServerImp _before_ the PhysicsServer is set up [as importbundle"odeimps" is called prior to sparkGetPhysicsServer()], I can now instanciate mPhysicsServerImp in the PhysicsServer's OnLink method like this: void PhysicsServer::OnLink(){ mPhysicsServerImp = shared_dynamic_cast<PhysicsServerInt> (GetCore()->New("/classes/PhysicsServerImp")); } This leads to the following console output: ----- begin inexplicable console output ---- (ScriptServer) Script ended OK /home/andreas/.simspark/kerosin.rb (ScriptServer) Running /usr/local/share/simspark//spark.rb... (spark.rb) setup (spark.rb) using ODE, to change the physics engine go to line 558 in spark.rb (Core::New) unkown class '/classes/PhysicsServerImp' (GeometryServer) MeshImporter 'oxygen/StdMeshImporter' registered ----- end inexplicable console output ----- As even a trained monkey could see, the odeimps bundle is imported, and thus PhysicsServerImp registered at /classes/PhysicsServerImp immediately before Zeitgeist complains that PhysicsServerImp is not registered at /classes/PhysicsServerImp. The RSGEdit screenshot proves that PhysicsServerImp is registered at /classes/PhysicsServerImp. Soemhow the PhysicsServer is set up before PhysicsServerImp is registered even though spark.rb registers PhysicsServerImp before the PhysicsServer is set up. This is a time paradoxon. Maybe I'm using a quantum computer without knowing it? Any ideas would be appreciated. thanks, Andreas |