From: Hedayat V. <hed...@ai...> - 2010-02-19 14:42:31
|
Hi Andreas! On ۱۰/۰۲/۱۹ 09:27, ah...@un... wrote: > Hi, > > > As you see in my recent commit, all classes that implement ODE physics > objects are now in a separated plugin directory. > > The plan right now is to rename them from ODE(...) to (...)Imp. So, there > would be BoxColliderImp, RigidBodyImp, JointImp et.al. in the odeimps > directory. For other Physics engines, we'd have a bulletimps or physximps > directory that redifine those classes with their corresponding > engine-specific code. > The abstract physics classes will then retrieve an instance of their > corresponding implementation class from the scenegraph and upcast it to > (...)Int. By delegating calls to this instance, they will be able to work > with it without even knowing which engine is currently in use. > Well, there is no need to have these classes in the scenegraph. All you need is to register them with zeitgeist (as you've apparently done with the AngularMotorImp class), and then you should be able to retrieve new class instances in ruby or in C++ (e.g. using GetCore()->New("AngularMotorImp") in C++). But, as you mentioned before, you've planned to have a PhysicsServer class implementation for each engine which acts as a factory for other engine implementation classes. I prefer that approach too! Specially notice that the above case is still inflexible: consider that we have both Bullet and ODE classes, which one is going to be registered as AngularMotorImp? Another possibility is to register classes with prefixes, e.g. "ode/AngularMotorImp", which can be done as it is done in kerosin.cpp. And then, the prefix can be specified for the Oxygen's PhysicsServer class by a function call in spark.rb script. The factory class can also be created and specified in spark.rb script. For an example, you can have a look at the way the OpenGLSystem is sent to the OpenGLServer class in spark.rb. AFAIK, what you can expect to see in the scenegraph is the generic physics classes attached to the agent bodies, the soccer field, etc. Thanks for your great work, Hedayat > All I need to know now is how to make these Imp classes show up in the > scenegraph. Right now, I tried to do this with AngularMotorImp and did the > following: > > - derived AngularMotorImp from BaseNode > - put "DECLARE_CLASS(AngularMotorImp)" in odeangularmotor.h > - created odeangularmotor_c.cpp with CLASS(AngularMotorImp)::DefineClass() > - created an export.cpp file with ZEITGEIST_EXPORT(AngularMotorImp); > - put "importbundle(odeimps)" at the bottom of spark.rb > > According to rsgedit, AngularMotorImp is still not showing up in the > SceneGraph, so maybe someone can tell me what I forgot or even give me a > step-by-step guide on how to put these classes in the SceneGraph (and > later retrieve objects). > > > thanks, > > Andreas > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Simspark Generic Physical MAS Simulator > simspark-devel mailing list > sim...@li... > https://lists.sourceforge.net/lists/listinfo/simspark-devel > |