You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(153) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(46) |
Mar
(12) |
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(263) |
Mar
(235) |
Apr
(66) |
May
(42) |
Jun
(270) |
Jul
(65) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus R. <rol...@us...> - 2007-05-17 17:41:49
|
Update of /cvsroot/simspark/simspark/spark/utility/sfsexp In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13660 Modified Files: sexp.c Log Message: (merged from RSGEDIT_FILEREF) - properly init 'line' counter when creating an sexp_t struct Index: sexp.c =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/sfsexp/sexp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sexp.c 15 Mar 2007 07:26:30 -0000 1.2 --- sexp.c 17 May 2007 17:41:45 -0000 1.3 *************** *** 96,99 **** --- 96,100 ---- fakehead->next = NULL; /* this is the important part of fakehead */ fakehead->aty = sx->aty; + fakehead->line = 0; if (fakehead->ty == SEXP_VALUE) { *************** *** 496,499 **** --- 497,502 ---- sx->list = sx->next = NULL; + sx->line = 0; + return sx; } |
From: Markus R. <rol...@us...> - 2007-05-17 17:40:09
|
Update of /cvsroot/simspark/simspark/spark/utility/sfsexp In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12847 Modified Files: sexp_ops.c Log Message: (merged from RSGEDIT_FILEREF branch) - take care of 'line' member when copying sexp_t structs Index: sexp_ops.c =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/sfsexp/sexp_ops.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sexp_ops.c 19 Dec 2005 19:13:30 -0000 1.1 --- sexp_ops.c 17 May 2007 17:40:04 -0000 1.2 *************** *** 146,150 **** snew->list = copy_sexp(s->list); } ! snew->next = copy_sexp(s->next); --- 146,151 ---- snew->list = copy_sexp(s->list); } ! ! snew->line = s->line; snew->next = copy_sexp(s->next); *************** *** 257,260 **** --- 258,262 ---- cd->next = NULL; cd->list = copy_sexp(s->list->next); + cd->line = s->line; return cd; } |
From: Markus R. <rol...@us...> - 2007-05-17 17:38:25
|
Update of /cvsroot/simspark/simspark/spark/utility/sfsexp In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12419 Modified Files: sexp.h Log Message: (merged from RSGEDIT_FILEREF branch) - added 'line' member to sexp_t struct that augments a parsed s-expression with the line number of the source file it was read from - added 'line' member to the parsr continuation struct that counts the number of new lines read so far. This is used to calculate the line number in the parser Index: sexp.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/sfsexp/sexp.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sexp.h 19 Dec 2005 19:13:30 -0000 1.1 --- sexp.h 17 May 2007 17:38:21 -0000 1.2 *************** *** 291,294 **** --- 291,299 ---- */ unsigned int binlength; + + /** + * The line number of the element start + */ + unsigned int line; } sexp_t; *************** *** 462,465 **** --- 467,475 ---- */ char *bindata; + + /** + * The current line number, i.e. the number of \n seen + */ + unsigned int line; } pcont_t; |
From: Oliver O. <fr...@us...> - 2007-05-10 10:44:59
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25466 Modified Files: Tag: projectx staticmesh_c.cpp Log Message: - added methods to set/get flags if a mesh based object should cast shadows. This can be used by the graphics engine to disable/enable shadows for specific objects. The default value is "enabled" for all mesh based objects. Index: staticmesh_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/staticmesh_c.cpp,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** staticmesh_c.cpp 5 Dec 2005 21:38:23 -0000 1.1 --- staticmesh_c.cpp 10 May 2007 10:44:49 -0000 1.1.4.1 *************** *** 65,68 **** --- 65,84 ---- } + FUNCTION(StaticMesh,setCastShadows) + { + bool shadows; + + if ( + (in.GetSize() == 0) || + (! in.GetValue(in[0], shadows)) + ) + { + return false; + } + + obj->SetCastShadows(shadows); + return true; + } + void CLASS(StaticMesh)::DefineClass() { *************** *** 70,72 **** --- 86,89 ---- DEFINE_FUNCTION(load); DEFINE_FUNCTION(setScale); + DEFINE_FUNCTION(setCastShadows) } |
From: Oliver O. <fr...@us...> - 2007-05-10 10:44:29
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25407 Modified Files: Tag: projectx staticmesh.cpp Log Message: - added methods to set/get flags if a mesh based object should cast shadows. This can be used by the graphics engine to disable/enable shadows for specific objects. The default value is "enabled" for all mesh based objects. Index: staticmesh.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/staticmesh.cpp,v retrieving revision 1.2.2.3.2.1 retrieving revision 1.2.2.3.2.2 diff -C2 -d -r1.2.2.3.2.1 -r1.2.2.3.2.2 *** staticmesh.cpp 8 May 2007 03:35:14 -0000 1.2.2.3.2.1 --- staticmesh.cpp 10 May 2007 10:44:25 -0000 1.2.2.3.2.2 *************** *** 33,37 **** using namespace oxygen; ! StaticMesh::StaticMesh() : mScale(1.0f,1.0f,1.0f) { } --- 33,37 ---- using namespace oxygen; ! StaticMesh::StaticMesh() : mScale(1.0f,1.0f,1.0f), mCastShadows(true) { } *************** *** 235,236 **** --- 235,248 ---- return mMaterials; } + + bool + StaticMesh::CastShadows() const + { + return mCastShadows; + } + + void + StaticMesh::SetCastShadows(bool shadows) + { + mCastShadows = shadows; + } |
From: Oliver O. <fr...@us...> - 2007-05-10 10:43:52
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24925 Modified Files: Tag: projectx staticmesh.h Log Message: - added methods to set/get flags if a mesh based object should cast shadows. This can be used by the graphics engine to disable/enable shadows for specific objects. The default value is "enabled" for all mesh based objects. Index: staticmesh.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/staticmesh.h,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** staticmesh.h 8 May 2007 03:34:25 -0000 1.1.4.1 --- staticmesh.h 10 May 2007 10:43:48 -0000 1.1.4.2 *************** *** 85,88 **** --- 85,100 ---- /** returns the materials used to render the mesh */ const TMaterialList& GetMaterials() const; + + /** a hint for the graphics engine if the mesh casts shadows or now. + By default, StaticMeshes cast shadows. The respective graphics engine + might ignore this flag if the GE cannot cast shadows. + */ + bool CastShadows() const; + + /** set the flag if the mesh should cast shadows or not. + The actual graphics engine might ignore this flag if it cannot render + shadows or disables shadows globally. + */ + void SetCastShadows(bool shadows); // // Members *************** *** 103,106 **** --- 115,121 ---- /** the list of parameters the mesh was loaded with */ zeitgeist::ParameterList mMeshParameter; + + //! the flag if the mesh should cast shadows + bool mCastShadows; }; |
From: Oliver O. <fr...@us...> - 2007-05-08 03:45:03
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30604 Modified Files: Tag: projectx ChangeLog Log Message: *** empty log message *** Index: ChangeLog =================================================================== RCS file: /cvsroot/simspark/simspark/spark/ChangeLog,v retrieving revision 1.1.2.2.2.3 retrieving revision 1.1.2.2.2.4 diff -C2 -d -r1.1.2.2.2.3 -r1.1.2.2.2.4 *** ChangeLog 30 Mar 2007 04:25:41 -0000 1.1.2.2.2.3 --- ChangeLog 8 May 2007 03:44:59 -0000 1.1.2.2.2.4 *************** *** 1,2 **** --- 1,67 ---- + 2007-05-08 Oliver Obst <fr...@us...> + + * kerosin/Makefile.am: + * kerosin/kerosin.h: + * kerosin/kerosin.cpp: + - added MaterialExporter + + * kerosin/sceneserver/staticmesh.cpp: + * kerosin/sceneserver/staticmesh.h: + - added a method that returns the list of materials used + + * kerosin/materialserver/materialserver_c.cpp: + * kerosin/materialserver/materialserver.cpp: + * kerosin/materialserver/materialserver.h: + - Added facilities to export registered materials. + - the (protected) method ExportMaterial(material) exports one + material via all registered exporters + - exporters can be created and registered via + InitMaterialExporter(name) + - ExportAllMaterial() exports all materials (when it's called). + Materials can't just be exported automatically, as one + possible method to register materials is to just put them in + the tree below the MaterialServer. So ExportAllMaterial has to + be called manually after Materials have been installed (can + also be called from Ruby). + + * kerosin/materialserver/materialexporter.h: + * kerosin/materialserver/materialexporter_c.cpp: + - added abstract MaterialExporter. This class can be used to + customise the material server, which needs to be informed about + the materials used for a specific simulation. By registering a + MaterialExporter implementation to the MaterialServer, materials + can be registered (exported) to another class. + + * oxygen/sceneserver/camera.cpp: + * oxygen/sceneserver/camera.h: + * oxygen/sceneserver/camera_c.cpp: + - added LookAt() method (making the camera looking at a point) + - added lookAt() ruby fkt + - cosmetic changes + + * zeitgeist/leaf.h, zeitgeist/leaf.cpp, + zeitgeist/node.h, zeitgeist/node.cpp: + Added some of the changes from the rsgedit_fileref branch (Markus Rollmann): + - added member GetNumberOfChildren() to node that returns the + total number of children + - modified SetParent() to care for a uniqe name among sibling + nodes. If another sibling with the same name exists the current + number of children is appended to the node name. If mporter + classes create nodes in a stable order this also assures + consistent node names through simulation restarts + + 2007-04-05 Oliver Obst <fr...@us...> + + * oxygen/Makefile.am, oxygen/oxygen.cpp, oxygen/oxygen.h, + oxygen/geometryserver/geometryserver_c.cpp, + oxygen/geometryserver/geometryserver.cpp, + oxygen/geometryserver/geometryserver.h: + - added support for meshexporter + + * oxygen/geometryserver/meshexporter_c.cpp: added abstract meshexporter + * oxygen/geometryserver/meshexporter.h: added abstract meshexporter + * spark/spark.rb: removed second GeometryServer + + 2007-03-30 Oliver Obst <fr...@us...> |
From: Oliver O. <fr...@us...> - 2007-05-08 03:44:51
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30590 Modified Files: Tag: projectx Makefile.am Log Message: EXTRA_DIST should contain sparkconfig.h (instead of config.h) Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/Makefile.am,v retrieving revision 1.1.2.2.2.1 retrieving revision 1.1.2.2.2.2 diff -C2 -d -r1.1.2.2.2.1 -r1.1.2.2.2.2 *** Makefile.am 30 Mar 2007 01:39:49 -0000 1.1.2.2.2.1 --- Makefile.am 8 May 2007 03:44:36 -0000 1.1.2.2.2.2 *************** *** 8,12 **** DISTCLEANFILES = $(top_srcdir)/macosX/SDLMain.o $(top_srcdir)/macosX/libSDLmain.a EXTRA_DIST = macosX/SDLMain.h macosX/SDLMain.m \ ! win32/config.h win32/simspark.iss win32/spark.ico EXTRA_SRC_DISTS = --- 8,12 ---- DISTCLEANFILES = $(top_srcdir)/macosX/SDLMain.o $(top_srcdir)/macosX/libSDLmain.a EXTRA_DIST = macosX/SDLMain.h macosX/SDLMain.m \ ! win32/sparkconfig.h win32/simspark.iss win32/spark.ico EXTRA_SRC_DISTS = |
From: Oliver O. <fr...@us...> - 2007-05-08 03:39:16
|
Update of /cvsroot/simspark/simspark/spark/kerosin In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28585 Modified Files: Tag: projectx Makefile.am Log Message: added MaterialExporter Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/Makefile.am,v retrieving revision 1.6.2.2.2.1 retrieving revision 1.6.2.2.2.2 diff -C2 -d -r1.6.2.2.2.1 -r1.6.2.2.2.2 *** Makefile.am 30 Mar 2007 01:42:27 -0000 1.6.2.2.2.1 --- Makefile.am 8 May 2007 03:39:08 -0000 1.6.2.2.2.2 *************** *** 72,75 **** --- 72,76 ---- materialserver/materialserver.cpp \ materialserver/materialserver_c.cpp \ + materialserver/materialexporter_c.cpp \ sceneserver/axis.cpp \ sceneserver/axis_c.cpp \ *************** *** 131,134 **** --- 132,136 ---- materialserver/material2dtexture.h \ materialserver/materialsolid.h \ + materialserver/materialexporter.h \ sceneserver/singlematnode.h \ sceneserver/light.h \ |
From: Oliver O. <fr...@us...> - 2007-05-08 03:37:41
|
Update of /cvsroot/simspark/simspark/spark/kerosin In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27846 Modified Files: Tag: projectx kerosin.h Log Message: register MaterialExporter Index: kerosin.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/kerosin.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.2.1 *** kerosin.h 10 Feb 2007 16:15:38 -0000 1.1.2.1 --- kerosin.h 8 May 2007 03:37:38 -0000 1.1.2.1.2.1 *************** *** 54,57 **** --- 54,58 ---- #include "materialserver/material2dtexture.h" #include "materialserver/materialsolid.h" + #include "materialserver/materialexporter.h" // scene graph |
From: Oliver O. <fr...@us...> - 2007-05-08 03:37:16
|
Update of /cvsroot/simspark/simspark/spark/kerosin In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27808 Modified Files: Tag: projectx kerosin.cpp Log Message: register MaterialExporter Index: kerosin.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/kerosin.cpp,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -C2 -d -r1.1.2.1.2.1 -r1.1.2.1.2.2 *** kerosin.cpp 30 Mar 2007 01:43:50 -0000 1.1.2.1.2.1 --- kerosin.cpp 8 May 2007 03:37:13 -0000 1.1.2.1.2.2 *************** *** 52,55 **** --- 52,56 ---- zg.GetCore()->RegisterClassObject(new CLASS(Material2DTexture), "kerosin/"); zg.GetCore()->RegisterClassObject(new CLASS(MaterialSolid), "kerosin/"); + zg.GetCore()->RegisterClassObject(new CLASS(MaterialExporter), "kerosin/"); // scene graph |
From: Oliver O. <fr...@us...> - 2007-05-08 03:35:17
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27051 Modified Files: Tag: projectx staticmesh.cpp Log Message: - added a method that returns the list of materials used Index: staticmesh.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/staticmesh.cpp,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.3.2.1 diff -C2 -d -r1.2.2.3 -r1.2.2.3.2.1 *** staticmesh.cpp 23 Feb 2007 19:21:10 -0000 1.2.2.3 --- staticmesh.cpp 8 May 2007 03:35:14 -0000 1.2.2.3.2.1 *************** *** 228,229 **** --- 228,236 ---- } + + /** returns the materials used to render the mesh */ + const StaticMesh::TMaterialList& + StaticMesh::GetMaterials() const + { + return mMaterials; + } |
From: Oliver O. <fr...@us...> - 2007-05-08 03:34:39
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26661 Modified Files: Tag: projectx staticmesh.h Log Message: - added a method that returns the list of materials used Index: staticmesh.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/staticmesh.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** staticmesh.h 5 Dec 2005 21:38:23 -0000 1.1 --- staticmesh.h 8 May 2007 03:34:25 -0000 1.1.4.1 *************** *** 42,46 **** public: typedef std::vector<oxygen::IndexBuffer> TIndexBuffers; ! // // Function --- 42,46 ---- public: typedef std::vector<oxygen::IndexBuffer> TIndexBuffers; ! typedef std::vector<boost::shared_ptr<Material> > TMaterialList; // // Function *************** *** 83,86 **** --- 83,88 ---- const zeitgeist::ParameterList& GetMeshParameter(); + /** returns the materials used to render the mesh */ + const TMaterialList& GetMaterials() const; // // Members *************** *** 94,98 **** /** the materials used to render the mesh */ ! std::vector<boost::shared_ptr<Material> > mMaterials; /** the name of the loaded mesh */ --- 96,100 ---- /** the materials used to render the mesh */ ! TMaterialList mMaterials; /** the name of the loaded mesh */ |
From: Oliver O. <fr...@us...> - 2007-05-08 03:27:22
|
Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23932 Modified Files: Tag: projectx materialserver_c.cpp Log Message: - Added facilities to export registered materials. - the (protected) method ExportMaterial(material) exports one material via all registered exporters - exporters can be created and registered via InitMaterialExporter(name) - ExportAllMaterial() exports all materials (when it's called). Materials can't just be exported automatically, as one possible method to register materials is to just put them in the tree below the MaterialServer. So ExportAllMaterial has to be called manually after Materials have been installed (can also be called from Ruby). Index: materialserver_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/materialserver/materialserver_c.cpp,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** materialserver_c.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- materialserver_c.cpp 8 May 2007 03:27:18 -0000 1.1.4.1 *************** *** 25,32 **** using namespace boost; using namespace kerosin; ! using namespace zeitgeist; ! void CLASS(MaterialServer)::DefineClass() { ! DEFINE_BASECLASS(zeitgeist/Node); } --- 25,63 ---- using namespace boost; using namespace kerosin; ! using namespace std; ! FUNCTION(MaterialServer,initMaterialExporter) { ! string inExporterName; ! ! if ( ! (in.GetSize() != 1) || ! (! in.GetValue(in.begin(),inExporterName)) ! ) ! { ! return false; ! } ! ! return obj->InitMaterialExporter(inExporterName); ! } ! ! FUNCTION(MaterialServer,exportAllMaterial) ! { ! if ( ! (in.GetSize() != 0) ! ) ! { ! return false; ! } ! ! obj->ExportAllMaterial(); ! return true; ! } ! ! void ! CLASS(MaterialServer)::DefineClass() ! { ! DEFINE_BASECLASS(zeitgeist/Node); ! DEFINE_FUNCTION(initMaterialExporter); ! DEFINE_FUNCTION(exportAllMaterial); } |
From: Oliver O. <fr...@us...> - 2007-05-08 03:26:51
|
Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23557 Modified Files: Tag: projectx materialserver.cpp Log Message: - Added facilities to export registered materials. - the (protected) method ExportMaterial(material) exports one material via all registered exporters - exporters can be created and registered via InitMaterialExporter(name) - ExportAllMaterial() exports all materials (when it's called). Materials can't just be exported automatically, as one possible method to register materials is to just put them in the tree below the MaterialServer. So ExportAllMaterial has to be called manually after Materials have been installed (can also be called from Ruby). Index: materialserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/materialserver/materialserver.cpp,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** materialserver.cpp 19 Feb 2006 11:10:11 -0000 1.2 --- materialserver.cpp 8 May 2007 03:26:48 -0000 1.2.4.1 *************** *** 25,28 **** --- 25,29 ---- #include "material.h" #include "materialsolid.h" + #include "materialexporter.h" using namespace boost; *************** *** 38,47 **** } ! void MaterialServer::RegisterMaterial(shared_ptr<Material> material) { if (material.get() == 0) ! { ! return; ! } // remove any previous material with the same name --- 39,49 ---- } ! void ! MaterialServer::RegisterMaterial(shared_ptr<Material> material) { if (material.get() == 0) ! { ! return; ! } // remove any previous material with the same name *************** *** 50,58 **** if (previous.get() != 0) ! { ! GetLog()->Debug() << "(MaterialServer) removing material " ! << material->GetName() << "\n"; ! RemoveChildReference(previous); ! } // register new material --- 52,60 ---- if (previous.get() != 0) ! { ! GetLog()->Debug() << "(MaterialServer) removing material " ! << material->GetName() << "\n"; ! RemoveChildReference(previous); ! } // register new material *************** *** 61,67 **** GetLog()->Debug() << "(MaterialServer) registered material " << material->GetName() << "\n"; } ! shared_ptr<Material> MaterialServer::GetMaterial(const std::string& name) { shared_ptr<Material> material = --- 63,71 ---- GetLog()->Debug() << "(MaterialServer) registered material " << material->GetName() << "\n"; + } ! shared_ptr<Material> ! MaterialServer::GetMaterial(const std::string& name) { shared_ptr<Material> material = *************** *** 69,81 **** if (material.get() == 0) ! { ! GetLog()->Error() << "(MaterialServer) ERROR: Unknown material '" ! << name << "'\n"; ! } return material; } ! void MaterialServer::OnLink() { // create the default material --- 73,86 ---- if (material.get() == 0) ! { ! GetLog()->Error() << "(MaterialServer) ERROR: Unknown material '" ! << name << "'\n"; ! } return material; } ! void ! MaterialServer::OnLink() { // create the default material *************** *** 85,86 **** --- 90,138 ---- AddChildReference(defMat); } + + bool + MaterialServer::InitMaterialExporter(const std::string& name) + { + shared_ptr<MaterialExporter> exporter + = shared_dynamic_cast<MaterialExporter>(GetCore()->New(name)); + + if (exporter.get() == 0) + { + GetLog()->Error() << "(MaterialServer) ERROR: " + << "unable to create MaterialExporter '" << name << "'\n"; + return false; + } + + exporter->SetName(name); + AddChildReference(exporter); + + GetLog()->Normal() << "(MaterialServer) MaterialExporter '" << name << "' registered\n"; + + return true; + } + + void + MaterialServer::ExportAllMaterial() + { + TLeafList materials; + ListChildrenSupportingClass<Material>(materials); + + for (TLeafList::const_iterator mi = materials.begin(); mi != materials.end(); ++mi) + { + shared_ptr<Material> m = shared_static_cast<Material>(*mi); + ExportMaterial(m); + } + } + + void + MaterialServer::ExportMaterial(shared_ptr<Material> material) + { + TLeafList exporters; + ListChildrenSupportingClass<MaterialExporter>(exporters); + + for (TLeafList::const_iterator bi = exporters.begin(); bi != exporters.end(); ++bi) + { + shared_ptr<MaterialExporter> mb = shared_static_cast<MaterialExporter>(*bi); + mb->RegisterMaterial(material); + } + } |
From: Oliver O. <fr...@us...> - 2007-05-08 03:23:36
|
Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22398 Modified Files: Tag: projectx materialserver.h Log Message: - Added facilities to export registered materials. - the (protected) method ExportMaterial(material) exports one material via all registered exporters - exporters can be created and registered via InitMaterialExporter(name) - ExportAllMaterial() exports all materials (when it's called). Materials can't just be exported automatically, as one possible method to register materials is to just put them in the tree below the MaterialServer. So ExportAllMaterial has to be called manually after Materials have been installed (can also be called from Ruby). Index: materialserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/materialserver/materialserver.h,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** materialserver.h 19 Feb 2006 11:10:11 -0000 1.2 --- materialserver.h 8 May 2007 03:23:33 -0000 1.2.4.1 *************** *** 49,54 **** --- 49,70 ---- boost::shared_ptr<Material> GetMaterial(const std::string &name); + /** Create an instance of a material exporter and register it to the MaterialServer. + A MaterialExporter is a class that takes care to additionally register/export + materials registered at the MaterialServer at another class (potentially + external to spark). This has to be done only when spark/kerosin + rendering alone is not enough. + \param name name of the MaterialExporter class name + \returns true if successful + */ + bool InitMaterialExporter(const std::string& name); + + //! export all registered materials via all registered exporters + void ExportAllMaterial(); + protected: virtual void OnLink(); + + //! export a single material to all registered exporters + void ExportMaterial(boost::shared_ptr<Material> material); }; |
From: Oliver O. <fr...@us...> - 2007-05-08 03:13:29
|
Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18399 Added Files: Tag: projectx materialexporter_c.cpp Log Message: - added abstract MaterialExporter. This class can be used to customise the material server, which needs to be informed about the materials used for a specific simulation. By registering a MaterialExporter implementation to the MaterialServer, materials can be registered (exported) to another class. --- NEW FILE: materialexporter_c.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of simspark Tue May 9 2006 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2007 RoboCup Soccer Server 3D Maintenance Group $Id: materialexporter_c.cpp,v 1.1.2.1 2007/05/08 03:13:26 fruit Exp $ 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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. MeshExporter NOTE: This class serves as an (abstract) exporter, to register materials with other graphic engines (possibly also for exporting) HISTORY: 03/05/07 - OO - Initial version */ #include "materialexporter.h" using namespace kerosin; void CLASS(MaterialExporter)::DefineClass() { DEFINE_BASECLASS(zeitgeist/Leaf); } |
From: Oliver O. <fr...@us...> - 2007-05-08 03:11:58
|
Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17642 Added Files: Tag: projectx materialexporter.h Log Message: - added abstract MaterialExporter. This class can be used to customise the material server, which needs to be informed about the materials used for a specific simulation. By registering a MaterialExporter implementation to the MaterialServer, materials can be registered (exported) to another class. --- NEW FILE: materialexporter.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of simspark Tue May 9 2006 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2007 RoboCup Soccer Server 3D Maintenance Group $Id: materialexporter.h,v 1.1.2.1 2007/05/08 03:11:55 fruit Exp $ 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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. MaterialExporter NOTE: This class serves as an (abstract) exporter to register materials with other graphic engines (possibly also for exporting). HISTORY: 03/05/07 - OO - Initial version */ #ifndef KEROSIN_MATERIALEXPORTER_H #define KEROSIN_MATERIALEXPORTER_H #include <zeitgeist/class.h> #include <zeitgeist/node.h> #include "material.h" namespace kerosin { /** \class MaterialExporter. This class can be used to implement custom material server, which needs to be informed about the materials used for a specific simulation. By registering a MaterialExporter implementation to the MaterialServer, materials can be registered (exported) to another class. */ class MaterialExporter : public zeitgeist::Leaf { public: virtual ~MaterialExporter() {} /** Register / Export the given material. \param material the material to register / export. */ virtual void RegisterMaterial(boost::shared_ptr<Material> material) = 0; }; DECLARE_ABSTRACTCLASS(MaterialExporter); } // end namespace kerosin #endif // KEROSIN_MATERIALEXPORTER |
From: Oliver O. <fr...@us...> - 2007-05-08 03:07:37
|
Update of /cvsroot/simspark/simspark/spark/oxygen/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16005 Modified Files: Tag: projectx camera_c.cpp Log Message: - added lookAt() ruby fkt (making the camera looking at a point) Index: camera_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/camera_c.cpp,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** camera_c.cpp 5 Dec 2005 21:21:17 -0000 1.1 --- camera_c.cpp 8 May 2007 03:07:32 -0000 1.1.4.1 *************** *** 163,166 **** --- 163,186 ---- } + FUNCTION(Camera,lookAt) + { + int inX; + int inY; + int inZ; + + if ( + (in.GetSize() != 3) || + (! in.GetValue(in[0],inX)) || + (! in.GetValue(in[1],inY)) || + (! in.GetValue(in[2],inZ)) + ) + { + return false; + } + + obj->LookAt(salt::Vector3f(inX,inY,inZ)); + return true; + } + void CLASS(Camera)::DefineClass() { *************** *** 179,181 **** --- 199,202 ---- DEFINE_FUNCTION(adjustZFar); DEFINE_FUNCTION(getZFar); + DEFINE_FUNCTION(lookAt); } |
From: Oliver O. <fr...@us...> - 2007-05-08 03:06:14
|
Update of /cvsroot/simspark/simspark/spark/oxygen/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15342 Modified Files: Tag: projectx camera.cpp Log Message: - added LookAt() method (making the camera looking at a point) - cosmetic changes Index: camera.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/camera.cpp,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** camera.cpp 5 Dec 2005 21:21:17 -0000 1.1 --- camera.cpp 8 May 2007 03:06:03 -0000 1.1.4.1 *************** *** 49,53 **** transforms. It is really fast and very generic because of that. */ ! void Camera::DescribeFrustum(Frustum& frustum) const { // concatenate projection and view transform --- 49,54 ---- transforms. It is really fast and very generic because of that. */ ! void ! Camera::DescribeFrustum(Frustum& frustum) const { // concatenate projection and view transform *************** *** 91,95 **** } ! void Camera::Bind() { mViewTransform = GetWorldTransform(); --- 92,97 ---- } ! void ! Camera::Bind() { mViewTransform = GetWorldTransform(); *************** *** 106,110 **** } ! void Camera::OnLink() { bool gotSetup = --- 108,113 ---- } ! void ! Camera::OnLink() { bool gotSetup = *************** *** 121,125 **** } ! void Camera::UpdateHierarchyInternal() { // make sure values are within bounds --- 124,129 ---- } ! void ! Camera::UpdateHierarchyInternal() { // make sure values are within bounds *************** *** 130,134 **** } ! void Camera::SetViewport(int x, int y, int width, int height) { mX = x; --- 134,139 ---- } ! void ! Camera::SetViewport(int x, int y, int width, int height) { mX = x; *************** *** 138,213 **** } ! int Camera::GetViewportX() { return mX; } ! int Camera::GetViewportY() { return mY; } ! int Camera::GetViewportWidth() { return mWidth; } ! int Camera::GetViewportHeight() { return mHeight; } ! void Camera::SetFOV(const float fov) { mFOV = fov; } ! void Camera::SetZNear(const float zNear) { mZNear = zNear; } ! void Camera::SetZFar(const float zFar) { mZFar = zFar; } ! void Camera::AdjustFOV(const float fov) { mFOV+=fov; } ! void Camera::AdjustZNear(const float zNear) { mZNear+=zNear; } ! void Camera::AdjustZFar(const float zFar) { mZFar+=zFar; } ! float Camera::GetFOV() const { return mFOV; } ! float Camera::GetZNear() const { return mZNear; } ! float Camera::GetZFar()const { return mZFar; } ! const salt::Matrix& Camera::GetViewTransform() const { return mViewTransform; } ! const salt::Matrix& Camera::GetProjectionTransform() const { return mProjectionTransform; } --- 143,245 ---- } ! int ! Camera::GetViewportX() const { return mX; } ! int ! Camera::GetViewportY() const { return mY; } ! int ! Camera::GetViewportWidth() const { return mWidth; } ! int ! Camera::GetViewportHeight() const { return mHeight; } ! void ! Camera::SetFOV(float fov) { mFOV = fov; } ! void ! Camera::SetZNear(float zNear) { mZNear = zNear; } ! void ! Camera::SetZFar(float zFar) { mZFar = zFar; } ! void ! Camera::AdjustFOV(float fov) { mFOV+=fov; } ! void ! Camera::AdjustZNear(float zNear) { mZNear+=zNear; } ! void ! Camera::AdjustZFar(float zFar) { mZFar+=zFar; } ! float ! Camera::GetFOV() const { return mFOV; } ! float ! Camera::GetZNear() const { return mZNear; } ! float ! Camera::GetZFar() const { return mZFar; } ! const salt::Matrix& ! Camera::GetViewTransform() const { return mViewTransform; } ! const salt::Matrix& ! Camera::GetProjectionTransform() const { return mProjectionTransform; } + + void + Camera::LookAt(const salt::Vector3f& toPoint) + { + Matrix m; + salt::Vector3f fromPoint; + fromPoint = GetWorldTransform().Pos(); + // std::cerr << "Camera: look from " << fromPoint << " at " << toPoint << "\n"; + salt::Vector3f up(0,0,1); + m.LookAt(fromPoint, toPoint, up); + SetWorldTransform(m); + } |
From: Oliver O. <fr...@us...> - 2007-05-08 03:04:32
|
Update of /cvsroot/simspark/simspark/spark/oxygen/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14819 Modified Files: Tag: projectx camera.h Log Message: added LookAt() method (making the camera looking at a point) Index: camera.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/camera.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** camera.h 5 Dec 2005 21:21:17 -0000 1.1 --- camera.h 8 May 2007 03:04:27 -0000 1.1.4.1 *************** *** 46,73 **** /** sets viewpoint properties */ void SetViewport(int x, int y, int width, int height); ! int GetViewportX(); ! int GetViewportY(); ! int GetViewportWidth(); ! int GetViewportHeight(); /** sets the field of view (FOV) */ ! void SetFOV(const float fov); /** sets the distance of the Z near plane */ ! void SetZNear(const float zNear); /** sets the distance of the Z far plane */ ! void SetZFar(const float zFar); /** adjusts the current FOV, i.e. adds a delta increment */ ! void AdjustFOV(const float fov); /** adjusts the distance of the Z near plane, i.e adds a delta increment */ ! void AdjustZNear(const float zNear); /** adjusts the distance of the Z far plane, i.e adds a delta increment */ ! void AdjustZFar(const float zFar); /** returns the field of View */ --- 46,74 ---- /** sets viewpoint properties */ void SetViewport(int x, int y, int width, int height); ! ! int GetViewportX() const; ! int GetViewportY() const; ! int GetViewportWidth() const; ! int GetViewportHeight() const; /** sets the field of view (FOV) */ ! void SetFOV(float fov); /** sets the distance of the Z near plane */ ! void SetZNear(float zNear); /** sets the distance of the Z far plane */ ! void SetZFar(float zFar); /** adjusts the current FOV, i.e. adds a delta increment */ ! void AdjustFOV(float fov); /** adjusts the distance of the Z near plane, i.e adds a delta increment */ ! void AdjustZNear(float zNear); /** adjusts the distance of the Z far plane, i.e adds a delta increment */ ! void AdjustZFar(float zFar); /** returns the field of View */ *************** *** 90,93 **** --- 91,99 ---- void DescribeFrustum(salt::Frustum& frustum) const; + /** turn the camera so that it looks to a given point. + * @param toPoint the point to look at + */ + void LookAt(const salt::Vector3f& toPoint); + /** sets the view transform to be the inverted WorldTransform and sets up the projection transform matrix |
From: Oliver O. <fr...@us...> - 2007-05-08 01:42:57
|
Update of /cvsroot/simspark/simspark/spark/oxygen/geometryserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14753 Modified Files: Tag: projectx geometryserver.h Log Message: fixed comment lines Index: geometryserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/geometryserver/geometryserver.h,v retrieving revision 1.2.4.2 retrieving revision 1.2.4.3 diff -C2 -d -r1.2.4.2 -r1.2.4.3 *** geometryserver.h 5 Apr 2007 04:09:22 -0000 1.2.4.2 --- geometryserver.h 8 May 2007 01:42:55 -0000 1.2.4.3 *************** *** 61,70 **** void RegisterMesh(boost::shared_ptr<TriMesh> mesh); ! /** Create an instance of a mesh bridge and register it to the GeometryServer. A MeshExporter is a class that takes care to additionally register/export meshes registered at the GeometryServer at another class (potentially external to spark). This has to be done only when spark/kerosin rendering alone is not enough. ! \param name name of the MeshBridge class name \returns true if successful */ --- 61,70 ---- void RegisterMesh(boost::shared_ptr<TriMesh> mesh); ! /** Create an instance of a mesh exporter and register it to the GeometryServer. A MeshExporter is a class that takes care to additionally register/export meshes registered at the GeometryServer at another class (potentially external to spark). This has to be done only when spark/kerosin rendering alone is not enough. ! \param name name of the MeshExporter class name \returns true if successful */ |
From: Oliver O. <fr...@us...> - 2007-05-08 01:36:26
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11623 Modified Files: Tag: projectx leaf.h leaf.cpp node.h node.cpp core.cpp Log Message: Added some changes from the rsgedit_fileref branch (Markus Rollmann) - added member GetNumberOfChildren() to node that returns the total number of children - modified SetParent() to care for a uniqe name among sibling nodes. If another sibling with the same name exists the current number of children is appended to the node name. If mporter classes create nodes in a stable order this also assures consistent node names through simulation restarts Index: core.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/core.cpp,v retrieving revision 1.2.2.5.2.1 retrieving revision 1.2.2.5.2.2 diff -C2 -d -r1.2.2.5.2.1 -r1.2.2.5.2.2 *** core.cpp 30 Mar 2007 03:38:09 -0000 1.2.2.5.2.1 --- core.cpp 8 May 2007 01:36:22 -0000 1.2.2.5.2.2 *************** *** 163,167 **** void Core::CatchSignal(int sig_num) { - #ifdef __linux__ if (sig_num != SIGSEGV) { --- 163,166 ---- *************** *** 171,174 **** --- 170,174 ---- cerr << "(Core) caught signal " << sig_num << endl; + #ifdef __linux__ // retrieve the name of our executable without access to argc and // argv (this works only with linux) *************** *** 206,213 **** free (strings); cerr << "(Core) exit" << endl; exit(1); - #endif } --- 206,213 ---- free (strings); + #endif cerr << "(Core) exit" << endl; exit(1); } Index: node.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/node.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** node.h 5 Dec 2005 20:59:18 -0000 1.1 --- node.h 8 May 2007 01:36:22 -0000 1.1.4.1 *************** *** 83,86 **** --- 83,89 ---- virtual bool IsLeaf() const; + /** returns the total number of children */ + virtual int GetNumberOfChildren() const; + /** update variables from a script */ virtual void UpdateCached(); *************** *** 131,150 **** boost::shared_ptr<Node> node = boost::shared_static_cast<Node>(make_shared(GetParent())); ! while (node.get() != 0) { boost::shared_ptr<CLASS> test = boost::shared_dynamic_cast<CLASS>(node); ! if (test.get() != 0) { return test; } ! //node = boost::shared_static_cast<Node>(make_shared(node->GetParent())); node = boost::shared_static_cast<Node>(node->GetParent().lock()); ! } ! return boost::shared_ptr<CLASS>(); } --- 134,153 ---- boost::shared_ptr<Node> node = boost::shared_static_cast<Node>(make_shared(GetParent())); ! while (node.get() != 0) { boost::shared_ptr<CLASS> test = boost::shared_dynamic_cast<CLASS>(node); ! if (test.get() != 0) { return test; } ! //node = boost::shared_static_cast<Node>(make_shared(node->GetParent())); node = boost::shared_static_cast<Node>(node->GetParent().lock()); ! } ! return boost::shared_ptr<CLASS>(); } Index: leaf.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.h,v retrieving revision 1.1.2.1.2.1 retrieving revision 1.1.2.1.2.2 diff -C2 -d -r1.1.2.1.2.1 -r1.1.2.1.2.2 *** leaf.h 4 May 2007 05:24:39 -0000 1.1.2.1.2.1 --- leaf.h 8 May 2007 01:36:22 -0000 1.1.2.1.2.2 *************** *** 159,163 **** */ template<class CLASS> ! void ListChildrenSupportingClass(TLeafList& list, bool recursive = false) { TLeafList::iterator lstEnd = end(); // avoid repeated virtual calls --- 159,163 ---- */ template<class CLASS> ! void ListChildrenSupportingClass(TLeafList& list, bool recursive = false) { TLeafList::iterator lstEnd = end(); // avoid repeated virtual calls *************** *** 220,223 **** --- 220,226 ---- virtual bool IsLeaf() const; + /** returns the total number of children */ + virtual int GetNumberOfChildren() const; + /** removes base from the set of children. */ virtual void RemoveChildReference(const boost::shared_ptr<Leaf> &base); Index: node.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/node.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.2.2.1 diff -C2 -d -r1.1.2.2 -r1.1.2.2.2.1 *** node.cpp 16 Feb 2007 15:39:23 -0000 1.1.2.2 --- node.cpp 8 May 2007 01:36:22 -0000 1.1.2.2.2.1 *************** *** 184,187 **** --- 184,193 ---- } + int + Node::GetNumberOfChildren() const + { + return static_cast<int>(mChildren.size()); + } + bool Node::IsLeaf() const Index: leaf.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.2.1 *** leaf.cpp 16 Feb 2007 15:38:42 -0000 1.1.2.1 --- leaf.cpp 8 May 2007 01:36:22 -0000 1.1.2.1.2.1 *************** *** 23,26 **** --- 23,27 ---- #include "node.h" #include <iostream> + #include <sstream> using namespace boost; *************** *** 112,115 **** --- 113,122 ---- } + int + Leaf::GetNumberOfChildren() const + { + return 0; + } + bool Leaf::IsLeaf() const { *************** *** 199,209 **** void Leaf::SetParent(const boost::shared_ptr<Node> &newParent) { ! shared_ptr<Node> oldParent = make_shared(GetParent()); if (oldParent.get() != 0) { // we have a parent, so update our state - shared_ptr<Leaf> self - = shared_static_cast<Leaf>(make_shared(GetSelf())); - // here reference count should be > 1 (at least one in the // parent, and one in this routine) --- 206,215 ---- void Leaf::SetParent(const boost::shared_ptr<Node> &newParent) { ! shared_ptr<Node> oldParent = GetParent().lock(); ! shared_ptr<Leaf> self = shared_static_cast<Leaf>(GetSelf().lock()); ! if (oldParent.get() != 0) { // we have a parent, so update our state // here reference count should be > 1 (at least one in the // parent, and one in this routine) *************** *** 229,237 **** mParent = newParent; ! if (! mParent.expired()) { ! // we have been linked, so now we can do something :) ! OnLink(); } } --- 235,255 ---- mParent = newParent; ! if (newParent.get() == 0) { ! return; ! } ! ! // assure a unique name among our siblings ! shared_ptr<Leaf> sibling = newParent->GetChild(mName); ! ! if (sibling != self) ! { ! stringstream ss; ! ss << mName << "_" << newParent->GetNumberOfChildren() << ">"; ! mName = ss.str().c_str(); } + + // we have been linked, so now we can do something :) + OnLink(); } |
From: Oliver O. <fr...@us...> - 2007-05-04 05:24:43
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19936 Modified Files: Tag: projectx leaf.h Log Message: ws only Index: leaf.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.2.1 *** leaf.h 16 Feb 2007 15:38:43 -0000 1.1.2.1 --- leaf.h 4 May 2007 05:24:39 -0000 1.1.2.1.2.1 *************** *** 159,163 **** */ template<class CLASS> ! void ListChildrenSupportingClass(TLeafList& list, bool recursive = false) { TLeafList::iterator lstEnd = end(); // avoid repeated virtual calls --- 159,163 ---- */ template<class CLASS> ! void ListChildrenSupportingClass(TLeafList& list, bool recursive = false) { TLeafList::iterator lstEnd = end(); // avoid repeated virtual calls |
From: Markus R. <rol...@us...> - 2007-05-01 13:14:43
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18276 Modified Files: space.cpp space.h Log Message: - made HandleSpaceCollide non virtual and protected - made collisionNearCallback a static member function - added member HandleSpaceCollide() that handles collisions between two space geoms - added method OnLink() that registers the Space to the proper parent space - adapted DestroyODEObject() and DestroySpaceObjects() to handle space containing other spaces Index: space.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/space.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** space.cpp 15 Mar 2007 07:26:27 -0000 1.2 --- space.cpp 1 May 2007 13:14:40 -0000 1.3 *************** *** 29,33 **** using namespace oxygen; ! static void collisionNearCallback (void *data, dGeomID obj1, dGeomID obj2) { Space *space = (Space*)data; --- 29,33 ---- using namespace oxygen; ! void Space::collisionNearCallback (void *data, dGeomID obj1, dGeomID obj2) { Space *space = (Space*)data; *************** *** 64,70 **** } void Space::HandleCollide(dGeomID obj1, dGeomID obj2) { ! // reject collisions between bodies that are connected with joints const dBodyID b1 = dGeomGetBody(obj1); const dBodyID b2 = dGeomGetBody(obj2); --- 64,97 ---- } + void Space::HandleSpaceCollide(dGeomID obj1, dGeomID obj2) + { + // collide all geoms internal to the space(s) + dSpaceCollide2 (obj1,obj2,this,&collisionNearCallback); + + if (dGeomIsSpace (obj1)) + { + dSpaceCollide ((dSpaceID)(obj1),this,&collisionNearCallback); + } + + if (dGeomIsSpace (obj2)) + { + dSpaceCollide ((dSpaceID)(obj2),this,&collisionNearCallback); + } + } + void Space::HandleCollide(dGeomID obj1, dGeomID obj2) { ! if ( ! (dGeomIsSpace (obj1)) || ! (dGeomIsSpace (obj2)) ! ) ! { ! // colliding a space with something ! HandleSpaceCollide(obj1, obj2); ! return; ! } ! ! // colliding two non-space geoms; reject collisions ! // between bodies that are connected with joints const dBodyID b1 = dGeomGetBody(obj1); const dBodyID b2 = dGeomGetBody(obj2); *************** *** 112,129 **** } bool Space::ConstructInternal() { ! // create the ode space, 0 indicates that this space should ! // not be inserted into another space, i.e. we always create a ! // toplevel space object ! mODESpace = dHashSpaceCreate(0); ! // create a joint group for the contacts ! mODEContactGroup = dJointGroupCreate(0); ! return ( ! (mODESpace != 0) && ! (mODEContactGroup != 0) ! ); } --- 139,190 ---- } + void Space::OnLink() + { + ODEObject::OnLink(); + + dSpaceID space = FindSpaceID(); + if ( + (space) && + (space != mODESpace) && + (! dSpaceQuery(space, (dGeomID)mODESpace)) + ) + { + dSpaceAdd(space, (dGeomID)mODESpace); + } + } + + dSpaceID Space::GetParentSpaceID() + { + if (mODESpace == 0) + { + return 0; + } + + return dGeomGetSpace((dGeomID)mODESpace); + } + + bool Space::IsGlobalSpace() + { + return + ( + (mODESpace != 0) && + (GetParentSpaceID() == 0) + ); + } + bool Space::ConstructInternal() { ! // create the ode space, 0 indicates that this space should ! // not be inserted into another space, i.e. we always create a ! // toplevel space object ! mODESpace = dHashSpaceCreate(0); ! // create a joint group for the contacts ! mODEContactGroup = dJointGroupCreate(0); ! return ( ! (mODESpace != 0) && ! (mODEContactGroup != 0) ! ); } *************** *** 136,188 **** void Space::DestroySpaceObjects() { ! shared_ptr<Scene> scene = GetScene(); ! if (scene.get() == 0) ! { ! return; ! } ! TLeafList objects; ! const bool recursive = true; ! scene->ListChildrenSupportingClass<ODEObject>(objects, recursive); ! for ( ! TLeafList::iterator iter = objects.begin(); ! iter != objects.end(); ! ++iter ! ) ! { ! shared_ptr<ODEObject> object = shared_static_cast<ODEObject>(*iter); ! if (object->GetSpaceID() != mODESpace) { ! continue; ! } ! object->DestroyODEObject(); ! } } void Space::DestroyODEObject() { ! static bool recurseLock = false; ! ! if ( ! (recurseLock) || ! (! mODESpace) ! ) ! { ! return; ! } ! ! recurseLock = true; ! ! // make sure that all objects registered to this space are destroyed ! // before this space. Any other order provokes a segfault in ODE. ! DestroySpaceObjects(); ! // release the ODE space ! dSpaceDestroy(mODESpace); ! mODESpace = 0; ! recurseLock = false; } --- 197,254 ---- void Space::DestroySpaceObjects() { ! shared_ptr<Scene> scene = GetScene(); ! if (scene.get() == 0) ! { ! return; ! } ! TLeafList objects; ! const bool recursive = true; ! scene->ListChildrenSupportingClass<ODEObject>(objects, recursive); ! bool globalSpace = IsGlobalSpace(); ! shared_ptr<Space> self = shared_static_cast<Space>(GetSelf().lock()); ! for ( ! TLeafList::iterator iter = objects.begin(); ! iter != objects.end(); ! ++iter ! ) { ! shared_ptr<ODEObject> object = shared_static_cast<ODEObject>(*iter); ! if (object == self) ! { ! continue; ! } ! // destroy objects registered to this space; the top level ! // space object also destroy any other ODE object ! const dSpaceID parentSpace = object->GetParentSpaceID(); ! if ( ! ( ! (globalSpace) && ! (parentSpace == 0) ! ) || ! (parentSpace == mODESpace) ! ) ! { ! object->DestroyODEObject(); ! } ! } } void Space::DestroyODEObject() { ! if (! mODESpace) ! { ! return; ! } ! // make sure that all objects registered to this space are destroyed ! // before this space. Any other order provokes a segfault in ODE. ! DestroySpaceObjects(); ! // release the ODE space ! dSpaceDestroy(mODESpace); ! mODESpace = 0; } Index: space.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/space.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** space.h 15 Mar 2007 07:26:27 -0000 1.2 --- space.h 1 May 2007 13:14:40 -0000 1.3 *************** *** 59,72 **** void Collide(); /** callback to handle a potential collision between two contained geoms. It will look up and notify the corresponding colliders for a potential collision. */ ! virtual void HandleCollide(dGeomID obj1, dGeomID obj2); ! /** destroy the managed ODE object */ ! virtual void DestroyODEObject(); - protected: /** creates them managed ODE space and a contact joint group */ virtual bool ConstructInternal(); --- 59,88 ---- void Collide(); + /** destroy the managed ODE object */ + virtual void DestroyODEObject(); + + /** returns the ODE handle ID of the containing parent space */ + virtual dSpaceID GetParentSpaceID(); + + /** returns true if this is the top global, i.e. top level space object */ + bool IsGlobalSpace(); + + protected: + static void collisionNearCallback (void *data, dGeomID obj1, dGeomID obj2); + + /** registers the managed space to the containing parent space */ + virtual void OnLink(); + /** callback to handle a potential collision between two contained geoms. It will look up and notify the corresponding colliders for a potential collision. */ ! void HandleCollide(dGeomID obj1, dGeomID obj2); ! /** handle the collision between two geoms from which at least one ! is a space geom ! */ ! void HandleSpaceCollide(dGeomID obj1, dGeomID obj2); /** creates them managed ODE space and a contact joint group */ virtual bool ConstructInternal(); |