]> git.mxchange.org Git - simgear.git/commitdiff
Don't waste space with too huge stl containers.
authorfrohlich <frohlich>
Sun, 1 Mar 2009 21:25:14 +0000 (21:25 +0000)
committerTim Moore <timoore@redhat.com>
Thu, 5 Mar 2009 09:32:06 +0000 (10:32 +0100)
Modified Files:
simgear/scene/bvh/BVHStaticData.hxx

simgear/scene/bvh/BVHStaticData.hxx

index 27bacef2e2eba49ca02920a95b158b69726dfd55..400632adea004d64545b09c177ae426e86e40bc7 100644 (file)
@@ -44,6 +44,12 @@ public:
     { _materials.push_back(material); return _materials.size() - 1; }
     const SGMaterial* getMaterial(unsigned i) const
     { if (_materials.size() <= i) return 0; return _materials[i]; }
+
+    void trim()
+    {
+        std::vector<SGVec3f>(_vertices).swap(_vertices);
+        std::vector<const SGMaterial*>(_materials).swap(_materials);
+    }
     
 private:
     std::vector<SGVec3f> _vertices;