aboutsummaryrefslogtreecommitdiff
path: root/textures/base/pack/unknown_object.png
blob: c0166c31f8ff34468d52ff0accbb6bd592261e6c (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 20 00 00 00 20 08 03 00 00 00 44 a4 8a .PNG........IHDR.............D..
0020 c6 00 00 00 12 50 4c 54 45 00 00 00 37 00 37 80 00 80 ff 00 ff ff b4 fc ff ff ff 5d b1 f6 91 00 .....PLTE...7.7............]....
0040 00 00 a7 49 44 41 54 78 da a5 90 51 0e 84 20 0c 05 87 3e bc ff 95 d7 c2 16 ad 35 fa e1 10 8c 71 ...IDATx...Q......>.......5....q
0060 26 15 e5 9d ed 09 79 00 f4 8a e4 b2 8d a0 53 ad 83 66 d0 af 81 82 08 28 3a bc 46 90 75 e6 3c 81 &.....y.......S..f.....(:.F.u.<.
0080 ac eb 04 a6 af 13 d8 15 bb 45 08 a4 71 61 2e 56 e0 7a 3d 17 c7 3a 07 e2 3e d8 b8 6a 34 9b 08 ca .........E..qa.V.z=..:..>..j4...
00a0 e1 ca 67 ea 25 d0 87 c0 9e 03 b3 14 e0 3b e9 12 24 48 01 fc f7 ba 05 8e 20 fd 3c 97 3e 1e bb 0f ..g.%........;..$H........<.>...
00c0 90 4a 50 5e 61 10 45 04 01 92 2c 58 01 10 9e a4 81 19 08 05 96 02 23 0e 19 fa ca 0c 1e 7c 3e a4 .JP^a.E...,X..........#......|>.
00e0 55 46 a0 46 bb c7 05 af fc 00 35 72 08 d4 7e ef 47 25 00 00 00 00 49 45 4e 44 ae 42 60 82 UF.F......5r..~.G%....IEND.B`.
d='n74' href='#n74'>74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
/*
Minetest
Copyright (C) 2010-2018 celeron55, Perttu Ahola <celeron55@gmail.com>,
Copyright (C) 2012-2018 RealBadAngel, Maciej Kasatkin
Copyright (C) 2015-2018 paramat

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#pragma once

#include <matrix4.h>
#include "noise.h"

class MMVManip;
class NodeDefManager;
class ServerEnvironment;


namespace treegen {

	enum error {
		SUCCESS,
		UNBALANCED_BRACKETS
	};

	struct TreeDef {
		std::string initial_axiom;
		std::string rules_a;
		std::string rules_b;
		std::string rules_c;
		std::string rules_d;

		MapNode trunknode;
		MapNode leavesnode;
		MapNode leaves2node;

		int leaves2_chance;
		int angle;
		int iterations;
		int iterations_random_level;
		std::string trunk_type;
		bool thin_branches;
		MapNode fruitnode;
		int fruit_chance;
		s32 seed;
		bool explicit_seed;
	};

	// Add default tree
	void make_tree(MMVManip &vmanip, v3s16 p0,
		bool is_apple_tree, const NodeDefManager *ndef, s32 seed);
	// Add jungle tree
	void make_jungletree(MMVManip &vmanip, v3s16 p0,
		const NodeDefManager *ndef, s32 seed);
	// Add pine tree
	void make_pine_tree(MMVManip &vmanip, v3s16 p0,
		const NodeDefManager *ndef, s32 seed);

	// Add L-Systems tree (used by engine)
	treegen::error make_ltree(MMVManip &vmanip, v3s16 p0,
		const NodeDefManager *ndef, TreeDef tree_definition);
	// Spawn L-systems tree from LUA
	treegen::error spawn_ltree (ServerEnvironment *env, v3s16 p0,
		const NodeDefManager *ndef, const TreeDef &tree_definition);

	// L-System tree gen helper functions
	void tree_node_placement(MMVManip &vmanip, v3f p0,
		MapNode node);
	void tree_trunk_placement(MMVManip &vmanip, v3f p0,
		TreeDef &tree_definition);
	void tree_leaves_placement(MMVManip &vmanip, v3f p0,
		PseudoRandom ps, TreeDef &tree_definition);
	void tree_single_leaves_placement(MMVManip &vmanip, v3f p0,
		PseudoRandom ps, TreeDef &tree_definition);
	void tree_fruit_placement(MMVManip &vmanip, v3f p0,
		TreeDef &tree_definition);
	irr::core::matrix4 setRotationAxisRadians(irr::core::matrix4 M, double angle, v3f axis);

	v3f transposeMatrix(irr::core::matrix4 M ,v3f v);

}; // namespace treegen