109 Commits

Author SHA1 Message Date
Auke Kok
14a15265db Allow nodes to specify which sides to connect to.
NDT_CONNECTED attempts to connect to any side of nodes that it can
connect to, which is troublesome for FACEDIR type nodes that generally
may only have one usable face, and can be rotated.

We introduce a node parameter `connect_sides` that is valid for
any node type. If specified, it lists faces of the node (in "top",
"bottom", "front", "left", "back", "right", form, as array) that
connecting nodeboxes can connect to. "front" corresponds to the south
facing side of a node with facedir = 0.

If the node is rotatable using *simple* FACEDIR, then the attached
face is properly rotated before checking. This allows e.g. a chest
to be attached to only from the rear side.
2016-03-12 12:08:17 -05:00
Auke Kok
f11d473497 Nodebox: Allow nodeboxes to "connect"
We introduce a new nodebox type "connected", and allow these nodes to
have optional nodeboxes that connect it to other connecting nodeboxes.

This is all done at scenedraw time in the client. The client will
inspect the surrounding nodes and if they are to be connected to,
it will draw the appropriate connecting nodeboxes to make those
connections.

In the node_box definition, we have to specify separate nodeboxes for
each valid connection. This allows us to make nodes that connect only
horizontally (the common case) by providing optional nodeboxes for +x,
-x, +z, -z directions. Or this allows us to make wires that can connect
up and down, by providing nodeboxes that connect it up and down (+y,
-y) as well.

The optional nodeboxes can be arrays. They are named "connect_top,
"connect_bottom", "connect_front", "connect_left", "connect_back" and
"connect_right". Here, "front" means the south facing side of the node
that has facedir = 0.

Additionally, a "fixed" nodebox list present will always be drawn,
so one can make a central post, for instance. This "fixed" nodebox
can be omitted, or it can be an array of nodeboxes.

Collision boxes are also updated in exactly the same fashion, which
allows you to walk over the upper extremities of the individual
node boxes, or stand really close to them. You can also walk up
node noxes that are small in height, all as expected, and unlike the
NDT_FENCELIKE nodes.

I've posted a screenshot demonstrating the flexibility at
    http://i.imgur.com/zaJq8jo.png
In the screenshot, all connecting nodes are of this new subtype.

Transparent textures render incorrectly, Which I don't think is
related to this text, as other nodeboxes also have issues with this.

A protocol bump is performed in order to be able to send older clients
a nodeblock that is usable for them. In order to avoid abuse of users
we send older clients a "full-size" node, so that it's impossible for
them to try and walk through a fence or wall that's created in this
fashion. This was tested with a pre-bump client connected against a
server running the new protocol.

These nodes connect to other nodes, and you can select which ones
those are by specifying node names (or group names) in the
connects_to string array:
      connects_to = { "group:fence", "default:wood" }
By default, nodes do not connect to anything, allowing you to create
nodes that always have to be paired in order to connect. lua_api.txt
is updated to reflect the extension to the node_box API.

Example lua code needed to generate these nodes can be found here:
    https://gist.github.com/sofar/b381c8c192c8e53e6062
2016-03-12 12:08:17 -05:00
RealBadAngel
2ce4f27f7f Remove new_style_water 2016-02-26 00:50:46 +00:00
RealBadAngel
8b602bba0f Cleanup selection mesh code, add shaders for halo and selection boxes 2016-02-08 03:57:42 -05:00
est31
e2613ec422 Add new ContentParamType2 "CPT2_DEGROTATE"
This might break some mods, but it is important for all uses of the param2 to
be documented.

This doesn't need a serialisation version or network protocol version change,
as old clients will still work on new servers, and it is bearable to have
new clients getting non rotated plants on old servers.
2015-10-04 23:59:41 +02:00
paramat
d3aa8df67b Firelike drawtype: Improve code
Remove unusable fine rotation by param2
Remove unused and redundant code
Fix code style issues
2015-09-14 08:04:01 +01:00
David Jones
9d1284b324 Change i++ to ++i 2015-08-25 18:33:52 -04:00
Craig Robbins
0731f9ed2a Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
Aaron Suen
b7263a190f Move texture_min_size even further down the pipe. Now, textures are JIT-upscaled using an image transformation, right at the time they're added to a mesh or particle; images used in 2D elements are left unscaled. This should fix any remaining issues with HUD elements. 2015-03-31 16:56:33 +10:00
SmallJoker
0b52580c5c Connect rails with connect_to_raillike and shorten the codes 2015-03-21 22:59:27 +10:00
Craig Robbins
27791ee1aa For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00
BlockMen
08d843e1c2 Improve group-based connection between raillike nodes 2015-03-05 23:24:32 +01:00
Loic Blot
188c15c3d8 Replace std::list to std::vector into tile.cpp (m_texture_trash) and move tile.hpp to src/client/ 2015-03-05 11:59:40 +01:00
BlockMen
6901d26cf8 Fix some rendering glitches
- Fixes particle draworder
- Fixes nodehighlighting
2015-03-05 10:51:18 +01:00
Kahrl
5a6cc7ded0 Fix NDT_GLASSLIKE normals
Remove inventorycube() workaround for default:glass in minimal game
2015-01-31 03:06:34 +10:00
Vanessa Ezekowitz
e221b9da2e Fix visual_scale for plantlike nodes (again)
fixes #1989

