3 Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>,
4 2012-2013 RealBadAngel, Maciej Kasatkin <mk@realbadangel.pl>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef TREEGEN_HEADER
21 #define TREEGEN_HEADER
26 class ManualMapVoxelManipulator;
27 class INodeDefManager;
35 std::string initial_axiom;
46 int iterations_random_level;
47 std::string trunk_type;
55 void make_tree(ManualMapVoxelManipulator &vmanip, v3s16 p0,
56 bool is_apple_tree, INodeDefManager *ndef,int seed);
58 // Add L-Systems tree (used by engine)
59 void make_ltree(ManualMapVoxelManipulator &vmanip, v3s16 p0, INodeDefManager *ndef,
60 TreeDef tree_definition);
61 // Spawn L-systems tree from LUA
62 void spawn_ltree (ServerEnvironment *env, v3s16 p0, INodeDefManager *ndef,
63 TreeDef tree_definition);
65 // L-System tree gen helper functions
66 void tree_node_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
68 void tree_trunk_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
69 TreeDef &tree_definition);
70 void tree_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
71 PseudoRandom ps, TreeDef &tree_definition);
72 void tree_single_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
73 PseudoRandom ps, TreeDef &tree_definition);
74 void tree_fruit_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
75 TreeDef &tree_definition);
76 irr::core::matrix4 setRotationAxisRadians(irr::core::matrix4 M, double angle,v3f axis);
78 v3f transposeMatrix(irr::core::matrix4 M ,v3f v);
80 }; // namespace treegen