Revision: 1514
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1514&view=rev
Author:   rorthomas
Date:     2010-08-18 12:13:17 +0000 (Wed, 18 Aug 2010)

Log Message:
-----------
adding user-definable LODs for meshes
refs #346
flexbodies not using LODs yet.

Modified Paths:
--------------
    trunk/source/main/MeshObject.h

Modified: trunk/source/main/MeshObject.h
===================================================================
--- trunk/source/main/MeshObject.h      2010-08-17 02:38:17 UTC (rev 1513)
+++ trunk/source/main/MeshObject.h      2010-08-18 12:13:17 UTC (rev 1514)
@@ -206,6 +206,33 @@
 
                }
 
+               // now find possible LODs
+               String basename, ext;
+               StringUtil::splitBaseFilename(meshName, basename, ext);
+               for(int i=0; i<4;i++)
+               {
+                       String fn = basename + "_" + 
StringConverter::toString(i) + ".mesh";
+                       String group = "";
+                       try
+                       {
+                               group = 
ResourceGroupManager::getSingleton().findGroupContainingResource(fn);
+                       }catch(...)
+                       {
+                               continue;
+                       }
+
+                       if(group.empty()) continue;
+
+                       float distance = 3;
+                       if(i == 1) distance = 20;
+                       if(i == 2) distance = 50;
+                       if(i == 3) distance = 200;
+                       mesh->createManualLodLevel(distance, fn);
+               }
+               
+               
+
+
                // now create an entity around the mesh and attach it to the 
scene graph
                try
                {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to