move the plant to the bottom of its node properly, without affecting its scale.  See isue #1989
2014-12-19 12:25:32 +10:00
Craig Robbins
08d1ef1d13 Fix visual_scale for NDT_PLANTLIKE being set too small 2014-12-18 20:28:14 +10:00
Kodexky
979a12e8c0 Fix raillike bug (currently manifests itself on Android), and minor improvement to readability.
NB: Minor edits to patch made by Zeno- (int to short and minor formatting)
2014-11-20 15:41:59 +10:00
ShadowNinja
7474ee6393 Fix wallmounted mesh rotations 2014-11-19 16:17:54 -05:00
RealBadAngel
b015b62dad Add option to enable mesh caching, add wallmounted for meshes. 2014-10-29 08:37:33 +01:00
RealBadAngel
73bad35cbc Fix broken plantlike drawtype. 2014-10-22 21:15:31 +02:00
RealBadAngel
8ddf8a4022 Recalculate normals for cached meshes.
Check if mesh is here before adding to meshcollector.

Fix deleting the meshes.
2014-10-21 18:43:29 +02:00
Craig Robbins
df5491d040 Various uninitialised variable fixes
sky.cpp: m_bgcolor.getAlpha() was being used before initialised

mesh related: m_highlight_mesh_color was being used uninitialised
2014-10-19 15:33:08 +02:00
RealBadAngel
1c09928344 Add meshnode drawtype. 2014-10-18 16:42:23 +02:00
BlockMen
e25777936f Add optional framed glasslike drawtype 2014-10-02 11:35:15 +02:00
TriBlade9
2d6eb3d2f3 Add firelike drawtype 2014-09-21 15:50:27 -04:00
ShadowNinja
dbf9e444b1 Split settings into seperate source and header files
This also cleans up settings a bit
2014-09-21 14:39:35 -04:00
RealBadAngel
69976d8f65 Bugfix: don't highlight air nodes. 2014-09-18 09:56:27 +02:00
RealBadAngel
61b86590fc Node highlighting. 2014-09-17 22:06:13 +02:00
RealBadAngel
2b4ddb217a Pass light sources in blue channel of vertex color instead of decoded light for all special drawtypes.
Plus some style fixes and optimizations.
2014-08-21 23:28:01 +02:00
RealBadAngel
b4a7bd68db Dont display interior of glasslike_framed node when its not defined.
Fixes https://github.com/minetest/minetest/issues/1514
2014-07-24 20:58:08 +02:00
RealBadAngel
d4105c18f4 Allow full circle rotation with 2degs step for plantlike drawtype. 2014-07-24 20:02:20 +02:00
RealBadAngel
4234e15116 Add rotation for plantlike drawtype. 2014-07-22 00:32:03 +02:00
RealBadAngel
453f1bae77 Bugfix in makeCuboid - apply rotations to all faces when 1 tile is given. 2014-07-20 16:22:48 +02:00
RealBadAngel
d03f38ed73 Fix texture glitches for plants with visual scale > 1.0 (jungle grass). 2014-07-17 14:10:23 +02:00
RealBadAngel
f8d077559c Fix texture hack in fences. 2014-07-17 13:37:18 +02:00
sapier
e2bc0d1dd8 Fix flipped textures for drawtype "glasslike" 2014-07-16 16:37:41 +02:00
RealBadAngel
5bcfda0dea Glasslike_framed drawtype rework. 2014-06-29 17:50:37 +02:00
sapier
4b548c6c2c Pass pointer to nodedef directly to avoid recalculation in quite often called function 2014-04-06 10:32:57 +02:00
PilzAdam
fd0b6ac837 Fix liquid_range
* Prevent graphical glitches on old servers
* Fix flowing of liquids with viscosity != 1 and range != 8
* Fix range = 0, no flowing nodes will appear
2013-11-02 15:47:44 +01:00
Sokomine
d7fc2a18b2 Add support for parameter 'visual_scale' for drawtypes 'signlike' and 'torchlike' like used for drawtype 'plantlike' 2013-10-14 21:38:56 +03:00
Kahrl
dd3b264302 Diagonal liquid animation 2013-08-17 01:00:36 +02:00
PilzAdam
6f29410895 Add liquid_range to nodedef 2013-07-20 20:41:17 +02:00
Kahrl
46340cbbe0 Remove texture atlas / AtlasPointer, rename getTextureRaw to getTexture 2013-07-02 03:03:10 +02:00
Jeija
804b298738 Make raillike nodes connect to any other raillike nodes if both are in the group connect_to_raillike 2013-05-22 15:08:24 +02:00
RealBadAngel
1fcf9cc367 Add new drawtype GLASSLIKE_FRAMED 2013-04-24 21:45:18 -04:00
RealBadAngel
4a390e8696 6d facedir 2013-03-23 21:31:05 +01:00
PilzAdam
01173e6de6 Fix new_style_water 2013-03-17 11:28:43 -04:00
proller
1f70fbcdb5 Liquid fine tuning 2013-03-14 17:06:25 -04:00
Ilya Zhuravlev
a12df55f29 Migrate to STL containers/algorithms. 2013-03-11 19:08:39 -04:00