- MakeTreesLeaf(firstTree.range,
- shared_geometry));
- quadtree.buildQuadTree(forest._trees.begin(), forest._trees.end());
+ MakeTreesLeaf(forest.range,
+ shared_geometry,
+ forest.texture_varieties));
+ // Transform tree positions from the "geocentric" positions we
+ // get from the scenery polys into the local Z-up coordinate
+ // system.
+ std::vector<TreeBin::Tree> rotatedTrees;
+ rotatedTrees.reserve(forest._trees.size());
+ std::transform(forest._trees.begin(), forest._trees.end(),
+ std::back_inserter(rotatedTrees),
+ TreeTransformer(transInv));
+ quadtree.buildQuadTree(rotatedTrees.begin(), rotatedTrees.end());