1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-23 07:10:19 +01:00
minetest_game/mods/stairs
Auke Kok b848e35ca5 Stairs: Big simplification of slabs combination
Combine slabs if identical based on orientations using a simple lookup
table if the nodes are identical.

Otherwise relies on place_node() to place the node, which properly
handles rotation compared to adjacent nodes already, and can orient
based on look_dir as well.

Initial slabs placed are oriented based on (1) the orientation of
the pointed "face" (assumes nodes are cubic, of course), and uses
the player look direction to orient the node n/e/w/s if the slab
is horizontal or upside-down. If placed against a vertical face,
the slab is placed against the face without rotation around the axis
perpendicular to that vertical face. This allows upside down placement
and vertical placement without screwdriver.

If a slab is placed on top of an upside down slab, or below a normally
placed slab, the rotation is inverted so that no "floating" slab
is created.

Largely based on kilbith's #807 PR. Slab combining and place_node()
usage by sofar.

Since this relies entirely on `on_place` mechanics, this fails to
combine slabs into a plain node if the space *above* is occupied.
This is unavoidable due to the fact that on_place() happens after
the checks required to see if pointed_thing.above is empty or not.
2016-09-14 06:01:04 +01:00
..
models Grant multiple tiles on stairs model 2015-07-17 20:53:32 +01:00
depends.txt Stairs: Add straw and metal blocks 2015-08-14 23:23:41 +01:00
init.lua Stairs: Big simplification of slabs combination 2016-09-14 06:01:04 +01:00
license.txt Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00
README.txt Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00

Minetest Game mod: stairs
=========================
See license.txt for license information.

Authors of source code
----------------------
Originally by Kahrl <kahrl@gmx.net> (LGPL 2.1) and
celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
Various Minetest developers and contributors (LGPL 2.1)

Authors of media (models)
-------------------------
Jean-Patrick G. (kilbith) <jeanpatrick.guerrero@gmail.com> (CC BY-SA 3.0):
  stairs_stair.obj