Advertisement
Guest User

Untitled

a guest
May 19th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.69 KB | None | 0 0
  1. void Object::exportWaypoint (long indent, ::ofstream &output, long objectIndex, World* world){
  2.     //Output a simple header..."
  3.     output << "\n" << indentation (indent) << "Waypoint: " << objectIndex << ";";
  4.  
  5.         //Output the transformation...
  6.         output << "\n" << indentation (indent + 1) << "Transformation: //m11 m12 m13 m14 m21 m22 ... m44";
  7.     {
  8.         Transformation &t = transformation.normal ();
  9.         output << "\n" << indentation (indent + 2)
  10.             << t.m11 << ", " << t.m12 << ", " << t.m13 << ", " << t.m14 << ", "
  11.             << t.m21 << ", " << t.m22 << ", " << t.m23 << ", " << t.m24 << ", "
  12.             << t.m31 << ", " << t.m32 << ", " << t.m33 << ", " << t.m34 << ", "
  13.             << t.m41 << ", " << t.m42 << ", " << t.m43 << ", " << t.m44 << "; //Standard...";
  14.     }
  15.     {
  16.         Transformation &t = transformation.inverse;
  17.         output << "\n" << indentation (indent + 2)
  18.             << t.m11 << ", " << t.m12 << ", " << t.m13 << ", " << t.m14 << ", "
  19.             << t.m21 << ", " << t.m22 << ", " << t.m23 << ", " << t.m24 << ", "
  20.             << t.m31 << ", " << t.m32 << ", " << t.m33 << ", " << t.m34 << ", "
  21.             << t.m41 << ", " << t.m42 << ", " << t.m43 << ", " << t.m44 << "; //Inverse...";
  22.     }
  23.  
  24.     //Output the properties...
  25.  
  26.         output << "\n" << indentation (indent + 1) << "Properties: " << properties.size () << ";";
  27.  
  28.         loopDictionary (name, value, properties, char)
  29.             if((stricmp (name,"type") != 0) || (stricmp (name,"texture") != 0)){
  30.                     output << "\n" << indentation (indent + 2) << "\"" << name << "\" => \"" << value << "\"";
  31.             }      
  32.             endloop
  33. }
  34.  
  35. void Object::export (long indent, ::ofstream &output, long objectIndex, World* world) {
  36.     bool dontPrint = false;
  37.  
  38.     //Output a simple header..."
  39.     output << "\n" << indentation (indent) << "Object: " << objectIndex << ";";
  40.  
  41.     loopDictionary (name, value, properties, char)
  42.         if(strcmp (name,"type") == 0)
  43.             output << "\n" << indentation (indent + 1) << "\"" << name << "\" => \"" << value << "\"";
  44.  
  45.         if(strcmp (name,"static geometry") == 0)
  46.             dontPrint = true;
  47.  
  48.     endloop
  49.            
  50.             //Output the transformation...
  51.             output << "\n" << indentation (indent + 1) << "Transformation: //m11 m12 m13 m14 m21 m22 ... m44";
  52.         {
  53.             Transformation &t = transformation.normal ();
  54.             output << "\n" << indentation (indent + 2)
  55.                 << t.m11 << ", " << t.m12 << ", " << t.m13 << ", " << t.m14 << ", "
  56.                 << t.m21 << ", " << t.m22 << ", " << t.m23 << ", " << t.m24 << ", "
  57.                 << t.m31 << ", " << t.m32 << ", " << t.m33 << ", " << t.m34 << ", "
  58.                 << t.m41 << ", " << t.m42 << ", " << t.m43 << ", " << t.m44 << "; //Standard...";
  59.         }
  60.         {
  61.             Transformation &t = transformation.inverse;
  62.             output << "\n" << indentation (indent + 2)
  63.                 << t.m11 << ", " << t.m12 << ", " << t.m13 << ", " << t.m14 << ", "
  64.                 << t.m21 << ", " << t.m22 << ", " << t.m23 << ", " << t.m24 << ", "
  65.                 << t.m31 << ", " << t.m32 << ", " << t.m33 << ", " << t.m34 << ", "
  66.                 << t.m41 << ", " << t.m42 << ", " << t.m43 << ", " << t.m44 << "; //Inverse...";
  67.         }
  68.  
  69.         //Output the properties...
  70.         if(!dontPrint){
  71.             output << "\n" << indentation (indent + 1) << "Properties: " << properties.size () << ";";
  72.            
  73.             loopDictionary (name, value, properties, char)
  74.                 if((stricmp (name,"type") != 0) || (stricmp (name,"texture") != 0))
  75.                 {
  76.                     if((stricmp (name,"texture") == 0))
  77.                         output << "\n" << indentation (indent + 2) << "\"" << name << "\" == \"" << value << "\"";
  78.                     else
  79.                         output << "\n" << indentation (indent + 2) << "\"" << name << "\" => \"" << value << "\"";
  80.                 }      
  81.             endloop
  82.         }
  83.        
  84.         //Output the faces...
  85.             output << "\n" << indentation (indent + 1) << "Faces: " << faces.size () << ";";
  86.             loopVector (faceIndex, faces)
  87.                 faces [faceIndex]->export (indent + 1, output, faceIndex, world);
  88.             endloop
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement