1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

some work-in-progress water stuff

This commit is contained in:
Perttu Ahola 2010-12-01 15:20:12 +02:00
parent 38353751c9
commit 5e0c284f3a
6 changed files with 517 additions and 155 deletions

View file

@ -35,9 +35,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
/*
Ignored node.
param is used for custom information in special containers,
like VoxelManipulator.
Anything that stores MapNodes doesn't have to preserve parameters
associated with this material.
@ -67,27 +64,12 @@ enum Material
MATERIAL_GRASS,
/*
For water, the param is water pressure. 0...127.
TODO: No, at least the lowest nibble is used for lighting.
- Water will be a bit like light, but with different flow
behavior.
- Water blocks will fall down if there is empty space below.
- If there is water below, the pressure of the block below is
the pressure of the current block + 1, or higher.
- If there is any pressure in a horizontally neighboring
block, a water block will try to move away from it.
- If there is >=2 of pressure in a block below, water will
try to move upwards.
- NOTE: To keep large operations fast, we have to keep a
cache of the water-air-surfaces, just like with light
*/
MATERIAL_WATER,
MATERIAL_LIGHT,
MATERIAL_TREE,
MATERIAL_LEAVES,
MATERIAL_GRASS_FOOTSTEPS,
@ -216,6 +198,8 @@ struct MapNode
*/
s8 param;
u8 pressure;
MapNode(const MapNode & n)
{
*this = n;