|
From: Oliver O. <fr...@us...> - 2007-06-17 08:38:47
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv8428 Modified Files: Tag: projectx staticmesh_c.cpp Log Message: - fixed bug with setting the scale of staticmesh - added method to set flag if an external mesh should be used (for external GE) - added method to set external mesh name (for external GE) - added method to set external mesh scale Index: staticmesh_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/staticmesh_c.cpp,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_c.cpp 10 May 2007 10:44:49 -0000 1.1.4.1 --- staticmesh_c.cpp 17 Jun 2007 08:38:43 -0000 1.1.4.2 *************** *** 54,63 **** if ( ! (in.GetSize() == 0) || ! (! in.GetValue(in[0], inScale)) ) ! { ! return false; ! } obj->SetScale(inScale); --- 54,63 ---- if ( ! (in.GetSize() != 3) || ! (! in.GetValue(in.begin(), inScale)) ) ! { ! return false; ! } obj->SetScale(inScale); *************** *** 70,74 **** if ( ! (in.GetSize() == 0) || (! in.GetValue(in[0], shadows)) ) --- 70,74 ---- if ( ! (in.GetSize() != 1) || (! in.GetValue(in[0], shadows)) ) *************** *** 81,84 **** --- 81,133 ---- } + FUNCTION(StaticMesh,setUseExternalMesh) + { + bool external; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in[0], external)) + ) + { + return false; + } + + obj->SetUseExternalMesh(external); + return true; + } + + + FUNCTION(StaticMesh,setExternalMeshName) + { + std::string name; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in[0], name)) + ) + { + return false; + } + obj->SetExternalMeshName(name); + return true; + } + + FUNCTION(StaticMesh,setExternalMeshScale) + { + Vector3f inScale; + std::cerr << "*********************************************************************************\n"; + if ( + (in.GetSize() != 3) || + (! in.GetValue(in.begin(), inScale)) + ) + { + return false; + } + std::cerr << "setting External Mesh scale to " << inScale << "\n*********************************************************************************\n"; + + obj->SetExternalMeshScale(inScale); + return true; + } + void CLASS(StaticMesh)::DefineClass() { *************** *** 87,89 **** --- 136,141 ---- DEFINE_FUNCTION(setScale); DEFINE_FUNCTION(setCastShadows) + DEFINE_FUNCTION(setUseExternalMesh) + DEFINE_FUNCTION(setExternalMeshName) + DEFINE_FUNCTION(setExternalMeshScale) } |