From afed842ad19ff4196f4987f3e35746d872f67dd0 Mon Sep 17 00:00:00 2001 From: frohlich Date: Sun, 1 Mar 2009 21:25:14 +0000 Subject: [PATCH] Don't waste space with too huge stl containers. Modified Files: simgear/scene/bvh/BVHStaticData.hxx --- simgear/scene/bvh/BVHStaticData.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simgear/scene/bvh/BVHStaticData.hxx b/simgear/scene/bvh/BVHStaticData.hxx index 27bacef2..400632ad 100644 --- a/simgear/scene/bvh/BVHStaticData.hxx +++ b/simgear/scene/bvh/BVHStaticData.hxx @@ -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(_vertices).swap(_vertices); + std::vector(_materials).swap(_materials); + } private: std::vector _vertices; -- 2.39.5